Skip to content

gcloud.datastore should allow explicit specification of whether the field is indexed #83

Closed
@jgeewax

Description

@jgeewax

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']

CC

@proppy @aliafshar

Metadata

Metadata

Assignees

Labels

api: datastoreIssues related to the Datastore API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions