尝试更新设置时出错 [英] error when trying to update the settings

查看:193
本文介绍了尝试更新设置时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过bash脚本执行此命令,但是我收到以下错误:

i try to execute this commands via a bash script but i get these errors:

#!/bin/bash 

curl -XPOST 'localhost:9200/my_index/_close' 

curl -XPUT 'localhost:9200/my_index/_settings' -d '{ 
 "analysis": { 
    "analyzer": { 
      "ar_analyzer": { 
        "tokenizer": "standard", 
        "filter" : ["standard", "lowercase", "synonym", "ar_stemmer"] 
      }, 
      "fr_analyzer": { 
        "tokenizer": "standard", 
        "filter" : ["standard", "lowercase", "synonym", "fr_stemmer"] 
      } 
    }, 
    "filter" : { 
      "ar_stemmer" : { 
          "type" : "stemmer", 
          "name" : "arabic" 
      }, 
      "fr_stemmer" : { 
          "type" : "stemmer", 
          "name" : "french" 
      }, 
      "synonym" : { 
          "type" : "synonym", 
          "synonyms_path" : "synonyms.txt" 
      } 
    } 
  } 
}' 

curl -XPOST 'localhost:9200/my_index/_open' 

错误stacktrace:


{ :IndexPrimaryShardNotAllocatedException [[my_index] primary
not assigned post
api],status:409} {error:ElasticSearchIllegalArgumentException [Can not
update non dynamic settings [ [index.analysis.filter.ar_stemmer.name,
index.analysis.analyzer.fr_analyzer.filter.3,
index.analysis.filter.synonym.type,
index.analysis.analyzer .ar_analyzer.filter.0,
index.analysis.analyzer.fr_analyzer.filter.0,
index.analysis.analyzer.ar_analyzer.filter.1,
index.analysis.analyzer.fr_analyzer .filter.2,
index.analysis.analyzer.fr_analyzer.filter.1,
index.analysis.analyzer.ar_analyzer.filter.2,
index.analysis.analyzer.ar_analyzer.filter .3,
index.analysis.filter.ar_stemmer.type,
index.analysis.filter.fr_s temmer.name,
index.analysis.analyzer.ar_analyzer.tokenizer,
index.analysis.filter.fr_stemmer.type,
index.analysis.analyzer.fr_analyzer.tokenizer,
index.analysis.filter.synonym.synonyms_path]]打开
indices [[my_index]]],status:400}

{"error":"IndexPrimaryShardNotAllocatedException[[my_index] primary not allocated post api]","status":409}{"error":"ElasticSearchIllegalArgumentException[Can't update non dynamic settings[[index.analysis.filter.ar_stemmer.name , index.analysis.analyzer.fr_analyzer.filter.3, index.analysis.filter.synonym.type, index.analysis.analyzer.ar_analyzer.filter.0, index.analysis.analyzer.fr_analyzer.filter.0, index.analysis.analyzer.ar_analyzer.filter.1, index.analysis.analyzer.fr_analyzer.filter.2, index.analysis.analyzer.fr_analyzer.filter.1, index.analysis.analyzer.ar_analyzer.filter.2, index.analysis.analyzer.ar_analyzer.filter.3, index.analysis.filter.ar_stemmer.type, index.analysis.filter.fr_stemmer.name , index.analysis.analyzer.ar_analyzer.tokenizer, index.analysis.filter.fr_stemmer.type, index.analysis.analyzer.fr_analyzer.tokenizer, index.analysis.filter.synonym.synonyms_path]] for open indices[[my_index]]]","status":400}

help please !!

help please !!

推荐答案

我正在使用这样的设置可能会帮助你: p>

关闭索引



Hi i am using setting like this way may be it help you:

curl -XPOST 'localhost:9200/lookupindex/_close'



更新设置



Update the settings

curl -XPUT 'localhost:9200/lookupindex/_settings' -d '{
    "index": {
        "analysis": {
            "analyzer": {
                "custom_standard_analyzer": {
                    "type": "custom",
                    "tokenizer": "whitespace",
                    "filter": [
                        "lowercase",
                        "asciifolding",
                        "customstopwords"
                    ]
                },
                "phonetic_analyzer": {
                    "type": "custom",
                    "tokenizer": "standard",
                    "filter": [
                        "lowercase",
                        "asciifolding",
                        "phoneticstopwords"
                    ]
                }
            },
            "filter": {
                "customstopwords": {
                    "type": "stop",
                    "stopwords": [
                        "+",
                        ".",
                        " ",
                        "ca",
                        "fl",
                        "bc",
                        "b.c",
                        "b.c.e",
                        "bce",
                        "act.c.",
                        "act",
                        "style",
                        "style of",
                        "attr.",
                        "attr",
                        "manner of",
                        "manner",
                        "circle of",
                        "circle",
                        "after",
                        "near",
                        "copy",
                        "copy after",
                        "imitator",
                        "school, copy",
                        "studio",
                        "studio of",
                        "Italian school",
                        "workshop of",
                        "workshop",
                        "16th",
                        "or",
                        "17th c.",
                        "late follower",
                        "follower of",
                        "follower",
                        "attributed",
                        "near",
                        "copy after painting",
                        "by or after",
                        "fake",
                        "and school",
                        "workshop-copy",
                        "counterproof",
                        "copy after drawing",
                        "copy of",
                        "school of",
                        "called",
                        "copy IBS",
                        "German School",
                        "placed with",
                        "attribution"
                    ]
                },
                "phoneticstopwords": {
                    "type": "stop",
                    "stopwords": [
                        "+",
                        ",",
                        "-",
                        ".",
                        "ca",
                        "fl",
                        "bc",
                        "b.c",
                        "b.c.e",
                        "bce",
                        "act.c.",
                        "act",
                        "style",
                        "style of",
                        "attr.",
                        "attr",
                        "manner of",
                        "manner",
                        "circle of",
                        "circle",
                        "after",
                        "near",
                        "copy",
                        "copy after",
                        "imitator",
                        "school, copy",
                        "studio",
                        "studio of",
                        "Italian school",
                        "workshop of",
                        "workshop",
                        "16th",
                        "or",
                        "17th c.",
                        "late follower",
                        "follower of",
                        "follower",
                        "attributed",
                        "near",
                        "copy after painting",
                        "by or after",
                        "fake",
                        "and school",
                        "workshop-copy",
                        "counterproof",
                        "copy after drawing",
                        "copy of",
                        "school of",
                        "called",
                        "copy IBS",
                        "German School",
                        "placed with",
                        "attribution"
                    ]
                }
            }
        }
    }
}
'  



完成重新打开索引



Reopen the index once done

curl -XPOST 'localhost:9200/lookupindex/_open'

这篇关于尝试更新设置时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆