Re: How to get all matched terms in a PrefixQuery

2016-09-14 Thread Michael McCandless
Also please realize that PrefixQuery, at default settings, will sometimes (often, depending on how you use it) bypass BooleanQuery and do the "term at a time" rewrite, which foils your effort. You could force PrefixQuery to always use BooleanQuery (setRewriteMethod), but this can cause horrific pe

Re: How to get all matched terms in a PrefixQuery

2016-09-14 Thread Terry Smith
Rajnish, Thought you should be aware of LUCENE-6229 which discusses the possibility of removing the Scorer.getChildren API. --Terry On Tue, Sep 13, 2016 at 11:10 PM, Rajnish kamboj wrote: > Thanks Mike > > I would rather go with first approa

Re: How to get all matched terms in a PrefixQuery

2016-09-13 Thread Rajnish kamboj
Thanks Mike I would rather go with first approach with Scorer.getChildren API. (will try). The second approach I have thought of but you are right, it is costly. Regards Raj On Wednesday 14 September 2016, Michael McCandless < luc...@mikemccandless.com> wrote: > You can't do this very easily, u

Re: How to get all matched terms in a PrefixQuery

2016-09-13 Thread Michael McCandless
You can't do this very easily, unfortuantely. The way PrefixQuery runs is to find (globally, across the index) all terms that have that prefix. If there are enough of them, it goes term by term marking the documents in a bitset, and then iterates that bitset in the end. So the information of whi

How to get all matched terms in a PrefixQuery

2016-09-13 Thread Rajnish kamboj
Hi How can I get all matched terms of a document in PrefixQuery? Term t2 = new Term("contents", "br"); PrefixQuery query = new PrefixQuery(t2); Suppose I have few documents with 1000 different terms. Search is showing me the document in which it find the br words. Now, how can I get all the br