2017-07-18 117 views
1

说我有一个句子This is a new cityanagram的弹性搜索索引?

  1. 是否松紧搜索词的所有可能的排列/组合创建索引。例如,对于“城市”这个词,它会创建索引“it”,“ty”,“ity”,“cit”等吗?
  2. 这些索引是在文档存储时还是在运行时创建的?
  3. 这些索引是否保存在内存或数据库中?

回答

0
  1. 这取决于你tokenizer。默认情况下Elasticsearch使用Standant Tokenizer其中divides text into terms on word boundaries, as defined by the Unicode Text Segmentation algorithm.这意味着您的句子将被标记为this, is, a, new, city。如果您愿意,您可以创建自定义标记。

  2. 将文档放到Elasticsearch中时,文档会被编入索引。

  3. 的数据被保存在文件系统:https://www.elastic.co/blog/found-dive-into-elasticsearch-storage

这里是一个博客帖子大约内部:https://www.elastic.co/blog/found-elasticsearch-from-the-bottom-up

+0

一个上点1.问题将弹性搜索无法搜索单词'city'时我默认输入部分单词“it”?我是否需要创建自定义标记器以在每个单词的可能字母上创建索引? – user3198603

+0

它根据您的查询类型进行更改。对于这样的匹配,你可以使用带'* it *'的通配符查询。请参阅:https://www.elastic.co/guide/en/elasticsearch/guide/current/partial-matching.html。 – alpert

+0

当你说'对于这样的比赛,你可以使用..'你问最终用户使用通配符吗?我以为ES会自动做到这一点? – user3198603