org.apache.lucene.search.BooleanQuery.setAllowDocsOutOfOrder()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中org.apache.lucene.search.BooleanQuery.setAllowDocsOutOfOrder()方法的一些代码示例,展示了BooleanQuery.setAllowDocsOutOfOrder()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BooleanQuery.setAllowDocsOutOfOrder()方法的具体详情如下:
包路径:org.apache.lucene.search.BooleanQuery
类名称:BooleanQuery
方法名:setAllowDocsOutOfOrder

BooleanQuery.setAllowDocsOutOfOrder介绍

[英]Expert: Indicates whether hit docs may be collected out of docid order.

Background: although the contract of the Scorer class requires that documents be iterated in order of doc id, this was not true in early versions of Lucene. Many pieces of functionality in the current Lucene code base have undefined behavior if this contract is not upheld, but in some specific simple cases may be faster. (For example: disjunction queries with less than 32 prohibited clauses; This setting has no effect for other queries.)

Specifics: By setting this option to true, calls to HitCollector#collect(int,float) might be invoked first for docid N and only later for docid N-1. Being static, this setting is system wide.
[中]专家:指示是否可以按文档ID顺序收集命中文档。
背景:尽管Scorer类的契约要求文档按照docid的顺序进行迭代,但在早期版本的Lucene中并非如此。如果不支持此约定,当前Lucene代码库中的许多功能都有未定义的行为,但在某些特定的简单情况下可能会更快。(例如:包含少于32个禁止子句的析取查询;此设置对其他查询无效。)
具体说明:通过将此选项设置为true,可以首先对docid N调用HitCollector#collect(int,float),然后才对docid N-1调用HitCollector#collect(int,float)。由于是静态的,此设置是系统范围的。

代码示例

代码示例来源:origin: org.apache.lucene/lucene-core-jfrog

/**
 * @deprecated Use {@link #setAllowDocsOutOfOrder(boolean)} instead. 
 */
public static void setUseScorer14(boolean use14) {
 setAllowDocsOutOfOrder(use14);
}

代码示例来源:origin: org.apache.lucene/com.springsource.org.apache.lucene

/**
 * @deprecated Use {@link #setAllowDocsOutOfOrder(boolean)} instead. 
 */
public static void setUseScorer14(boolean use14) {
 setAllowDocsOutOfOrder(use14);
}

相关文章