lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: search for empty field?
Date Wed, 03 Sep 2008 18:49:35 GMT
This has been discussed multiple times, so looking at the
searchable archive will give you more detailed info. But as
I remember, the consensus suggestion was to index some
"impossible" value for those documents that lack a field.
For instance, say your field was "sometimes". I document
that had nothing to index for that field could get a value of
"ZZZZZZZZZZZZZ".

Now your query is simple sometimes:ZZZZZZZZZZZZZ


Best
Erick

On Tue, Sep 2, 2008 at 4:23 AM, Chris Lu <chris.lu@gmail.com> wrote:

> Is it possible to query for documents that have empty values for a field?
>
> Say need to find documents with category empty, I tried negative query:
>  -category:*
> But it returns 0 document. I think "category:*" is basically match all, so
> this "-category:*" doesn't work.
>
> Thanks!
>
> --
> Chris Lu
> -------------------------
> Instant Scalable Full-Text Search On Any Database/Application
> site: http://www.dbsight.net
> demo: http://search.dbsight.com
> Lucene Database Search in 3 minutes:
>
> http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes
> DBSight customer, a shopping comparison site, (anonymous per request) got
> 2.6 Million Euro funding!
>

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