lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <lucenelist2...@danielnaber.de>
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.

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message