admin console GQL query: index not found when ordering on date

516 Views Asked by At

My datastore-indexes.xml looks like this:

<datastore-index kind="Book" ancestor="false" source="auto">
    <property name="^i" direction="asc"/>
    <property name="nurInRange2" direction="asc"/>
    <property name="firstModificationDate" direction="desc"/>
</datastore-index>

The datastore admin console actually shows this under Data / Datastore indexes:

^i ▲ , nurInRange2 ▲ , firstModificationDate ▼ : serving

But yet, when I go to the Datastore Viewer and execute a by gql query:

SELECT * FROM Book where nurInRange2 = True  order by firstModificationDate DESC

I get the following response:

no matching index found.
The suggested index for this query is:
    - kind: Book
    properties:
      - name: nurInRange5
      - name: firstModificationDate
        direction: desc

Is there something obvious I'm missing? Is there anything wrong with my index formulation?

1

There are 1 best solutions below

0
On

You have to use 'firstModificationDate' in your filter if you want to sort on it.

See Restrictions on Queries for more info.