tags:

views:

466

answers:

1

Hi all:

Suppose that my index has 3 fields: title, x and y.

I know one range(10 < x < 100) can query like this:

http://localhost:8983/solr/select?q=x:[10 TO 100]&fl=title

If I want to two range(10 < x <100 AND 20 < y < 300) query like

SQL(select title where x>10 and x < 100 and y > 20 and y < 300)

by using Solr range query or SolrJ, but I don't know how to implement this. Does anybody else know? Thanks

Email: [email protected]

+2  A: 

Take a look at the docs for SolrJ. Successive calls to addFilterQuery will continue to build up your query. Alternatively you can have two things in one fq:

http://localhost:8983/solr/select?q=&amp;fq=x:[10+TO+100]+AND+y:[20+TO+300]&amp;fl=title
joeslice
Thank you very much!