In trying to tune a model's index count I removed the individual
indexes from the model's fields but left a couple composites (since
thats the only mode I would query in). However, this leads to an
error:
invalid filter: Cannot query for unindexed property fields
Is this restriction artificial or do I really need to add those back?
Example:
class MyModel(ndb.Model):
field1 = model.StringProperty(indexed=False)
field2 = model.StringProperty(indexed=False, repeated=True)
field3 = model.IntegerProperty(indexed=False)
index.yaml
- kind: MyModel
properties:
- name: field1
- name: field2
- name: field3
direction: desc
Query (something like):
MyModel.query().filter(MyModel.field1=val1,
MyModel.field2=val2).order(-MyModel.field3)
Should this be considered a bug or unsupported use case?
Best,
jesse
--
Jesse Lovelace, CTO
Key Ingredient Corporation
902 East 5th Street, Suite 105
Austin, TX 78702
(512) 462-4996 direct
je...@keyingredient.com
Notice: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information
of Key Ingredient Corporation. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all
copies of the original message.
This is how it works today: composite indexes can only use indexed
properties. I believe there's a bug in the App Engine tracker to
change this; you might want to star that issue. Once that issue is
resolved we'll remove the tests from NDB.
--Guido
--
--Guido van Rossum (python.org/~guido)