Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

get_mapping never called #221

Open
pziemkowski opened this issue Mar 24, 2014 · 3 comments
Open

get_mapping never called #221

pziemkowski opened this issue Mar 24, 2014 · 3 comments

Comments

@pziemkowski
Copy link

I'm writing a django app and would like to create some mappings using class extending Indexable and MappingType helpers. The problem is that get_mapping method is never called. I have checked the source code of those helpers and can't find any line that would lead to this call. Maybe I am doing something wrong?

Here's the definition of my get_mapping:

    @classmethod
    def get_mapping(cls):
        return {
            '_parent': {
                'type': 'user_type'
            },
            'properties': {
                'id': {'type': 'integer'},
                'item': {'type': 'integer'},
                'created': {'type': 'date'}
            }
        }
@willkg
Copy link
Member

willkg commented Mar 24, 2014

ElasticUtils doesn't (yet) have any code to create indexes. The get_mapping suggestion is there to give you some of the scaffolding you need to set up the code for creating an index with specified mappings.

@johnraz
Copy link

johnraz commented May 19, 2014

Just got caught by this...
It would be nice to add something in the doc about it, not sure where to put it though. I would rather add it in the method's doc... Hint anyone ?

@alexinm
Copy link

alexinm commented Jun 25, 2014

Yeah, I spend too much time figuring out why my geo_point type is not created as such, basically right now it picks it up from ORM and not from mappings .
Basically extract_document() in elasticutils.contrib.django.tasks.index_objects can only infer core types and not geo_point type for example

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

No branches or pull requests

4 participants