On Thursday 25 May 2006 21:08, Crump, Michael wrote: > Hello, > > > > I'm working on a search application and I need to know if it is possible > to get the number of terms that actually matched a Boolean query. For > example let's say I have field test with values aaa bbb ccc d e f and I > constructed a Boolean query like this: test:aaa OR test:bbb OR test:e > is it possible to get the count - 3 for the the terms (aaa, bbb, e) that > matched from the test field. If not would it be possible to modify the > BooleanScorer to accomplish this?
Have a look at Similarity and DefaultSimilarity. It looks like you need your own Similarity with a non constant coord() implementation, and some constant value for the rest of the methods in there. The first argument to coord() is the number of matching clauses for a document for a boolean query. The value returned by coord() will be used in the calculation of the score value for the document. Regards, Paul Elschot --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]