lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrien Grand <jpou...@gmail.com>
Subject Re: Query documents where Field Doesn't Exist
Date Fri, 13 Nov 2015 13:21:04 GMT
Hi Vlad,

This is something that you generally can't do. If you have doc values
enabled on your fields, you can use Lucene's FieldValueQuery, but beware
that this query is very slow. Otherwise if your field is indexed, you can
run a TermRangeQuery that has both bounds open but this will be even slower
(and by that I mean that this could never return on a large index). So
generally the best way to address this problem is to solve it by indexing a
meta-data field that contains the list of the fields that a document
contains. Then you can filter documents that have a field or not by running
a TermQuery against this field.


Le mer. 11 nov. 2015 à 22:43, Vlad K <kuzminva@gmail.com> a écrit :

> Hello,
>
> I read some discussions at Internet and still don't see if there is an
> official Lucene's solution to support: "query documents where Field Doesn't
> exist"
>
> Do you know if there is some recommended solution?
>
> Thanks,
> Vladimir Kuzmin
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message