Datastore ignoring “noindex” tag

112 views
Skip to first unread message

John Beckett

unread,
Aug 26, 2016, 9:15:59 AM8/26/16
to google-appengine-go

I'm using go version go1.6.2 (appengine-1.9.40) darwin/amd64 and this relates to the live datastore, not the local datastore.


When saving a struct to the datastore, slices of structs which have been tagged as "noindex", are showing up as indexed in the datastore viewer, while non struct fields are correctly showing as unindexed

As an example, I have:


Type User struct{
  Email string
  Buddies []Buddy `datastore:",noindex"`
  Language string `datastore:",noindex"`
}

Type Buddy struct{
  Name string `datastore:",noindex"`
  Age int `datastore:",noindex"`
}


When saving a new User to the datastore, the datastore viewer shows the properties Buddies.Name and Buddies.Age as "Indexed" despite the fact that I've tagged them as "noindex".

How do I get the datastore to not index structs?


(I asked the same question on StackOverflow, and if I get any solution there, I'll post it here)

alex

unread,
Aug 26, 2016, 10:01:19 AM8/26/16
to John Beckett, google-appengine-go
Most likely you had the data indexed earlier. "noindex" is not retroactive.

--
You received this message because you are subscribed to the Google Groups "google-appengine-go" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine-go+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Beckett

unread,
Aug 26, 2016, 10:37:06 AM8/26/16
to alex, google-appengine-go
Most likely you had the data indexed earlier. "noindex" is not retroactive.

The datastore that I am dealing with was wiped clean about two days ago, and the structs have not been changed for many months.  If it is indexed from some operation months ago, how do I stop the indexing? 

To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine-go+unsubscribe...@googlegroups.com.

Dave Day

unread,
Aug 29, 2016, 2:02:14 AM8/29/16
to John Beckett, alex, google-appengine-go
It might be related to the slice actually: there was a bug about this on the GoogleCloudPlatform/gcloud-golang project, and pcostell believed that it was a simply a bug in the UI (rather than the indexes actually being written).

One way to check would be to see if you can actually perform a query that would require an index on those fields (for example, in the datastore viewer).

To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine-go+unsub...@googlegroups.com.

John Beckett

unread,
Aug 29, 2016, 7:47:20 AM8/29/16
to Dave Day, alex, google-appengine-go
The behaviour in the datastore viewer has been strange.  When I first tried to filter by a field, I had options for every value that showed up as indexed in the viewer.  However a few seconds later, this updated to only showing me the fields which I should be able to filter by.

Based on the link you gave, it would indeed seem that it's mostly about poor documentation in that it would appear that the backend engineers expect slices to show up as indexed but I have yet to see anything stating this much anywhere.

As a side note, I saw mentioned in the issue that you linked that the datastore pricing is changing to a per entity basis, not including indexes.  Do you by any chance have an official link to this change?

Dave Day

unread,
Sep 1, 2016, 12:53:26 AM9/1/16
to John Beckett, alex, google-appengine-go
Reply all
Reply to author
Forward
0 new messages