指纹分析器

原文链接 : https://www.elastic.co/guide/en/elasticsearch/reference/5.3/analysis-fingerprint-analyzer.html(修改该链接为官网对应的链接)

译文链接 : http://www.apache.wiki/display/Elasticsearch/analysis-fingerprint-analyzer.html(修改该链接为 ApacheCN 对应的译文链接)

贡献者 : @您的名字,ApacheCNApache中文网

fingerprint 分析器实现了OpenRefine项目使用的指纹识别算法来协助聚类。

输入文本较低,规范化以删除扩展字符,排序,重复数据删除并连接到单个令牌。 如果配置了一个停用词列表,停止单词也将被删除。

定义

它包括:

分词器

词语过滤器

输出实例

  1. POST _analyze
  2. {
  3. "analyzer": "fingerprint",
  4. "text": "Yes yes, Gödel said this sentence is consistent and."
  5. }
  1. 上述的句子将产生以下的词语:
  1. [ and consistent godel is said sentence this yes ]

配置

  1. fingerprint(指纹)分析器接受以下的参数:

| separator | 用于连接条款的字符。 默认为空格。 | | max_output_size | 要发出的最大标记大小。 默认为255.大于此大小的token将被丢弃。 | | stopwords | 预定义的停止词列表,如english或包含停止词列表的数组。 默认为\ none。 | | stopwords_path | 包含停止词的文件的路径。 |

有关停止字配置的更多信息,请参阅 Stop Token Filter

配置实例

在这个例子中,我们配置 fingerprint 分析器以使用预定义的英文停止词列表:

  1. PUT my_index
  2. {
  3. "settings": {
  4. "analysis": {
  5. "analyzer": {
  6. "my_fingerprint_analyzer": {
  7. "type": "fingerprint",
  8. "stopwords": "_english_"
  9. }
  10. }
  11. }
  12. }
  13. }
  14. POST my_index/_analyze
  15. {
  16. "analyzer": "my_fingerprint_analyzer",
  17. "text": "Yes yes, Gödel said this sentence is consistent and."
  18. }

以上示例产生以下词语:

  1. [ consistent godel said sentence yes ]