> Is there an example of how to use dismax with embedded
> Solr?I am currently
> creating my query like this:
>         QueryParser parser = new
> QueryParser(Version.LUCENE_CURRENT,"content", new
> StandardAnalyzer(Version.LUCENE_CURRENT));
>         Query q = parser.parse(query);
>         searcher.search(q, end);
> 
> How would this look with DisMax query?
> Any help would be appreciated.

Every valid solr search URL can be converted into SolrQuery. Some of the 
parameters have special named methods, some does not.

If you have a separate handler that uses dismax as a defType you can use 
simply: 

SolrQuery q = new SolrQuery();
q.setQueryType("dismax"); // this roughly equivalent of q.set("qt", "dismax")

It does not have a special method to set query parser but you can use 
q.set("defType","dismax") instead.

You can think SolrQuery as a something that holds key-value pairs.


     

Reply via email to