Mapping geo_point from .csv

I cannot understand what I'm missing.

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 => {"latitude" => "float"}
		convert => {"longitude" => "float"}
		add_field => ["location", "%{latitude},%{longitude}"]
		convert => {"location" => "float"}
	}
}

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

classesRating_mapping2.json

{
"class": {
"properties": {
"title": {
"type": "text"
},
"professor": {
"type": "text"
},
"major": {
"type": "text"
},
"semester": {
"type": "text"
},
"student_count": {
"type": "integer"
},
"unit": {
"type": "integer"
},
"rating": {
"type": "integer"
},
"submit_date": {
"type": "date",
"format": "yyyy-MM-dd"
},
"location": {
"type": "geo_point"
}
}
}
}

And I get the following error:
Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"classes", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x67037d>], :response=>{"index"=>{"_index"=>"classes", "_type"=>"doc", "_id"=>"Qbyle2UBUFBR3F6hEg3C", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [classes] as the final mapping would have more than 1 type: [doc, class]"}}}}

That is because of the class here;

You should change that to doc, which is the default.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.