Hi,
Thanks, that seems to be the quickest way. But I did not get the part with
building a DisjunctionMaxQuery from the clauses. I would need to keep it as a
BooleanQuery, wouldn't I, and compare the weights from each clause and nullify
all but the max weight clause?
--
Jan Høydahl, search
- From: Jan Høydahl
Sent: Monday, February 25, 2013 6:32 AM
To: solr-user@lucene.apache.org
Subject: Max Score Query parser?
Hi,
A customer sends large, deeply nested boolean queries to Solr using the
default (lucene) parser.
The default scoring is summing up all the scores. For parts
Jan,
No, you wouldn't. Let's say that a BooleanQuery with SHOULD clauses is
equal to a DisjunctionMaxQuery with the same clauses up to scores i.e. you
can assert that they returns absolutely same documents, but with the
different scores (max vs sum).
Idea about dropping clauses' weights reminds
Hi,
A customer sends large, deeply nested boolean queries to Solr using the default
(lucene) parser.
The default scoring is summing up all the scores. For parts of this query they
would like
to use the Max score instead of the sum, e.g. for q=+A +B +(C D E) we want the
max
of C,D,E. I was
Jan,
I think it's worth to start from extending LuceneQParser. Then after
parent's parse() returns a query instance. It can be cast to BooleanQuery,
after that it's possible to check that all clauses have SHOULD occur, and
to create an instance of DisjunctionMaxQuery() from the given clauses.
Am
Bite the bullet and use a function query for the boost:
bf=max(query({!v='field:C'}),query({!v='field:D'}),query({!v='field:E'}))
-- Jack Krupansky
-Original Message-
From: Jan Høydahl
Sent: Monday, February 25, 2013 6:32 AM
To: solr-user@lucene.apache.org
Subject: Max Score Query