Koottalida
Koottalida

Reputation: 25

mathematical operation and comparison operation in Solr filter query

in solr schema.xml ,i got the following entry

 <field name="quality" type="int" indexed="true" stored="true"/>

During searching, how can i make a filter query with mathematical operation on this field and do a comparison operation.for exmaple as following

http://localhost:8983/solr/myindex/select/?q=computer&fq=quality*16>256

This mathematical operations will be changing according to the queries.

Upvotes: 1

Views: 673

Answers (1)

Binoy Dalal
Binoy Dalal

Reputation: 896

You can use Solr's Function Range Query Parser.

fq={!frange l=256}product(quality,16)

Check here for a list of all the functions available in Solr.

Upvotes: 2

Related Questions