kafka-connect-elasticsearch icon indicating copy to clipboard operation
kafka-connect-elasticsearch copied to clipboard

Problems with geo_point

Open albertostratio opened this issue 8 years ago • 1 comments

I'm trying to store a geo_point field within an elasticsearch index but the connector is not able to map the geo_point field. Following is my set-up:

POST's Body to the connector API:

{
    "name": "khermeslocation20",
    "config": {
        "connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
        "topics": "khermeslocation20",
        "type.name" : "khermeslocation20",
        "key.ignore" : "true",
        "connection.url" : "http://localhost:9200",
        "tasks.max": "1"
    }
}

Avro config

{
	"type": "record",
	"name": "locationschema",
	"fields": [{"name": "name","type": "string"},{"name": "location","type":"string"}]
}

PUT y POST to create the ElasticSearch index:

curl -XPUT 'localhost:9200/khermeslocation20?pretty' -H 'Content-Type: application/json' -d'
{
    "settings" : {
        "index" : {
            "number_of_shards" : 1, 
            "number_of_replicas" : 1 
        }
    }
}'
curl -X POST "http://localhost:9200/khermeslocation20/khermeslocation5/_mapping" -d '{
   "khermeslocation5" : {
   "properties" : {
   	   "name" : { "type" : "string"},
       "location" : { "type" : "geo_point"}
   }}
}'

Following is the connector exception

[2017-05-04 13:58:06,369] ERROR Task khermeslocation20-0 threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerSinkTask)
kafka-connect_1    | org.apache.kafka.connect.errors.ConnectException: Cannot create mapping {"khermeslocation20":{"properties":{"name":{"type":"string"},"location":{"type":"string"}}}} -- {"root_cause":[{"type$
:"illegal_argument_exception","reason":"mapper [location] cannot be changed from type [geo_point] to [string]"}],"type":"illegal_argument_exception","reason":"mapper [location] cannot be changed from type [geo_$
oint] to [string]"}

I've seen that the geo_point type is not included within the switch case of the Mapping clase. Does it mean that we can't use the geo_point yet? Would it make sense to modify the code to include this type?

albertostratio avatar May 04 '17 14:05 albertostratio

3 years later and still open. Guess I've the same problem. Is confluent kafka still an active project?

cdekimpe avatar Mar 24 '20 20:03 cdekimpe