Reputation: 15578
I have just started with elastic search 5.5.2
. I am using logstash-jdbc-input
plugin to push data from mysql
database to elastic search
. Here is logstash configuration that I am using
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}"
}
}
Now I am able to search using http://localhost:9200/news/_search with following body
{
"query":{
"query_string":{
"query":"the"
}
}
}
Now this is searching even stop words that I don't want, So I tried analyzer by using this POST request http://localhost:9200/news with request body
{
"settings": {
"analysis": {
"analyzer": {
"my_english_analyzer": {
"type": "standard",
"max_token_length": 5,
"stopwords": "_english_"
}
}
}
}
}
but this is showing
No handler found for uri [/news] and method [POST]
Am I missing something? Or I am getting this in a wrong way?
Please ignore if it is too basic to ask.
Upvotes: 1
Views: 5075
Reputation: 14492
May be you want to create an index with settings in which case you want to use
PUT indexname
{
// settings, mappings...
}
Upvotes: 0