sasori sasori - 3 months ago 29
PHP Question

how to select multiple values in solr via the query string?

let's say for example i need to search for a number of ids, and by looking at the solr/admin page, at the "Make a Query" input form, there is a

*:*


how am I gonna search a multiple value if it only works with one query whenever I fire the search button ?

I tried

id:123,413,2232,2323


it didn't work..but this single query, works

id:123

Answer

Please check out the SolrQuerySyntax page on the Solr wiki for some examples of the query syntax for Solr.

Given your example you could query for this in a couple of ways:

  1. id:[1 TO 4]
  2. (id:1 OR id:2 OR id:3 OR id:4)
Comments