Limit Token Count Token Filter(限制词元数量过滤器)

原文链接 :https://www.elastic.co/guide/en/elasticsearch/reference/5.4/analysis-limit-token-count-tokenfilter.html

译文链接 : http://www.apache.wiki/pages/viewpage.action?pageId=10028038

贡献者 : 李亚运ApacheCNApache中文网

简述

限制每个文档和字段索引的token数。

参数

设置 描述
max_token_count 每个文档和字段应该索引的token的最大数量。 默认值为1
consume_all_tokens 如果设置为true,尽管已经超过max_token_count设定的值,也会最大限度的处理所有的token。默认为false。

示例

如下所示:

  1. index :
  2. analysis :
  3. analyzer :
  4. myAnalyzer :
  5. type : custom
  6. tokenizer : standard
  7. filter : [lowercase, five_token_limit]
  8. filter :
  9. five_token_limit :
  10. type : limit
  11. max_token_count : 5