0
votes

Objectify documentation says that Objectify will not create an index for a field which is not annotated with @Index annotation. However, I can see that index is being create for entity fields which are arrays, or maps.

I'm using Objectify v6.0.4 to store data in GAE Datastore. I tried putting @Unindex annotation to the filed I don't want to index, but it didn't worked.

For example, when I save tho following entity and check it in Datastore I see that index has been created for fields.

@Entity
public class Foo {
  @Id
  public Long id;
  public String name;
  public Field[] fields;
}

static class Field {
  public String type;
  public String label;
  public String name;
}

Based on Objectify documentation I'm expecting that datastore index will be created for the fields with @Index annotation only. Is it Objectify issue, or GAE Datastore issue?

1
What makes you think an index has been created for fields - and what would that mean, since indexes are only created on leaf nodes (type, label, name)? - stickfigure
In GAE Datastore dashboard for the entity I see that index size for fields is not 0B and keeps growing as I add new entries. - Kiryl Mayorchyk

1 Answers

0
votes

There are more details about this issue here. In Datastore the field types of array are always showing indexed regardless of excludeFromIndexes parameter value.

It is not known if this is an issue, or intended behaviour, but it looks like this can be an inconsistency between the google-cloud-node library and the API.