问题
I have installed solr is awesome but i'm stuck when selecting price within range.I want to select all the products with the cost between 20 and 50 but it doesn't seem to work.What is the solr syntax for: cost > 20 AND cost < 50 or cost BETWEEN 20 AND 50 ?
回答1:
Short answer: look at Lucene Query Parser Syntax.
Longer answer: use this syntax for exclusive search (your example of cost > 20 AND cost <50):
cost:{20 TO 50}
and this syntax for inclusive search (cost >= 20 AND cost <= 50):
cost:[20 TO 50]
来源:https://stackoverflow.com/questions/14624155/solr-between-syntax