On Thursday 27 January 2011 21:33:10 Paul Elschot wrote:
> On Thursday 27 January 2011 00:21:22 Tavi Nathanson wrote:
> > 
> > Hey everyone,
> > 
> > Aside from simply disabling coord for an entire query, I was wondering if
> > there was a good way to disable coord for a BooleanClause within a query
> > such that the max coord value, and the overlap value, simply ignore that
> > clause?
> > 
> > For example, I have the following query:
> > 
> > (apple OR banana OR orange OR ("apple banana" OR "banana orange"))
> > 
> > I'd like to modify the coord score of the above query such that the *entire*
> > query will be multiplied by 2/3 if "apple" and "banana" are matched.
> > Currently, it'll be multiplied by 2/4 or 3/4, depending on whether the final
> > clause (the two phrases) are matched.
> > 
> > (Another option is to turn the query into ((apple OR banana OR orange) OR
> > ("apple banana" OR "banana orange")): this will result in the right number,
> > 2/3; however, it'll only be multiplied to the left clause, and I want it
> > multiplied by the entire query.)
> > 
> > If I were to hack this together, I would go into BooleanClause and add an
> > isIgnoringCoord() for each clause. Then, in BooleanScorer2, I would modify
> > the logic such that maxCoord and nrMatchers don't consider any BooleanClause
> > with such a flag. But I figure there must be a better way :)
> 
> It would be easier to make a DisjunctionSumQuery that scores by using
> DisjunctionSumScorer. The weighting between this Query and Scorer could
> simply do nothing except for passing things to the scorer, or ma ybe
> normalize just like BooleanQuery.
> Then use that as the top level for the second form of the query above.

Perhaps even better to that as the top level for this form:

 (apple OR banana OR orange) OR "apple banana" OR "banana orange"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to