Is it possible to have a composite index with a list property and a sort order?
And if not, why not?
The following index always fails to build on the production server, even though I had thought I could have a sort order with a list property as long as the index didn't sort or match against any other properties.
- kind: Foo
properties:
- name: location_geocells
- name: time
direction: desc
If such a composite index is allowed, are there any reasons that this index might fail to be created for me? Do the existence of other indices on the same model increase the likelihood of this failure?
Does the combination of a sort order with a list property require more than N entries, where N is the number of values in the list property? (If so, how many does it require?)
Update: The error I'm encountering is simply that the index can't be built on the appspot server, it's always in the Error state upon trying to add the index. As I understand the documentation on indexes, I can't see more detailed logs but infer that there must be some entity for which this index requires more than 5000 entries, which surprises me, since the location_geocells
StringListProperty has only 16 items for each entity, unless I'm miscalculating how many index entries this index req开发者_如何学编程uires (hence my question).
If there are other ways to debug an index in an Error state (like logs of what went wrong in creating the index), that would be invaluable information.
Yes - list properties are indexed as 'multiply valued properties', with one index row per list entry. The index you specify should work fine.
You're not specific about why it "doesn't work". What problem are you encountering?
There are documented rules about this sort of thing. One of them is that appengine sorts index fields in a certain order: by ancestor, primary, then equality filters, then inequality filters and lastly by sort orders. Appengine will not recognise any custom orderings you ask it for.
精彩评论