django-nonreldjangoappengine

How do I disable built-in index for a model property for GAE?


GAE model properties can be removed from built-in index by setting "indexed" to false.

In DjangoAppEngine, I don't see an API to set model fields to not be indexed. How do I set a model field as such?


Solution

  • Per the excellent documentation you would use 'unindexed' as explained here:
    http://djangoappengine.readthedocs.org/en/latest/db.html#indexes

    In case you prefer not to follow the link here's a code-sample:

    from myapp.models import MyContact
    
    FIELD_INDEXES = {
        MyContact: {
            'indexed': [...],
            'unindexed': ['creation_date', 'last_modified', ...],
        },
    }