I would suggest debugging with browser requests -- then switching to
Solrj after you are at 1st base.

In particular, try adding the &debugQuery=true parameter to the
request and see what solr thinks is happening.

The value that will "work" for the 'qt' parameter depends on what is
configured in solrconfig.xml -- I suspect you want to point to a
requestHandler that is configured to use edismax query parser.  This
can be configured by default with:

<lst name="defaults">
<str name="defType">edismax</str>
</lst>

ryan


On Wed, Apr 25, 2012 at 3:57 PM, Joe <joe.pol...@gmail.com> wrote:
> 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