Skip to content

Instantly share code, notes, and snippets.

@kimchy
Created July 31, 2011 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimchy/1116858 to your computer and use it in GitHub Desktop.
Save kimchy/1116858 to your computer and use it in GitHub Desktop.
{
"pin" : {
"properties" : {
"location1" : {
"type" : "geo_point"
},
"location2" : {
"type" : "geo_point"
}
}
}
}
@bent0ws
Copy link

bent0ws commented May 14, 2013

I trying use this example indexing jdbc, but it's return a exception with this error:

" [jdbc][facebook_users] failed to create index [facebook_users], disabling JDBC river...
org.elasticsearch.index.mapper.MapperParsingException: Mapping must have the type as the root object
"

my column facebook_user is a text field with json objects stored.

my code:
[code]
curl -XPUT 'localhost:9200/_river/facebook_users/meta' -d ' {
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost:3306/data",
"user": "root",
"password": "123",
"sql": "select friends from facebook_user
where friends <> "" LIMIT 1000"
},
"index": {
"index": "facebook_users",
"type": "jdbc",
"type_mapping": [{
"facebook_users": {
"properties": {
"friends":{
"type": "nested"
}
}
}
}]
}
}'
[/code]
can you help me pls?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment