Hi,

I'm using the solrj API to query my SOLR 3.6 index. I have multiple text
fields, which I would like to weight differently. From what I've read, I
should be able to do this using the dismax or edismax query types. I've
tried the following:

SolrQuery query = new SolrQuery();
query.setQuery( "title:apples oranges content:apples oranges");
query.setQueryType("edismax");
query.set("qf", "title^10.0 content^1.0");
QueryResponse rsp = m_Server.query( query );

But this doesn't work. I've tried the following variations to set the query
type, but it doesn't seem to make a difference.

query.setQueryType("dismax");
query.set("qt","dismax");
query.set("type","edismax");
query.set("qt","edismax");
query.set("type","dismax");

I'd like to retain the full Lucene query syntax, so I prefer ExtendedDisMax
to DisMax. Boosting individual terms in the query (as shown below) does
work, but is not a valid solution, since the queries are automatically
generated and can get arbitrarily complex is syntax.

query.setQuery( "title:apples^10.0 oranges^10.0 content:apples oranges");

Any help would be much appreciated.

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Boosting-fields-in-SOLR-using-Solrj-tp3939789p3939789.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to