相关疑难解决方法(0)

尝试更新设置时出错

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

#!/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' 
Run Code Online (Sandbox Code Playgroud)

错误堆栈跟踪:

{"error":"IndexPrimaryShardNotAllocatedException [[my_index] primary …

elasticsearch

47
推荐指数
2
解决办法
3万
查看次数

Elasticsearch 无法更新非动态设置

我正在尝试创建一个测试分析器来试验对弹性搜索的分析。我创建了一个名为“mytest”的索引,该索引可用且可搜索,但是当我尝试创建自定义分析器时,出现以下错误

{
"error": "ElasticsearchIllegalArgumentException[Can't update non dynamic settings[[index.analysis.analyzer.content.type, index.analysis.analyzer.content.tokenizer]] for open indices [[mytest]]]",
"status": 400
}
Run Code Online (Sandbox Code Playgroud)

现在我不确定更新设置的限制,但我在文档中找不到任何内容。我可以在创建索引时创建分析,但更新不起作用。

使用下面的源创建分析器

PUT mytest/_settings
{
  "analysis" : {
    "analyzer":{
      "content":{
        "type":"custom",
        "tokenizer":"whitespace"
      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

有任何想法吗 ?

indexing analyzer elasticsearch

13
推荐指数
1
解决办法
2万
查看次数

elasticsearch删除自定义分析器/过滤器

我是弹性搜索的新手,我想知道是否可以从索引中删除自定义分析器或自定义过滤器.

例如,假设以下索引设置:

    "settings" : {
        "analysis": {
            "filter":{
                "filter_metaphone":{
                    "encoder": "metaphone",
                    "type": "phonetic",
                    "replace": "false"
                },
                "filter_unused":{
                    "type": "edgeNGram",
                    "max_gram": "10",
                    "min_gram": "1" 
                }
            },
            "analyzer":{
                "name":{
                    "type": "custom",
                    "filter": ["filter_metaphone"],
                    "tokenizer": "standard"
                }
            }
        }   
    }
Run Code Online (Sandbox Code Playgroud)

有没有办法通过curl删除过滤器"filter_unused"而不删除并使用新的设置配置创建索引?

filter analyzer elasticsearch

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

标签 统计

elasticsearch ×3

analyzer ×2

filter ×1

indexing ×1