Re: Scorer.iterator() - how to implement correctly

2017-12-04 Thread Vadim Gindin
Adrien, you're right. I've checked it again - it starts working. Probably, I had an error in my index causing wrong behavior or yes misusing API. Here is my code BooleanQuery.Builder expected = new BooleanQuery.Builder(); Query param_vendor = new BoostQuery(new ConstantScoreQuery(new TermQuery(ne

Re: Scorer.iterator() - how to implement correctly

2017-12-04 Thread Adrien Grand
It is correct... but ConstantScoreQuery is the way to go with your use-case. It should not return scores of 0 unless you are misusing the API in some way. Please share the code that you use in order to build your query. Le lun. 4 déc. 2017 à 11:10, Vadim Gindin a écrit : > Adrien. > > I've found

Re: Scorer.iterator() - how to implement correctly

2017-12-04 Thread Vadim Gindin
Adrien. I've found some working solution. Here is how it calculates iterator: this.iterator = context.reader().postings(query.getTerm(), PostingsEnum.ALL); if (this.iterator == null) this.iterator = DocIdSetIterator.empty(); Is that implementation correct? On Sun, Dec 3, 2017 at 4:43 PM, Vadim

Re: Scorer.iterator() - how to implement correctly

2017-12-03 Thread Vadim Gindin
Hi Adrien. ConstantScoreQuery - I'd tried that earlier. There is the problem. It returns score = 0.0 for my configuration with Boolean.. I've debugged and found, that it happens because of the following: @Override public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost

Re: Scorer.iterator() - how to implement correctly

2017-12-01 Thread Adrien Grand
There are many implementations because each query typically needs a custom DocIdSetIterator implementation. It looks like your use-case doesn't need a custom query though, you could use a TermQuery wrapped in a constant-score query (see my reply to the other question you asked). Le ven. 1 déc. 201