How to implement Solr or SolrJ bound query?
-
11-09-2019 - |
Question
I want to use a query like:
sql(select name where id > 10 and id < 100 )
by using Solr or in SolrJ, but do not know how to implement? Can someone explain?
Solution
You need a range query, as described in SolrQuerySyntax. Basically, you collect all relevant documents by using a query range and then select the name field. The syntax is something like:
http://localhost:8983/solr/select?q=id:[10 TO 100]&fl=name
(You will need to escape the URL).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow