本文整理了Java中org.apache.lucene.search.Query.combine
方法的一些代码示例,展示了Query.combine
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.combine
方法的具体详情如下:
包路径:org.apache.lucene.search.Query
类名称:Query
方法名:combine
[英]Expert: called when re-writing queries under MultiSearcher. Create a single query suitable for use by all subsearchers (in 1-1 correspondence with queries). This is an optimization of the OR of all queries. We handle the common optimization cases of equal queries and overlapping clauses of boolean OR queries (as generated by MultiTermQuery.rewrite() and RangeQuery.rewrite()). Be careful overriding this method as queries[0] determines which method will be called and is not necessarily of the same type as the other queries.
[中]专家:在MultiSearcher下重新编写查询时调用。创建一个适合所有子搜索者使用的查询(与查询一一对应)。这是对所有查询的OR的优化。我们处理常见的优化情况,包括相等查询和布尔OR查询的重叠子句(由MultiTermQuery.rewrite()和RangeQuery生成)。重写()。请小心重写此方法,因为查询[0]决定将调用哪个方法,并且不一定与其他查询的类型相同。
代码示例来源:origin: stackoverflow.com
String termQueryString = "title:\"hello world\"";
Query termQuery = parser.parse(termQueryString);
Query pageQueryRange = NumericRangeQuery.newIntRange("page_count", 10, 20, true, true);
Query query = termQuery.combine(new Query[]{termQuery, pageQueryRange});
代码示例来源:origin: lucene/lucene
public Query rewrite(Query original) throws IOException {
Query[] queries = new Query[searchables.length];
for (int i = 0; i < searchables.length; i++) {
queries[i] = searchables[i].rewrite(original);
}
return original.combine(queries);
}
代码示例来源:origin: org.apache.lucene/lucene-core-jfrog
public Query rewrite(Query original) throws IOException {
Query[] queries = new Query[searchables.length];
for (int i = 0; i < searchables.length; i++) {
queries[i] = searchables[i].rewrite(original);
}
return queries[0].combine(queries);
}
代码示例来源:origin: lucene/lucene
public Query rewrite(Query original) throws IOException {
Query[] queries = new Query[searchables.length];
for (int i = 0; i < searchables.length; i++) {
queries[i] = searchables[i].rewrite(original);
}
return original.combine(queries);
}
代码示例来源:origin: org.apache.lucene/com.springsource.org.apache.lucene
public Query rewrite(Query original) throws IOException {
Query[] queries = new Query[searchables.length];
for (int i = 0; i < searchables.length; i++) {
queries[i] = searchables[i].rewrite(original);
}
return queries[0].combine(queries);
}
代码示例来源:origin: net.sourceforge.openutils/openutils-mgnltagcloud
return luceneQuery.combine(new Query[]{queryChild, querySelf });
内容来源于网络,如有侵权,请联系作者删除!