【问题标题】:How to get the definitiion of a search analyzer of an index in elasticsearch如何在elasticsearch中获取索引的搜索分析器的定义
【发布时间】:2015-02-03 12:29:45
【问题描述】:

elasticsearch 索引的映射附加了一个自定义分析器。如何阅读自定义分析器的定义。

http://localhost:9200/test_namespace/test_namespace/_mapping

“匹配标准”:{ “类型”:“字符串”, "分析器": "custom_analyzer", “include_in_all”:假 }

我的搜索不适用于分析器,这就是为什么我需要知道该分析器到底在做什么。

文档解释了如何修改分析器或将新分析器附加到现有索引,但我没有找到查看分析器功能的方法。

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    使用_settings API:

    curl -XGET 'http://localhost:9200/test_namespace/_settings?pretty=true' 
    

    它应该生成类似于以下内容的响应:

    {
      "test_namespace" : {
        "settings" : {
          "index" : {
            "creation_date" : "1418990814430",
            "routing" : {
              "allocation" : {
                "disable_allocation" : "false"
              }
            },
            "uuid" : "FmX9NrSNSTO2bQM5pd-iQQ",
            "number_of_replicas" : "2",
            "analysis" : {
              "analyzer" : {
                "edi_analyzer" : {
                  "type" : "custom",
                  "char_filter" : [ "my_pattern" ],
                  "filter" : [ "lowercase", "length" ],
                  "tokenizer" : "whitespace"
                },
                "xml_analyzer" : {
                  "type" : "custom",
                  "char_filter" : [ "html_strip" ],
                  "filter" : [ "lowercase", "length" ],
                  "tokenizer" : "whitespace"
                },
    ...
    

    【讨论】:

      猜你喜欢
      • 2023-03-25
      • 2014-02-25
      • 1970-01-01
      • 2018-11-09
      • 2014-02-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-16
      相关资源
      最近更新 更多