GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gcloud.datastore should allow explicit specification of whether the field is indexed · Issue #83 · googleapis/google-cloud-python

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

New issue
Copy link
New issue
Copy link
Closed
#330
Closed
gcloud.datastore should allow explicit specification of whether the field is indexed#83
#330
Copy link
Assignees
tseaver
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.

Description

@jgeewax
jgeewax
opened on Apr 21, 2014
Issue body actions

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

Activity

Next
  1. jgeewax
    added
    enhancement
    on Apr 21, 2014
  2. pcostell commented on Aug 5, 2014

    @pcostell
    pcostell
    on Aug 5, 2014
    Contributor
    More actions

    Pending some work by kdo@, this may not be necessary (and actually we may prefer not to expose this here).

  3. tseaver
    added
    type: questionRequest for information or clarification. Not an issue.
    on Oct 17, 2014
  4. dhermes commented on Oct 19, 2014

    @dhermes
    dhermes
    on Oct 19, 2014
    Contributor
    More actions

    @pcostell any update on this?

  5. pcostell commented on Oct 20, 2014

    @pcostell
    pcostell
    on Oct 20, 2014
    Contributor
    More actions

    Still a work in progress. For exposing indexed, I would recommend instead exposing it as it will be in the next Cloud Datastore release, exclude_from_indexes (the opposed of indexed). It's more verbose, but makes it more clear that this removes the property from both built-in and composite indexes. This field should really only be used for implementing sparse indexes or for values which cannot be indexed (i.e. large blobs).

  6. silvolu
    added this to the This milestone has been deleted milestone on Oct 20, 2014
  7. silvolu commented on Oct 29, 2014

    @silvolu
    silvolu
    on Oct 29, 2014
    Contributor
    More actions

    In gcloud-node, we implemented @pcostell suggestion: for each property you can pass an excludeFromIndexes; if present, we negate the value an pass it as value for indexed. I think we should do the same here.

  8. tseaver commented on Oct 29, 2014

    @tseaver
    tseaver
    on Oct 29, 2014
    Contributor
    More actions

    It's tricky here, as we just map an Entity as a dict: there is really no obvious place to store the policy. I guess we could add an 'exclude_from_indexes' attribute to Entity (a set of names?), and then have the marshalling code look at that attribute to decide whether / how to set the protobuf indexed field.

  9. silvolu commented on Oct 29, 2014

    @silvolu
    silvolu
    on Oct 29, 2014
    Contributor
    More actions

    Sounds good. Basically the 2nd option proposed by @jgeewax, using exclude_from_indexes as the name for the property.

  10. tseaver
    self-assigned this
    on Nov 3, 2014
  11. tseaver
    closed this as completedin #330on Nov 4, 2014
  12. tseaver
    added a commit that references this issue on Nov 4, 2014

    Merge pull request #330 from tseaver/83-expose_entity_indexed

    This issue will close once commit df05a0e is merged into the 'main' branch.
    df05a0e
  13. jgeewax
    modified the milestones: This milestone has been deleted, This milestone has been deleted on Jan 30, 2015
  14. 107 remaining items

  15. parthea
    added 5 commits that reference this issue on Nov 24, 2025

    chore(CI): update kokoro secret manager, release manager, docfx (via …

    This issue will close once commit d36f03f is merged into the 'main' branch.
    d36f03f

    chore(deps): update dependency pytest to v7.1.1 (#83)

    This issue will close once commit f4e09e0 is merged into the 'main' branch.
    f4e09e0

    test: Update Utilities and Tests to improve coverage and address lint…

    This issue will close once commit 502077f is merged into the 'main' branch.
    502077f

    Implement transaction for queries. (#83)

    This issue will close once commit 754eb1f is merged into the 'main' branch.
    754eb1f

    Release v0.3.0 (#83)

    This issue will close once commit 304ed9f is merged into the 'main' branch.
    304ed9f
  16. parthea
    added 8 commits that reference this issue on Mar 2, 2026

    docs: fix release heading in CHANGELOG (#83)

    e4f221d

    fix: advise setting 'CRC32C_PURE_PYTHON' after build failure (#84)

    357e32f

    fix: restore building 'manylinux1' wheels (#87)

    356444a

    DRY 'requests' pin; don't shadow exception. (#83)

    67d5615

    django: correct DateTimeField retrieval type

    03e51fe

    test: erase excess installation commands (#83)

    d081cf7

    feat(storage): add conformance tests for virtual hosted style signed …

    688f103

    ci: set up kokoro system tests to run on separate instances (#98)

    f28c997
  17. ohmayr
    added 2 commits that reference this issue on Mar 31, 2026

    fix: advise setting 'CRC32C_PURE_PYTHON' after build failure (#84)

    a9ad12e

    fix: restore building 'manylinux1' wheels (#87)

    a3c372b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.