solr - Solr 4.0中的mergeFactor用法

标签 solr lucene

我以为mergeFactor可以认为是段中的最大数目,但是当它设置为10时,索引之后我得到了16个段,并且当段中的数目超过15和20时发生了合并。我对mergeFactor的平均值感到非常困惑。

这是我的配置

<ramBufferSizeMB>32</ramBufferSizeMB>
<maxBufferedDocs>100000</maxBufferedDocs>
<mergeFactor>10</mergeFactor>

最佳答案

Solr Wiki - SolrPerformanceFactors - Merge Factor documentation

The mergeFactor roughly determines the number of segments. The mergeFactor value tells Lucene how many segments of equal size to build before merging them into a single segment. It can be thought of as the base of a number system.



它不是确切的数字,而是有关如何在磁盘上管理索引的准则。关于此值的不同设置对索引性能的影响,以下是一些很好的指导:

mergeFactor Tradeoffs

High value merge factor (e.g., 25):

  • Pro: Generally improves indexing speed
  • Con: Less frequent merges, resulting in a collection with more index files which may slow searching

Low value merge factor (e.g., 2):

  • Pro: Smaller number of index files, which speeds up searching.
  • Con: More segment merges slow down indexing.


您还可以引用mergeFactor documentation on the Lucidworks site,以获取有关mergeFcator的工作方式以及如何影响索引性能的更多详细信息。但我认为这里的关键是这一段:

If creating a new segment would cause the number of lowest-level segments to exceed the mergeFactor value, then all those segments are merged together to form a single large segment. Thus, if the merge factor is ten, each merge results in the creation of a single segment that is roughly ten times larger than each of its ten constituents. When there are mergeFactor settings for these larger segments, then they in turn are merged into an even larger single segment. This process can continue indefinitely.

关于solr - Solr 4.0中的mergeFactor用法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12819014/

相关文章:

solr - 如何获取 Solr 文档的大小?

web-services - Solr查询语法

java - Solr - 让 Java 运行时遇到问题

java - 使用 Lucene 解析搜索查询并基于该查询构建 Hibernate 标准

java - Lucene 的余弦相似度仅适用于匹配的文档

lucene - 在Elasticsearch中,当我通过ngram过滤器运行单词时,为什么会丢失整个单词 token ?

java - lucene,如何一起使用 SearcherManager 和 SearcherLifetimeManager

Azure 搜索 - 语音搜索实现

java - 由于进程停止错误,Apache Lucene 在启动时出现 FileNotFoundException

solr - solr 服务器的系统要求?