Skip to content Skip to sidebar Skip to footer

Sort Items Objectify Getting Error No Matching Index Found

I am trying to sort a list of items by my property 'price' but I'm getting error. This is my filter items = ofy().load().type(MyItem.class) .filter('OtherEntityRef', t

Solution 1:

After the help of @Dan Cornilescu I found the problem.

I had not had any composite Indexes. My Datastore -> Indexes was empty. To solve it I created a XML file under the WEB-INF folder called datastore-indexes.xml and there I explicitly defined my index.

<?xml version="1.0" encoding="utf-8"?><datastore-indexesautoGenerate="true"><datastore-indexkind="MyEntity"ancestor="false"source="manual"><propertyname="OtherEntityRef"direction="asc"/><propertyname="price"direction="asc"/></datastore-index></datastore-indexes>

As I understood was that if you use order if you have to add your own index. The built-in does not work in this case.(Here I am expressing my basic knowledge).

Thank you @Dan Cornilescu for the time you take to help.

Post a Comment for "Sort Items Objectify Getting Error No Matching Index Found"