lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: Rejecting fields with null values
Date Thu, 21 Jun 2007 00:08:58 GMT
Keep in mind filters too... they can be much more efficient if used often:
?q=test&fq=field_b:[* TO *]

-Yonik

On 6/20/07, Thiago Jackiw <tjackiw@gmail.com> wrote:
> Hoss,
>
> > As an inverted index, the Lucene index Solr uses doesn't know when
> > documents have an "empty" value ... it stores the inverted mapping of
> > value=>documents, so there is no way to query for field_b:NULL, let alone
> > "NOT field_b:bull"
>
> I see what you mean.  I guess searching for fields that require to
> have a value like the way you explained is a good way to go.
>
> Thanks!
>
> --
> Thiago Jackiw
> acts_as_solr => http://acts-as-solr.railsfreaks.com
>
>
> On 6/20/07, Chris Hostetter <hossman_lucene@fucit.org> wrote:
> > : I'm not sure if this is possible or not, but, is there a way to do a
> > : search and reject fields that are empty or have null values like the
> > : pseudo code below?
> >
> > As an inverted index, the Lucene index Solr uses doesn't know when
> > documents have an "empty" value ... it stores the inverted mapping of
> > value=>documents, so there is no way to query for field_b:NULL, let alone
> > "NOT field_b:bull"
> >
> > you can however query forthings like:  field_b:[* TO *] which requres
> > field_b to have some value (that seems to be the use case you are after)
> >
> > as a general rule, if you really want to be abel to support searches for
> > rhings like "find all docs wher there is no value in field X" the easiest
> > way to achieve something like that in Solr is to configure the field with
> > a default value in the schema ... something that would never normally
> > appear in your data (a placeholder for 'null' so to speak) and query on
> > that.
> >
> >
> > -Hoss
> >
> >
>

Mime
View raw message