gpt4 book ai didi

elasticsearch - 将.csv数据的经度和纬度映射到geo_point类型不起作用

转载 作者:行者123 更新时间:2023-12-02 23:18:33 25 4
gpt4 key购买 nike

这是我第四次尝试进行这些映射。但是我没有以前的配置文件。

classes2.conf

    input {
file {

path => "D:\Workspace.Elastic\FinalVersions\classes.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}

filter {

csv {
columns => ["TITLE","PROFFESSOR","MAJOR","SEMESTER","student_count","unit","rating","submit_date","latitude","longitude"]
separator => ","


}

mutate {
convert => { "longitude" => "float" }
convert => { "latitude" => "float" }
rename => {
"longitude" => "[location][lon]"
"latitude" => "[location][lat]"
}
}
}

output {
stdout { codec => rubydebug }
elasticsearch {
hosts => "localhost:9200"
index => "geopointest"
}
}

classesRating_mapping2.json
{
"class": {
"properties": {

"location": {
"type": "geo_point"
}
}
}
}

我收到以下错误:

[location] is defined as an object in mapping [doc] but this name is already used for a field in other types"



我创建了geopointest索引并添加了json映射,如下所示:
curl  -X PUT -H "Content-Type: application/json" http://localhost:9200/geopointest/class/_mapping --data-binary @classesRating_mapping2.json

我想念什么?
非常感谢。

最佳答案

问题在于,在映射中,您使用的是class,这是一个自定义类型名称。这意味着您需要像这样修改elasticsearch输出:

elasticsearch {
hosts => "localhost:9200"
index => "geopointest"
document_type => "class" <-- add this line
}

没有该行,Logstash使用 log类型名称,这就是关闭映射的原因。

关于elasticsearch - 将.csv数据的经度和纬度映射到geo_point类型不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52041567/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com