lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabio Confalonieri <>
Subject Re: Finding documents with undefined field
Date Thu, 08 Jun 2006 14:33:21 GMT

Chris Hostetter wrote:
> There are a couple of things you can do here...
> 1) Use the same approach i described before if you have a uniqueKey,
> search for all things with a key and then exclude things that have a value
> in your field.  Since you are writing a request handler, you could also
> progromaticaly build up a BooleanQuery containing a MatchAllDocsQuery
> object and your prohibited clause even if you don't have a uniqueKey
> 2) you can fetch the DocSet of all documents that *do* have a value for
> that field, and then get the inverse, and use that for your facet counts.
> this is something that was discussed before in a thread Erik started...
> ..

Ok at last I tried the easy way so, when I find a particular predefined 
"undefined-value" in a filter or facet, I convert the query to parse to:

   "type:ad AND -" +field+":[* TO *]"

"type:ad" matches all my documents, the other type I have is "facets"
 (many thanks for the unbound range trick).

I cannot see any particular slowliness (but I'm testing with 50.000 docs
now) perhaps thanks to Solr ConstantScoreRangeQueries conversion, 
should I worry with bigger numbers, say 300.000 docs ?

My two cents on Solr development: surely "DocSet.andNot(DocSet other)"
capability would be precious to optimize the undefined-field and other 
inverse-query problems.

Thanks again

View this message in context:
Sent from the Solr - User forum at

View raw message