lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: Query that returns all docs that contain a field
Date Mon, 19 Dec 2011 13:39:56 GMT
Hi,

There is also a Query/Filter based on that FieldCache:
o.a.l.search.FieldValueFilter, possibly wrapped with ConstantScoreQuery

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Michael McCandless [mailto:lucene@mikemccandless.com]
> Sent: Monday, December 19, 2011 2:36 PM
> To: java-user@lucene.apache.org
> Cc: paul_t100@fastmail.fm
> Subject: Re: Query that returns all docs that contain a field
> 
> You could also use FieldCache.getDocsWithField; it returns a bit set where
the
> bit is set if that document had that field.
> 
> Mike McCandless
> 
> http://blog.mikemccandless.com
> 
> On Mon, Dec 19, 2011 at 7:32 AM, Trejkaz <trejkaz@trypticon.org> wrote:
> > On Mon, Dec 19, 2011 at 9:05 PM, Paul Taylor <paul_t100@fastmail.fm>
> wrote:
> >> I was looking for a Query that returns all documents that contain a
> >> particular field, it doesnt matter what the value of the field is
> >> just that the document contains the field.
> >
> > If you don't care about performance (or if it runs fast enough
> > already), use a PrefixQuery with "" as the prefix.
> >
> > If you care about performance, add a new field which contains the
> > names of each field in the document, and query on that.
> >
> > TX
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
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