On 7/28/2021 11:48 AM, mtn search wrote:
Thanks Walter, Alex!
Yes I regularly use - Search for *:* -body:*
That syntax, while it works for finding docs where the body field is
entirely missing, is not the best option. You'll likely find that this
syntax is MUCH faster, and returns identical results:
*:* -body:[* TO *]
The reason it's faster is that * by itself is a wildcard query, and
unless the cardinality of the field is very low, those are extremely
inefficient. I would expect a field named "body" to have cardinality in
the millions or billions, for sufficiently large indexes.
Note that neither of these queries will find docs where the value is the
empty string, because I believe that IS matched by either a wildcard
query or a range query.
Thanks,
Shawn