Re: Max Score Query parser?

2013-02-26 Thread Jan Høydahl
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

Re: Max Score Query parser?

2013-02-26 Thread Jan Høydahl
- 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

Re: Max Score Query parser?

2013-02-26 Thread Mikhail Khludnev
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

Max Score Query parser?

2013-02-25 Thread Jan Høydahl
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

Re: Max Score Query parser?

2013-02-25 Thread Mikhail Khludnev
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

Re: Max Score Query parser?

2013-02-25 Thread Jack Krupansky
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