I need my query parser to only read fields that are "text".
for example, lets say my query is:
text:"this fox" OR title:"brown dog"
for highlighting purposes, i need the parser/searcher to only search using the text:"this fox" part.
in 2.4 this worked fine, but since upgrading to 2.9.3, something has changed.
例如:
IndexSearcher is = new IndexSearcher(fsDir);
QueryParser qp = new QueryParser("text", new StandardAnalyzer(nostop));
qp.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
Query queryDiv;
try {
query = is.rewrite(queryParser.parse(query_str));
}
catch (ParseException e) {
pw.print("error: Incorrect query format");
pw.close();
return;
}
Hits hits = is.search(queryDiv, sort);
QueryScorer scorer = new QueryScorer(query, "text");
出于某种原因,我所不知,Lucene 2.9.3现在没有在2.4中显示任何结果,因为它忽视了文件意图所在领域,更不用说那里有OR条件。
是否有任何想法?