lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven White <>
Subject Re: BoolField fieldType
Date Mon, 08 Jun 2015 14:05:54 GMT
Thank you all for helping and updating the doc.  As always, it is greatly


On Thu, Jun 4, 2015 at 1:53 PM, Chris Hostetter <>

> : What about at query time?  If I index my Boolean and it has one of the
> : variations of "t", "T" or "1", what should my query be to get a hit on
> : "true"?  q=MyBoolField:<what> ?  What should the value of <what> be when
> I
> : want to check if the field has a "true" and when I need to check if it
> has
> : a "false"?
> the string representations are parsed into the logical concepts -- it
> doesn't matter if one doc was added with a value of "true" and another doc
> was indexed with a value of "T" in the index they both have a true value.
> likewise at query time it doesn't matter if you query for "true" or "T" -
> they are both going to find all docs that have a true value, and querying
> for "F" or "false" or "BOGUS" are going to find you all docs with a false
> value.
> where things get interesting is is when you deal with documents that do
> not have a value in the field at all -- searching for something like
> this...
>         q=-MyBoolField:true
> ...won't just return all the docs with a false value, it will also return
> all docs w/o any value.
> if you want to find all documents that don't have any value, you can
> search for this...
>         q=-MyBoolField:*
> note that the "*" is a query parser feature, so it causes the query parser
> to do a "docs with value in this field" query w/o ever asking the
> BoolField to "parse" the input string as a true/false value.
> -Hoss

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