see the thread "spellcheck issues" going on right now between Jason
Rennie and me. In there is a small sample piece of code that does
spell checking through SolrJ.
On Oct 8, 2008, at 12:52 PM, Sunil Raj wrote:
Hi,
I am trying to use SolrJ java client to do search and the basic
search works
fine with the code given below.
SolrServer server = new CommonsHttpSolrServer( "
http://localhost:8983/solr");
SolrQuery query = new SolrQuery().
setQuery(searchKey).
addHighlightField("TITLE_EN_US").
setRows(new Integer(10)).
setStart(new Integer(startPosition)).
setHighlight(true);
QueryResponse rsp = server.query( query );
However I would like to do spell check for the query string and
would like
alternate suggestions.
I looked at the documentation for spellcheck component and saw
examples for
queries using http url request. for eg:
http://localhost:8983/solr/spellCheckCompRH?q=pizzza&spellcheck.q=pizzza&spellcheck=true&spellcheck.build=true
I would like to acheive the same using the Java client api.
Could anyone provide sample code for the same?
Thanks&Rgds,
Sunil
--------------------------
Grant Ingersoll
Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ