简体   繁体   中英

How to get the definitiion of a search analyzer of an index in elasticsearch

The mapping of the elasticsearch index has a custom analyzer attached to it. How to read the definition of the custom analyzer.

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

"matchingCriteria": { "type": "string", "analyzer": "custom_analyzer", "include_in_all": false }

my search is not working with the analyzer thats why i need to know what exactly this analyzer is doing.

the doc explains how to modify an analyzer or attach a new analyzer to an existing index but i didnt find a way to see what an analyzer does.

use the _settings API :

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

it should generate a response similar to:

{
  "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"
            },
...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM