4

I'm new in Solr search. Can anyone help me for solr my problem. I have array of values and I want to add this in solr query like

$query->setQuery('field:[1,2,5]');

When I'm executing this then I get this error message

org.apache.solr.search.SyntaxError: Cannot parse 'tag_id:[1,2,5]': Encountered \" \"]\" \"] \"\" at line 1, column 13.\r\nWas expecting one of:\r\n    \"TO\" ...\r\n    <RANGE_QUOTED> ...\r\n    <RANGE_GOOP> ...\r\n    

I'm stuck on this. Please help me.

Lakhwinder Singh
  • 5,536
  • 5
  • 27
  • 52

1 Answers1

5

try with filter query

https://cwiki.apache.org/confluence/display/solr/Common+Query+Parameters#CommonQueryParameters-Thefq(FilterQuery)Parameter

tag_id=cat:(1 OR 2 OR 5)
Abhijit Bashetti
  • 8,518
  • 7
  • 35
  • 47