1
我使用Lucene 6個新IntPoint
工作,我想要做一些範圍搜索的Apache Lucene的6 QueryParser的範圍查詢未與IntPoint
使用IntPoint.newRangeQuery
搜索工作,並返回正確的文件,但是當我」使用QueryParser
(經典)或新StandardQueryParser
沒有任何返回。
// This works
Query query = IntPoint.newRangeQuery("duration",1,20);
System.out.println(query);
//This doesn't work
QueryParser parser = new QueryParser("name", analyzer);
Query query = parser.parse("duration:[1 TO 20]");
System.out.println(query);
//This doesn't work
StandardQueryParser queryParserHelper = new StandardQueryParser();
Query query = queryParserHelper.parse("timestamp:[1 TO 20]", "timestamp");
System.out.println(query);
// In all 3 cases it prints: timestamp:[1 TO 20]
這是一個錯誤還是我錯過了什麼?