If parts of your BooleanQuery need an analyzer, specify that when you create that bit of the overall query.
BooleanQuery bq = new BooleanQuery(); NumericRangeQuery nrq = ...; QueryParser qp = new QueryParser(..., analyzer); Query q = qp.parse("whatever"); ... bq.add(nrq, ...); bq.add(q, ...); ... -- Ian. On Tue, Apr 20, 2010 at 8:08 PM, Murdoch, Paul <paul.b.murd...@saic.com> wrote: > Hi, > > > > I'm building a BooleanQuery that may contain a NumericRangeQuery. The > NRQ may be one of several sub-queries in the parent BooleanQuery. I > wasn't able to make the NRQ function properly by extending the > QueryParser and overriding the getRangeQuery method. So I'm building > the entire BooleanQuery in code. I'm passing the BooleanQuery to an > IndexSearcher to get hits, but I'm not getting the expected results. I > believe this is due to not setting the Analyzer. I'm used to using the > QueryParser constructor to set the Analyzer to be the same as the > IndexWriter's that built the index. So how do I set the Analyzer for an > IndexSearcher without instantiating a QueryParser? I'm using 2.9.2. > > > > Thanks, > > > > Paul --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org