在我的系统中,数据的插入总是通过logstash通过csv文件完成.我从未预先定义映射.但每当我输入一个字符串,它总是被认为是analyzed,作为结果的条目一样hello I am Sinha被分为hello,I,am,Sinha.无论如何我可以更改elasticsearch的默认/动态映射,以便所有字符串,无论索引如何,无论类型如何都被认为是not analyzed?或者有没有办法在.conf文件中设置它?说我的conf文件看起来像
input {
file {
path => "/home/sagnik/work/logstash-1.4.2/bin/promosms_dec15.csv"
type => "promosms_dec15"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
columns => ["Comm_Plan","Queue_Booking","Order_Reference","Multi_Ordertype"]
separator => ","
}
ruby {
code => "event['Generation_Date'] = Date.parse(event['Generation_Date']);"
}
}
output {
elasticsearch {
action => "index"
host => "localhost"
index => "promosms-%{+dd.MM.YYYY}"
workers => 1
}
}
Run Code Online (Sandbox Code Playgroud)
我想要所有的字符串 …
https://www.elastic.co/blog/changing-mapping-with-zero-downtime/
我尝试使用本指南创建一个新索引,并在零停机时间内重新索引我的数据。
现在,我有一个名为“ photoshooter”的索引,并且按照以下步骤进行操作
1)使用新的映射创建新的索引“ photoshooter_v1” ...(完成)
2)创建别名...
curl -XPOST本地主机:9200 / _aliases -d'
{
"actions": [
{ "add": {
"alias": "photoshooter",
"index": "photoshooter_v1"
}}
]
}
Run Code Online (Sandbox Code Playgroud)
我得到这个错误...
{
"error": "InvalidAliasNameException[[photoshooter_v1] Invalid alias name [photoshooter], an index exists with the same name as the alias]",
"status": 400
}
Run Code Online (Sandbox Code Playgroud)
我想我失去了一些逻辑。