lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <>
Subject Re: Combining Wildcard and Term Queries?
Date Tue, 26 Aug 2008 17:12:41 GMT
On Dienstag, 26. August 2008, Chris Bamford wrote:

> That sounds like what I'm after - but how do I get hold of the
> IndexReader so I can call IndexReader.terms(Term) ?
> The code where I am doing this work is getFieldQuery(String field,
> String queryText) of my custom query parser ...

QueryParser indeed doesn't know about IndexSearchers and IndexReaders, so 
you either have to do the work outside (whereever you have an 
IndexSearcher, it lets you access the IndexReader) and hand the results 
over to your QueryParser via e.g. its constructor. Or you hand over the 
IndexReader to your QueryParser. That's not really elegant but I don't 
know a better solution.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message