0

We are using Solr 6.1.0 and Solrnet as our client tool to communicate to solr.

When we try to put the words "Lion Knig" in our search,Solr spellchecker auto corrected "Knig" as "King" and got the "result sets" for "Lion King".

On our screen's we need to show the display text as "Showing results for Lion King Instead of LION Knig". Solr corrected Knig as "King" which is expected and is returning the suggested text "king" along with original Query text "Lion Knig" and the correct result set.The problem here is When we use suggested text it gives wrong impression to the user he is searching only "KING".

Is there any property on the solr config which include complete corrected string like "Lion King"?

Attached image for your clarity.

Check image for the issue.

  • The `spellcheck.collate` parameter can be used to return a query with the spelling corrections applied. Check if it gives you the result you're looking for. – MatsLindh Apr 06 '20 at 09:25
  • we have set spellcheck.collate = true, but not returning the whole corrected text.whole suggestions are coming. can you tell me how the text will return – Mahanth Madarampalli Apr 07 '20 at 14:45

1 Answers1

0

I have no knowledge about Sorlnet, but normally there should be a way to get the CollationQuery from the SpellcheckResponse. In SolrJ there is a way to get the CollatinQueryString like this:

SpellCheckResponse spellCheckResponse = queryResponse.getSpellCheckResponse();
            CollationQuery collationQuery = new CollationQuery(spellCheckResponse);
            collationQueryString = collationQuery.getCollatedQueryString();

Then you should be able to giv this queryString back to your frontend.

Hope this helps.

MJ1986
  • 86
  • 2