0

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?

Abhijit Bashetti
  • 8,518
  • 7
  • 35
  • 47
Hitesh
  • 3,449
  • 8
  • 39
  • 57

2 Answers2

2

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
Persimmonium
  • 15,593
  • 11
  • 47
  • 78
0

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

Hitesh
  • 3,449
  • 8
  • 39
  • 57
Piyush_Rana
  • 305
  • 3
  • 15