无法正确使用lucene的关键字分析器,
String term = "new york";
// id and location are the fields in which i want to search the "term"
MultiFieldQueryParser queryParser = new MultiFieldQueryParser(
Version.LUCENE_30,
{"id", "location"},
new KeywordAnalyzer());
Query query = queryParser.parse(term);
System.out.println(query.toString());
Run Code Online (Sandbox Code Playgroud)
结果:(id:新位置:新)(id:约克 位置:约克)
预期结果:(id:纽约 地点:纽约)(id:纽约 地点:纽约)
请帮助我确定我在这里做错了什么?