Hi,
 
I have a request handler in my solrconfig.xml : /spellCheckCompRH 
It utilizes the search component "spellcheck".
 
When I specify following query in browser, I get correct spelling
suggestions from the file dictionary.
 
http://localhost:8080/solr/spellCheckCompRH/?q=SolrDocs&spellcheck.q=rel
evancy&spellcheck=true&fl=title,score&spellcheck.dictionary=file
 
Now I write a java program to achieve the same result:
 
Code snippet
--------------------
 .
 .
 
server = new CommonsHttpSolrServer("http://localhost:8080/solr";);
 .
 .
SolrQuery query = new SolrQuery();
query.setQuery("solr" );
query.setFields("*,score");
query.set("qt", spellCheckCompRH);
query.set("spellcheck", "true");
query.set(SpellingParams.SPELLCHECK_DICT, "file");
query.set(SpellingParams.SPELLCHECK_Q , "solt");
 .
 .
QueryResponse rsp = server.query( query );
SolrDocumentList docs = rsp.getResults();
SpellCheckResponse srsp = rsp.getSpellCheckResponse();
 
I get documents for my query but I do not get any spelling suggestions.
I think that the request handler is not getting set for the query
correctly.
 
Can someone please help. 
 
Best Regards,
Mukta

Reply via email to