Elasticsearch在文档中索引的最大术语?

时间:2015-06-03 12:52:04

标签: search indexing elasticsearch lucene

Lucene提到 -

If The document you are indexing are very large. Lucene by default only indexes the first 10,000 terms of a document to avoid OutOfMemory errors

虽然我们可以通过IndexWriter.setMaxFieldLength(int)配置它。

我在elasticsearch中创建了一个索引 - http://localhost:9200/twitter,并在其中发布了一个包含40,000个术语的文档。

映射 -

{
    "twitter": {
        "mappings": {
            "tweet": {
                "properties": {
                    "filter": {
                        "properties": {
                            "term": {
                                "properties": {
                                    "message": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "message": {
                        "type": "string",
                        "analyzer": "standard"
                    }
                }
            }
        }
    } }

我索引带有消息字段的文档有40,000个术语 - 消息:" text1 text2 .... text40000"

由于标准分析仪在空间上进行分析,因此它已经索引了40,000个术语。

我的观点是,elasticsearch是否设定了lucene索引条款数量的限制?如果是,那是什么限制?

如果不是,我的所有40,000个术语如何编入索引,它的索引术语不应超过10000个。

1 个答案:

答案 0 :(得分:0)

您引用的source似乎并不是最新的,因为IndexWriter.setMaxFieldLength(int)在Lucene 3.4中已弃用,现在在Lucene 4中不再可用+,ES基于。它已被LimitTokenCountAnalyzer取代。但是,我不认为存在这样的限制,或者至少它没有在Elasticsearch代码库中明确设置。

索引文档时可能遇到的唯一限制是与HTTP有效负载大小或Lucene的内部缓冲区大小相关,如this post中所述