Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error when trying to update the settings

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'  

Error stacktrace :

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

like image 998
Rachid O Avatar asked Nov 03 '13 21:11

Rachid O


People also ask

How do I fix something went wrong trying to open Settings later?

Try to reopen settings later" in Windows 10, is caused when the user profile is corrupted. So, try creating a new user account and then check if the error has disappeared. + R keys to open the "Run" command box.

Why does Windows Update Say error encountered?

A common cause of errors is inadequate drive space. If you need help freeing up drive space, see Tips to free up drive space on your PC. The steps in this guided walk-through should help with all Windows Update errors and other issues—you don't need to search for the specific error to solve it.


1 Answers

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

Close the index

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' 
like image 76
Waqas Ahmed Avatar answered Sep 18 '22 06:09

Waqas Ahmed