How to select multiple values ​​in solr via query string?

let's say, for example, I need to find several identifiers, and, looking at the solr / admin page, in the input field "Make a request" there is

*:* 

how will I search for multiple values ​​if it works with only one query when I launch the search button?

I tried

 id:123,413,2232,2323 

this did not work ... but this single request works

 id:123 
+7
source share
3 answers

Please check out SolrQuerySyntax in the Solr villa for some sample query syntax for Solr.

Given your example, you can request this in several ways:

  • id:[1 TO 4]
  • (id:1 OR id:2 OR id:3 OR id:4)
+17
source

Solr automatically uses OR as an operator, so the shortest version will be:

 id:(123 413 2232 2323) 
+8
source

I would change the second option a bit:

 id:(ONE OR TWO OR THREE) 
+7
source

All Articles