Isnull equivalent in SOLR

245 views Asked by At

My query in sql server is like where isnull(id,'3') = 3 which would give me all null values as well as values equal to 3. I want to achieve the same in SOLR but not able to get it. I tried

id:3 OR -id:[* TO *]

but it gave me no result whereas on -id:[* TO *] it gives me correct amount of results. How do I make the query?

2

There are 2 answers

0
Persimmonium On BEST ANSWER

maybe the issue here is the precedence of the operators, - is being applied to both condition or something like that (might be a bug), anyway, this works:

q=(-id:[* TO *]) OR id:3
0
Piyush_Rana On

try with id:('' TO *) OR id:3.