问题
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.
回答1:
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)
来源:https://stackoverflow.com/questions/31422013/solr-search-with-array-of-values-on-field