lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <>
Subject Re: Testing for field existence
Date Mon, 18 Aug 2008 23:37:50 GMT
Karsten F. wrote:
> Hi Bill,
> you should not use prefix-query (XXXX*), because in first step lucene would
> generate a list of all terms in this field, and than search for all this
> terms. Which is senceless.

That's not quite an accurate description of what it does as it nowhere 
near as slow as doing a query for each term one by one, but yes, it's 
inefficient.  You can use a PrefixFilter to do much the same thing in a 
somewhat quicker fashion, although it still takes a little more time 
than having a new field.

This may help if adding a new field is impractical (e.g. if you have to 
support older text indexes.)


Daniel Noll

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

View raw message