Doug McK
Doug McK

Reputation: 468

solr fq syntax for an OR query

Just wondering what the correct syntax for an fq query would be...

Is it, example #1:

fq=(attr__sku__suitability__s:1-3yrs) OR 
(attr__sku__suitability__s:3-6yrs) OR 
(attr__sku__suitability__s:6-12yrs) OR 
(attr__sku__suitability__s:0-3mths) OR 
(attr__sku__suitability__s:3-12mths)

Or, example #2 :

fq=attr__sku__suitability__s:(1-3yrs OR 3-6yrs OR 6-12yrs OR 0-3mths OR 3-12mths)

Or something else I've completely overlooked

(url encoding has been left out to make it easier to read)

Upvotes: 3

Views: 3274

Answers (1)

jpountz
jpountz

Reputation: 9964

Both examples are OK and have the same behaviour, you could even remove parentheses from the first example.

Upvotes: 4

Related Questions