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

geo_point may be badly mapped when used in conjuction with es_indexed #86

Closed
nlko opened this issue Feb 11, 2014 · 1 comment
Closed

Comments

@nlko
Copy link

nlko commented Feb 11, 2014

Hi,

I spent a couple hours to figure out why geo_point types were mapped to double or strings...

I'm using the 0.2.6 version.

I resolved my trouble by calling the createMapping function. In my opinion the sentence about the ongoing dev of mapping is not clear (shall we use it or not ?)

In fact I did some tests without calling createMapping:

  • if I do not use es_indexed:true the result mapping uses the geo_point types (so it's fine)
  • if I do use es_indexed:true the result mapping is wrong and I must call createMapping to make it good.

Sorry it is out my understanding why it behaves like that, I just wanted to mentioned it even if I understood now that - being able to avoid calling createMapping - is an ongoing dev.

Let me know if I can be of any help.

By the way, thanks a lot for this awesome module,

Nicolas

For references I used the following mapping:

    geo: {
        type: String,
        es_type: 'geo_point',
        es_indexed:true
    },
    coord: {
        geo_point: {
          type: String,
          es_type: 'geo_point',
          es_lat_lon: true,
          es_indexed:true
        },
        lat: { type: Number },
        lon: { type: Number }
    },

The mapping result was

"properties" : {
  "coord" : {
    "properties" : {
      "lat" : {
        "type" : "double"
      },
      "lon" : {
        "type" : "double"
      }
    }
  },
  …
  "geo" : {
    "type" : "string"
  }
}
@taterbase
Copy link
Owner

This issue has been moved to mongoosastic#7

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