On 2/17/2016 12:34 AM, Salman Ansari wrote: > 2) "Behind the scenes, Solr will interpret this as "all possible values for > field" --which sounds like it would be exactly what you're looking for, > except that if there are ten million possible values in the field > you're searching, > the constructed Lucene query will quite literally include all ten million > values." > > Does that mean that the [* TO *] syntax does not return all results?
What the [* TO *] range query will do is match all documents where the named field *has a value*. It will exclude documents where the field is missing. So a query of "*:* -field:[* TO *]" will return all documents where field is not present. Related note: If the field is present but contains the empty string, it *is* matched by the range query. The field must be entirely missing to not match the range. A full wildcard query (like field:*) does much the same thing, but in a different way that might not perform as well as the range query. If you want *all* documents, use *:* for your query. This is a special query -- even though it looks like it's a double wildcard, it isn't. Thanks, Shawn