Hi Shawn, Thanks for taking time and replay. Thanks, Deepu
On Thu, Nov 26, 2020 at 10:53 PM Shawn Heisey <elyog...@elyograg.org> wrote: > On 11/25/2020 10:42 AM, Deepu wrote: > > We are in the process of migrating from Solr 5 to Solr 8, during testing > > identified that "Not null" queries on plong & pint field types are not > > giving any results, it is working fine with solr 5.4 version. > > > > could you please let me know if you have suggestions on this issue? > > Here's a couple of facts: > > 1) Points-based fields have certain limitations that make explicit value > lookups very slow, and make them unsuitable for use on uniqueKey fields. > Something about the field not having a "term" available. > > 2) A query of the type "fieldname:*" is a wildcard query. These tend to > be slow and inefficient, when they work. > > It might be that the limitations of point-based fields make it so that > wildcard queries don't work. I have no idea here. Points-based fields > did not exist in Solr 5.4, chances are that you were using a Trie-based > field at that time. A wildcard query would have worked, but it would > have been slow. > > I may have a solution even though I am pretty clueless about what's > going on. When you are looking to do a NOT NULL sort of query, you > should do it as a range query rather than a wildcard query. This means > the following syntax. Note that it is case sensitive -- the "TO" must > be uppercase: > > fieldname:[* TO *] > > This is how all NOT NULL queries should be constructed, regardless of > the type of field. Range queries tend to very efficient. > > Thanks, > Shawn >