lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Khludnev <mkhlud...@griddynamics.com>
Subject Re: Max Score Query parser?
Date Mon, 25 Feb 2013 20:05:30 GMT
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 I missing something?


On Mon, Feb 25, 2013 at 6:32 PM, Jan Høydahl <jan.asf@cominvent.com> wrote:

> 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 thinking about writing a MaxScoreQParserPlugin returning
> the max of any of its clauses,
> so you could express the business requirement as this query: q=+A +B
> +_query_:"{!maxscore}C D E",
> where C D E could in turn be nested boolean expressions.
>
> I cannot use DisMax, cause it only returns max across multiple fields, not
> across multiple clauses.
>
> Perhaps something like this exists somewhere? If not, any pointers for
> where to start, since I'm not
> intimately familiar with the Scorer/Weight APIs?
>
> --
> Jan Høydahl, search solution architect
> Cominvent AS - www.cominvent.com
> Solr Training - www.solrtraining.com
>
>


-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
 <mkhludnev@griddynamics.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message