On 3/23/2021 12:51 PM, Rahul Goswami wrote:
Hello,
Can someone please tell me what is the difference between q=myfield:* vs
q=myfield:[* TO *] for an indexed field "myfield". The available answers
online seem more like a best guess than a definitive answer, so I wanted to
get my understanding clarified. Also, my understanding is that myfield:[*
TO *] is more performant than myfield:* , is that correct?
The first is a wildcard query. The second is a range query.
When you query myfield:* Lucene and Solr actually look up all possible
terms in myfield and construct a huge query behind the scenes that
contains all those terms. If the field has millions or billions of
terms, that is REALLY slow. The memory allocations required to
construct that query can result in additional slowdowns.
In almost all cases, the range query is much faster.
Thanks,
Shawn