lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <rcm...@gmail.com>
Subject Re: Using coord of one BooleanQuery as a multiplier for its siblings
Date Wed, 29 Aug 2012 15:04:10 GMT
On Mon, Aug 27, 2012 at 8:31 PM, pranshu sharma <pranshu@cis.upenn.edu> wrote:
> Hi there,
>
> I had a question about migrating the coord value one level up. My current
> query structure has a root BooleanQuery with a bunch of nested BooleanQuery
> children: one of these looks for all terms in the query issued, and I want
> to apply the coord factor for this BooleanQuery to all its siblings. The
> idea here is to have the overall score reflect the number of tokens matched.
>
> For example, if the query is 'apple banana orange', my query structure
> looks like this:
>
> BQ0 (root): coord = 1
>     BQ1: (coord enabled)
>         BQ1a: +apple
>         BQ1b: +banana
>         BQ1c: +orange
>     BQ2: (coord = 1)
>         BQ2a: 'apple banana'
>         BQ2b: 'banana orange'
>     ...
>
> (BQ2 basically takes care of bigrams.)
>
> Now, if I have two documents that look like:
>
> Doc A: apple orange banana
> Doc B: apple banana
>
> Doc A would get a higher overall score if the score from BQ2 is multiplied
> with coord for BQ1 (=2/3), than if it wasn't. Could you recommend how I go
> about implementing this idea?

I think you want to use BooleanQuery's disableCoord option for BQ2 and BQ0 ?

-- 
lucidworks.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message