弹性搜索中的默认分析器

时间:2016-01-21 13:51:44

标签: elasticsearch analyzer elastic-stack

我在yml文件中添加了以下内容。 指数: 分析: 分析仪: 默认值: tokenizer:关键字

但是当我在head plugin上看到我的索引元数据时,我无法在2.1.1中找到这些index_analyzer和search_analyzer。我能够在先前版本的ES 1.1.1索引中的元数据中看到这两个文件。

在索引和搜索时,我不确定这些分析器是否会应用于索引?无论如何我们可以测试在索引上创建的自定义分析器

{
  "state": "open",
  "settings": {
    "index": {
      "creation_date": "1453297871538",
      "analysis": {
        "filter": {
          "autocomplete_filter": {
            "type": "edgeNGram",
            "min_gram": "1",
            "max_gram": "20"
          }
        },
        "analyzer": {
          "autocomplete": {
            "filter": [
              "lowercase",
              "autocomplete_filter"
            ],
            "type": "custom",
            "tokenizer": "standard"
          }
        }
      },
      "number_of_shards": "4",
      "number_of_replicas": "1",
      "uuid": "L35y69StSXClxT5yvj95Uw",
      "version": {
        "created": "2010199"
      }
    }
  },
  "mappings": {
    "itemsnew": {
      "properties": {
        "ERP_PRICE_LIST_ID": {
          "include_in_all": false,
          "type": "long"
        },
        "ITEM_NUMBER_AUTO": {
          "search_analyzer": "standard",
          "analyzer": "autocomplete",
          "type": "string"
        },
        "SERVICE_FLAG": {
          "include_in_all": false,
          "index": "not_analyzed",
          "type": "string"
        },
        "PROGRAM_ID_RAW": {
          "index": "not_analyzed",
          "type": "string"
        },
        "IS_ACTIVE": {
          "include_in_all": false,
          "type": "string"
        },
        "PROGRAM_ID": {
          "type": "string"
        }
      }
    }
  },
  "aliases": [
    "sample"
  ]
}

0 个答案:

没有答案