0

I need to make a solr query through url and I do:

Query has to be

name:john AND id:5

Filter Query

byr:75 OR byr:90

I tried doesn't seem to work

  url.....?q=name:john+id:5&fq=(byr:75 OR byr:90)

I know that AND is + but what is the symbol for OR? Couldn't find much online so seeking help here

Jonatha Suh
  • 195
  • 13
  • Read this: https://lucidworks.com/blog/why-not-and-or-and-not/ (no prefix symbol means OR) – arun Sep 16 '15 at 20:06
  • If this is truly a URL (which it appears to be) then the ```+``` will be interpreted as a space. See http://stackoverflow.com/questions/1005676/urls-and-plus-signs – Aaron D Sep 16 '15 at 20:14

2 Answers2

0

+ is not the symbol for AND - it means that the clause is required for the document to be considered a match. And in this case, it seems to only be the escape code for a space in the URL.

Use " AND " if both clauses are required (the default behavior is affected by q.op and mm if you're using dismax).

MatsLindh
  • 49,529
  • 4
  • 53
  • 84
0

fq=byr:(75 90) will give you a search against byr field with two possible values. This is sort of described right at the end of the Standard Query Parser documentation.

I would recommend reading that whole article. And don't confuse + sign used in the query and + used in URL to escape special characters.

Alexandre Rafalovitch
  • 9,709
  • 1
  • 24
  • 27