Scorer.iterator() - how to implement correctly

2017-11-30 Thread Vadim Gindin
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

Re: COST vs SCORE vs WEIGHT

2017-11-30 Thread Vadim Gindin
Thanks Adrien! 1) Here is my code snippet: Query params_vendor = new ConstTermQuery(new Term("params_vendor", queryStr), 5f); Query params_model = new ConstTermQuery(new Term("params_model", queryStr), 5f); Query params_value = new ConstTermQuery(new Term("params_value", queryStr), 3f); Query par

Re: COST vs SCORE vs WEIGHT

2017-11-30 Thread Adrien Grand
Hi Vadim, A Weight is the specialization of a query for a given index reader. It has access to index statistics that will help compute scores for instance. A Scorer is the specialization of a weight for a given segment. It can iterate over matches and compute scores. The cost of a scorer is the

COST vs SCORE vs WEIGHT

2017-11-30 Thread Vadim Gindin
Hi 1) What is the principal difference between COST vs SCORE vs WEIGHT 2) Assume we have BooleanQuery with 5 TermQuery subqueries that are included via SHOULD condition. Assume we have 5 fields and one subquery is need to search in one field. Some product of MultiFieldQueryParser. In this case th