Matthew Runo wrote:
Hello!
Please forgive my newbie question about SolrJ, but I was unable to find
my answer in the SOLRJ source code or the wiki (I'll add it if someone
helps).
Would anyone be so kind as to provide a quick example of using the
Spellcheck handler and the MoreLikeThis handler with SOLR-J?
With spellcheck, you will be in new water (I think)... you can get the
response as a NamedList, but there is not anything that puts that into
user friendly functions.
SolrQuery q = new SolrQuery( "foo" );
q.setQueryType( "spelling" );
q.set( "anyparam", value );
QueryResponse rsp = solr.query( q )
NamedList nl = rsp.getResponse();
you will have to pick stuff out of the NamedList manually. If you want
to contribute a SpellCheckRequest/Response that would be great!
For MLT, the standard QueryRequest should work. in 1.3-dev, both
standard and dismax support mlt queries. Perhaps we should add getters
and setters to SolrQuery so you don't have to call:
q.set( MoreLikeThisParams.MLT, true );
ryan