lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anshum <ansh...@gmail.com>
Subject Re: search on documents which DO NOT have field defined
Date Thu, 11 Mar 2010 09:06:47 GMT
Hi,

How about indexing a dummy token for empty docs? that way you may pick up
all docs that are actually null/empty by querying for the dummy token.
Make sure that the dummy token is never a part of any actual document (token
stream).
Perhaps this should work!

--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blogspot.com

The facts expressed here belong to everybody, the opinions to me. The
distinction is yours to draw............


On Thu, Mar 11, 2010 at 4:34 AM, Tom Hill <solr-list@worldware.com> wrote:

> Oops. I was thinking solr.
>
> How about this, to find docs that don't have a value in the weight field?
>
>   TermRangeQuery trq = new TermRangeQuery("weight", null, null, true, true
> );
>
>    BooleanQuery bq = new BooleanQuery();
>
>    bq.add(new MatchAllDocsQuery(), BooleanClause.Occur.MUST);
>
>    bq.add(trq, BooleanClause.Occur.MUST_NOT);
>
>
>
> Tom
>
>
> On Wed, Mar 10, 2010 at 2:11 PM, Tom Hill <solr-list@worldware.com> wrote:
>
> > Try
> >
> > -fieldname:[* TO *]
> >
> > as in
> >
> >
> >
> http://localhost:8983/solr/select/?q=-weight%3A[*+TO+*]&version=2.2&start=0&rows=10&indent=on
> >
> > Tom
> >
> > On Wed, Mar 10, 2010 at 1:48 PM, bgd <woods5242-photography@yahoo.com
> >wrote:
> >
> >> Hi,
> >> I have a bunch of documents which do not have a particular field
> defined.
> >> How can define a query do retrieve only those documents?
> >>
> >> Thanks!
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >>
> >
>

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