Hey Vishnu, I'm trying to understand what you're trying to accomplish (cc'ing Lucene user group to solicit additional advice)
Are you trying to extract all the terms for a given document? If so, you might just want to enable term vectors to analyze the index terms for the document. -Doug On Fri, Jan 24, 2014 at 1:56 AM, Vishnu Mishra <vishnuprasa...@outlook.com>wrote: > Hi Doug, > I have gon through your latest post " Build your own Custom > Lucene Query and Scorer" and it is really a great post. It helps us to > understand Lucene scoring and many more things related to the Lucene Query > scoring. Apart form this, I am facing one big problem while Query Rewriting > and extracting terms out of it. The problem is, By default lucene rewrite > query on whole index using IndexReader for e.g. > > Query rewrittenQuery = > query.rewrite(searcher.getAtomicReader()); > rewrittenQuery.extractTerms(termSet); > > What if I want to rewrite query only of one document using document id in > place of IndexReader something like > > Query rewrittenQuery = query.rewrite(documentID); > rewrittenQuery.extractTerms(termSet); > > Is this possible in Lucene or can we do it by some other technique. If you > have any Idea of doing this then share with me. > > > > Thanks > -- Doug Turnbull Search & Big Data Architect OpenSource Connections <http://o19s.com>