On 7/20/2017 3:27 PM, Hendrik Haddorp wrote: > If the range query is so much better shouldn't the Solr query parser > create a range query for a token query that only contains the > wildcard? For the *:* case it does already contain a special path.
The *:* query is a special string. Although it *looks* like it has a wildcard for the field and a wildcard for the value, this is now how the query parser treats that string. It is a special "all documents" query that is *highly* optimized to execute very quickly. Although it probably could be possible to optimize "field:*" queries to a range query, there are certain situations in which the wildcard query *is* the best option ... so if Solr were to optimize it, it might in fact be *slower*. Instead of having this optimization, Solr lets you do whatever you want with the available syntax, even if it's not the best option. I can't think of any downside to the optimization for "*:*", which is very likely why that string is treated specially. Something to note: You cannot specify a wildcard for the fieldname. So "*:searchterm" queries do not work. Thanks, Shawn