Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic mapping geopoint doesn't work #399

Open
fedcecca opened this issue Nov 10, 2014 · 2 comments
Open

Dynamic mapping geopoint doesn't work #399

fedcecca opened this issue Nov 10, 2014 · 2 comments

Comments

@fedcecca
Copy link

I don't know if it is a bug or it is a my mistake.
I'm using elasticsearch river to import a Mongo DB collection into elasticsearch. The collection have a geo point field (position.loc).

If I try to query using the geo point field using the following query:

{

 "query" : {
        "match_all" : {}
    }, 
   "filter" : {
        "geo_distance" : {
            "distance" : "12km",
            "position.loc" : [45.07085, 7.684341]
        }
    }

}

I receive the following error message:

Caused by: org.elasticsearch.index.query.QueryParsingException: [places2_idx] failed to find geo_point field [position.loc]

When I query the mapping I receive the following info about position.loc field 👍
"position": {
"properties": {
"loc": {
"properties": {
"coordinates": {
"type": "double"
},
"index": {
"type": "string"
},
"type": {
"type": "string"
}
}
}
}
}

I think that the mapping is incorrect. How can I force river to map the field correctly?

Thanks in advance.

@richardwilly98
Copy link
Owner

You should define a customer mapping. See #105.
There are also few geopoint closed issues: #218 (comment)

@fedcecca
Copy link
Author

thanks you for your answer,
I have a complex document JSon structure. How I can customize the mapping? I have to specify all field into document structure or I can overide only the position.loc mapping. Do you have any exemples? I have created the index (and MongoDB mapping) using the service:
POST http://:9200/_river/mongodb/_meta
{
"type": "mongodb",
"mongodb": {
"db": "<MOGO_DB> ",
"collection": "<COLLECTION_NAME>"
},
"index": {
"name": "<COLLECTION_idx",
"type": "places"
}
}

Do I have to create before a type "places" for the "index" and after run the same command (POST http://:9200/_river/mongodb/_meta)?

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants