Solr between syntax

自闭症网瘾萝莉.ら 提交于 2019-12-11 03:16:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!