Closed
Description
Summary
Right now, everything is indexed by default (based on the Value
protobuf's indexed [default = true]
field). See https://github.com/GoogleCloudPlatform/google-cloud-datastore/blob/v1beta2-rev1-2.1.0/proto/datastore_v1.proto#L129
This will get crazy expensive. We need to allow people to specify whether a field should be indexed. We should probably also default this to false
. But that's a bigger question.
To do
- Decide whether to allow explicit indexing or unindexing
- Figure out what the syntax will be for specifying indexing
- Submit a patch for the feature
Options for specifying indexing
List of indexed fields
Unless a field is explicitly in the list of indexed fields, the indexed
property will be set to False
.
entity = ...
entity.indexed_fields = ['field1', 'field2']
List of unindexed fields
If a field is in this list, it's indexed
property will be set to False
. Otherwise it will be left unset (and therefore default to True
per the protobuf definition.
entity = ...
entity.unindexed_fields = ['field1', 'field2']