lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gindin <vgin...@detectum.com>
Subject Scorer.iterator() - how to implement correctly
Date Fri, 01 Dec 2017 07:23:39 GMT
Hi

I'm implementing the custom QUERY with appropriate custom WEIGHT and SCORER.

I'm trying to implement Scorer.iterator() method. It should return an
iterator of documents that matches the query. Right? There are a lot of
descendant classes of the DocIdSetIterato.

1. How to choose correct one?
2. How to correctly implement Scorer.iterator() method?

I've tried DocIdSetIterator.all(context.reader().maxDoc());

But as I can see it returns all documents.

My task looks simple. I need to return a constant score depending on the
matched fields. I.e. field "model" score - 3f, field "vendor" - score - 5f.

I'm creating a subquery for each field and specify score for it using
custom QUERY that is almost the same as TermQuery except Weight.Scorer

Any help is appreciated.

Regards,
Vadim Gindin

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