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
You can search for "solr" by loading the Admin UI Query tab, enter "solr" in the q param (replacing *:* , which matches all documents), and "Execute Query". See the Searching section below for more information. To index your own data, re-run the directory indexing command pointed to your own directory of documents.
Standard solr queries use the "q" parameter in a request. Filter queries use the "fq" parameter. The primary difference is that filtered queries do not affect relevance scores; the query functions purely as a filter (docset intersection, essentially). Follow this answer to receive notifications.
Solr supports a variety of Response Writers to ensure that query responses can be parsed by the appropriate language or application. The wt parameter selects the Response Writer to be used. The table below lists the most common settings for the wt parameter.
The df stands for default field , while the qf stands for query fields . The field defined by the df parameter is used when no fields are mentioned in the query. For example if you are running a query like q=solr and you have df=title the query itself will actually be title:solr .
Solr automatically uses OR as an operator, so the shortest version would be:
id:(123 413 2232 2323)
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:
id:[1 TO 4]
(id:1 OR id:2 OR id:3 OR id:4)
I would slightly modify second option to be:
id:(ONE OR TWO OR THREE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With