lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: query to return docs that has a certain field
Date Thu, 11 Sep 2008 23:58:20 GMT

: Is there a way? I could make the documents containing field A have
: another field B equals some flag, and then query for that flag, but
: that would be kind of inefficient.

There is space efficienty and there is time effeciency.

if there was only only value for field B (ie: "true" or "yes") then as 
long as you only index it (with omitNorm=true) and don't "store" it, it 
would acctually be fairly space efficient.

without adding any new fields: a RangeFilter (or ConsantScoreRangeQuery) 
on field A with both a null lower and upper bound will find all docs with 
any value in the field A -- but a TermQuery("B", "yes") is probably going 
to be more efficinet in terms of query time.


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

View raw message