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: BooleanWeight.scorer() gives a TermScorer
Date Thu, 07 Aug 2014 16:50:48 GMT
This can happen in some cases: for example if you are doing a
disjunction of "foo" and "bar" with coordination factor disabled, and
the segment has no postings for "bar".

In this case the optimum scorer to return is just a termscorer for "foo".

On Thu, Aug 7, 2014 at 12:42 PM, Christian Reuschling
<reuschling@dfki.uni-kl.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> I try to get the scorer for a result document, for further computation.
>
> List<AtomicReaderContext> leafContexts = indexReader.leaves();
> int n = ReaderUtil.subIndex(scoreDoc.doc, leafContexts);
> AtomicReaderContext ctx = leafContexts.get(n);
> Scorer scorer = weight.scorer(ctx, ctx.reader().getLiveDocs());
>
> in most cases, the type of the scorer is DisjunctionSumScorer. But for one result document,
the
> type of scorer is surprisingly a TermScorer.
>
> the weight object is in any case the same - the only different thing is the scoreDoc.doc
doc
> number. It seems that it is the result doc with the smallest doc number, all other result
> documents are from a different subIndex  (n).
>
> For DisjunctionSumScorer, my code works just fine. What is the reason that a BooleanWeight
can
> return a TermScorer? And can I force the weight to do not?
>
> best regards
>
> Christian
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.19 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iEYEARECAAYFAlPjrGkACgkQ6EqMXq+WZg/d/ACgilM3iLefG5LQzVXX9bv6xIV7
> 4asAoLWg4yIaaJa/VLoRU7QjS6Vaqnn2
> =I3ZD
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

---------------------------------------------------------------------
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