solr范围查询错误

时间:2010-04-24 02:14:27

标签: solr

http://localhost:8983/solr/select?wt=json&q=lat:[35%20to%2038]会产生

org.apache.lucene.queryParser.ParseException: Cannot parse 'lat:[35 to 38]': Encountered " <RANGEIN_GOOP> "38 "" at line 1, column 11.
Was expecting:
    "]" 

这是一个非常基本的范围查询,此错误将阻止我们将SOLR用于我们的项目

3 个答案:

答案 0 :(得分:19)

以大写字母尝试'TO'。

答案 1 :(得分:0)

切换默认使用dismax而不是lucene解析器。

答案 2 :(得分:0)

/_search?q=lat:[35 TO 38]
or
/_search?q=lat:[35%20TO%2038]

工作&amp;测试相同。

https://search-xxxx-scyleqdxxxxx57yi4m.us-east-2.es.amazonaws.com/id/_search?q=id:2017-10-28&size=100

https://search-xxxx-scyleqdxxxxx57yi4m.us-east-2.es.amazonaws.com/id/_search?q=v:[0%20TO%20100]&size=100

https://search-xxxx-scyleqdxxxxx57yi4m.us-east-2.es.amazonaws.com/id/_search?q=id:[2017-10-26%20TO%202017-10-27]&size=100