找不到 uri [/news] 和方法 [POST] 的处理程序



我刚刚开始使用elastic search 5.5.2 .我正在使用logstash-jdbc-input插件将数据从mysql数据库推送到elastic search。这是我正在使用的日志存储配置

input {
    jdbc {
        jdbc_connection_string => "jdbc:mysql://localhost:3306/news"
        jdbc_user => "root"
        jdbc_password => "sunilgarg"
        jdbc_validate_connection => true
        jdbc_driver_library => "../jars/mysql-connector-java-5.1.21.jar"
        jdbc_driver_class => "com.mysql.jdbc.Driver"
        statement => "SELECT * from news"
    }
}
output {
    stdout {codec => json_lines}
    elasticsearch {
        "index" => "news"
        "document_type" => "news"
        "hosts" => "localhost:9200"
        "document_id" => "%{id}"
    }
}

现在我可以使用带有以下正文的 http://localhost:9200/news/_search 进行搜索

{
   "query":{
      "query_string":{
         "query":"the"
      }
   }
}

现在这甚至正在搜索我不想要的停用词,所以我尝试使用带有请求正文的 POST 请求 http://localhost:9200/news 分析器

{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_english_analyzer": {
          "type": "standard",
          "max_token_length": 5,
          "stopwords": "_english_"
        }
      }
    }
  }
}

但这是显示

No handler found for uri [/news] and method [POST]

我错过了什么吗?还是我以错误的方式得到了这个?

请忽略是否太基本而无法问。

您可能想要使用设置创建索引,在这种情况下,您可以使用

PUT indexname
{
  // settings, mappings...
}

最新更新