I need to make a search request to Apache Solr similar to MySQL BETWEEN query.
In Solr document I have two fields: "postcode_from" and "postcode_to". This is a range of postal codes for some country region or city.
Only integer numbers!!!
I have a value (for example 1234) which is between "postcode_from" and "postcode_to" and I need to find all records which are pass this criteria.
In MySQL it is solving very easy:
SELECT * FROM `postal_location_network` WHERE 1234 BETWEEN `postcode_from` AND `postcode_to`;
How can I compose a proper query for Solr?
Thank you for help!
I'am not sure what you need but something like that is this what you are expected?
q = postcode_from:[yourValue TO *] AND postcode_to:[* TO yourValue]