EthanHu
EthanHu

Reputation: 87

A question about SolrJ range query?

We can use solr range query like: http://localhost:8983/solr/select?q=queryStr&fq=x:[10 TO 100] AND y:[20 TO 300] or : http://localhost:8983/solr/select?q=queryStr&fq=x:[10 TO 100]&fq=y:[20 TO 300]

How to make this range query by using solrJ ?

Upvotes: 0

Views: 1344

Answers (1)

Mauricio Scheffer
Mauricio Scheffer

Reputation: 99730

You can use the addFilterQuery() method on the SolrQuery class. Just pass the filter query as is ("x:[10 TO 100] AND y:[20 TO 300]")

Upvotes: 2

Related Questions