小编an_*_*her的帖子

如何将 not_analyzed 应用于字段

我正在尝试将 not_analyzed添加到 url 字段。我尝试使用它给我的字段类型字符串无法解析映射[doc]:没有在字段[url]上声明的类型[字符串]的处理程序,并且我用文本替换了类型,并且我得到了无法解析映射[doc]:无法将 [url.index] 转换为布尔异常。如何使提交的 url not_analyzed

 PUT /some_index
    {
        "settings": {
            "index": {
                "number_of_shards": 5,
                "number_of_replicas": 1,
                "refresh_interval": "60s",
                "analysis" : {
                  "analyzer" : {
                    "my_analyzer" : {
                        "tokenizer" : "standard",
                        "filter" : ["standard", "lowercase", "my_snow","asciifolding","english_stop"]
                    }
                  },
                  "filter" : {
                    "my_snow" : {
                        "type" : "snowball",
                        "language" : "Lovins"
                    },
                    "english_stop": {
              "type":        "stop",
              "stopwords":"_english_"
            }
                }
            }
            }
        },
        "mappings": {
            "doc": {
                "_source": {
                    "enabled": true
                },
                "properties": {
                    "content": …
Run Code Online (Sandbox Code Playgroud)

elasticsearch

1
推荐指数
1
解决办法
5270
查看次数

特定领域的多个分析器

我正在研究 Elastic Search 6.4.2。我需要将多个分析器应用于单个字段。我希望将滚雪球和停用词分析器应用于标题和内容字段。我正在分享我的映射,这是定义分析器的正确方法吗?

PUT /some-index
{
    "settings": {
        "index": {
            "number_of_shards": 5,
            "number_of_replicas": 1,
            "refresh_interval": "60s",
            "analysis" : {
              "analyzer" : {
                "my_analyzer" : {
                    "tokenizer" : "standard",
                    "filter" : ["standard", "lowercase", "my_snow"]
               },
               "stop_analyzer": {
                 "type":       "stop",
                 "stopwords":  "_english_"
               }
              } ,


              "filter" : {
                "my_snow" : {
                    "type" : "snowball",
                    "language" : "Lovins"
                }
            }
        }
        }
    },
    "mappings": {
        "doc": {
            "_source": {
                "enabled": true
            },
            "properties": {
                "content": {
                    "type": "text",
                    "index": "true",
                    "store": true, …
Run Code Online (Sandbox Code Playgroud)

elasticsearch

1
推荐指数
1
解决办法
1685
查看次数

标签 统计

elasticsearch ×2