使用Ngram Tokenizer和Ngram过滤器会增加ElasticSearch中的索引大小吗? [英] Will using Ngram Tokenizer and Ngram Filters increase the index size in ElasticSearch?
问题描述
我是Elasticsearch的新手,NGram Tokenizer和NGram Filter是否会增加Elasticseach中的索引大小?
Hi I am new to Elasticsearch, does NGram Tokenizer and NGram Filter increase the index size in Elasticseach?
使用
MIN_NGRAM AS 1
MAX_NGRAM AS 50
以及如何使用localhost检查索引大小和令牌?
And how to check index size and tokens using localhost?
推荐答案
是的,使用(edge)ngram分词器或过滤器会增加索引大小-毕竟,您存储了更多的令牌.
Yes, using (edge) ngram tokenizers or filters will increase the index size - you're storing more tokens, after all.
请注意,设为<1>的 min_gram
可能允许您在第一次击键时执行自动完成操作,但是除非您的数据集很小,否则您不可能提供足够窄的结果集来对用户有用.将 min_gram
设置为2或3可以更好地平衡大型数据集和性能. max_gram
设置为50也有类似的问题,但另一个极端是:用户不太可能键入那么多字符来自动完成任何内容,因此在这种情况下,您不必要索引ngram.当然,这些注释是针对自动完成用例的;我确定有很多可行的方案, min_gram
和 max_gram
需要1、50.
As a couple of side notes, min_gram
set to 1 may allow you to perform autocomplete operations on the first keystroke, but unless your dataset is small you're unlikely to provide a narrow enough resultset to the user to be useful. min_gram
set to 2 or 3 is a better balance for larger datasets and performance. max_gram
set to 50 has a similar problem but at the other extreme; a user is unlikely to type in that many characters in order to autocomplete anything, so you're indexing ngrams unnecessarily in that case. Of course, these comments are specific to the autocomplete use-case; I'm sure there are many workable scenarios needing 1, 50 for min_gram
and max_gram
.
ES参考文档提供了有关状态API的一些详细信息-最好尝试一下并查看输出: http://www.elasticsearch.org/guide/reference/api/admin-indices-status/
The ES reference documentation has some details on the status API - best to try it and see the output: http://www.elasticsearch.org/guide/reference/api/admin-indices-status/
要确定ES如何标记输入内容: http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze/
To determine how ES is tokenizing your input: http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze/
这篇关于使用Ngram Tokenizer和Ngram过滤器会增加ElasticSearch中的索引大小吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!