Praveen Rawat
Praveen Rawat

Reputation: 658

SolrNet query to get records between to fields value

hi guys i have started working on a project which need solr implemtation for searching.

I am using SolrNet Lib and my question is: I have two field in solr index Maxsal and Minsal and i have Currentsal parameter which contains salary amount. What i want is, get all records which satisfy this condition:

currentsal< Maxsal  && currentsal> Minsal

Upvotes: 1

Views: 789

Answers (2)

Praveen Rawat
Praveen Rawat

Reputation: 658

Never noticed that Query() take string parameter too.

So, Solr.Query("MaxSal<="+parameter && MinSal>=parameter")

Upvotes: 0

Mysterion
Mysterion

Reputation: 9320

Take a look at Solr range query. It should allow to create query like this

minsal:[* TO PARAM] AND maxsal:[PARAM TO *]

For more information look here - http://www.solrtutorial.com/solr-query-syntax.html

Upvotes: 2

Related Questions