2012-08-02 55 views
0

我的數據存儲,indexes.xml看起來是這樣的:管理控制檯GQL查詢:上日期訂貨時指數未發現

<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> 

數據存儲管理控制檯實際上顯示了這個在數據/資料儲存庫索引:

^i ▲ , nurInRange2 ▲ , firstModificationDate ▼ : serving 

但是呢,當我去到數據存儲瀏覽器並執行by gql查詢:

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

我收到以下回復:

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

有什麼明顯的我失蹤了嗎?我的指數公式有什麼問題嗎?

+0

什麼是^ i屬性(在索引中)爲什麼它在那裏?它不是建議索引的一部分。你需要一個沒有它的新索引。 – 2012-08-02 21:21:10

+1

@Shay:^ i屬性(最可能)是Objectify的生成屬性,需要多態:http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#Implementation_Considerations – 2012-08-03 06:20:18

+0

10倍@PeterKnego我從來沒有使用過物化。 – 2012-08-03 08:36:20

回答

0

如果要對其進行排序,則必須在過濾器中使用'firstModificationDate'。

有關更多信息,請參閱Restrictions on Queries