这些查询不起作用:
INFO: Searching with query: year:(<=2008 OR 2011)
INFO: Searching with query: year:(<=2008)
log.info("Searching with query: " + q);
try {
Results<ScoredDocument> results = getIndex().search(q);
INFO: Searching with query: year:(<=2008 OR 2011)
line 1:7 no viable alternative at input '<='
Nov 08, 2013 3:36:03 PM org.apache.struts2.dispatcher.Dispatcher error
SEVERE: Exception occurred during processing request: Unable to parse query: year:(<=2008 OR 2011)
com.google.appengine.api.search.SearchQueryException: Unable to parse query: year:(<=2008 OR 2011)
at com.google.appengine.api.search.checkers.QueryChecker.checkQueryParses(QueryChecker.java:44)
at com.google.appengine.api.search.checkers.QueryChecker.checkQuery(QueryChecker.java:28)
at com.google.appengine.api.search.Query$Builder.setQueryString(Query.java:91)
at com.google.appengine.api.search.Query$Builder.build(Query.java:107)
at com.google.appengine.api.search.IndexImpl.searchAsync(IndexImpl.java:378)
at com.google.appengine.api.search.IndexImpl.search(IndexImpl.java:479)
应用服务引擎的API-1.0-SDK-1.8.6.jar
https://developers.google.com/appengine/docs/java/search/query_strings
答案 0 :(得分:2)
看起来语法错误。根据您提供的参考,自
"weather=stormy"
"weather: stormy"
是等效的,请尝试:
"year<=2008 OR year=2011"
(假设这是你在你的例子中的意图)。