相等运算符在php的GQL数据存储中不起作用
这里是GQL中的一个查询,它在modified>timestamp相等运算符在php的GQL数据存储中不起作用,php,google-cloud-datastore,gql,Php,Google Cloud Datastore,Gql,这里是GQL中的一个查询,它在modified>timestamp $query = $ds->query() ->kind('Video') ->filter('email', '=', $email) ->filter('lat', '=', $lat) ->filter('lng', '=', $lng) ->filter('mo
$query = $ds->query()
->kind('Video')
->filter('email', '=', $email)
->filter('lat', '=', $lat)
->filter('lng', '=', $lng)
->filter('modified', '>', 1505807001);
$result = $ds->runQuery($query);
如果跳过大于时间戳,则查询正常工作。否则就不行了
返回异常。摘录如下:
{
"error": {
"code": 400,
"message": "no matching index found. recommended index is:\n- kind:
Video\n propert (truncated...)
对此的任何帮助都将不胜感激。您需要为查询添加一个显式的复合索引() 如果没有不平等性,云数据存储可以使用内置索引进行查询,但如果使用时间戳不平等性,云数据存储不可能进行查询 您可能需要如下索引定义:
indexes:
- kind: Video
properties:
- name: email
direction: desc
- name: lat
direction: desc
- name: lng
direction: desc
- name: modified
direction: asc
顺便说一句,如果lat&lg是地理点,您可能会想使用geohashing()之类的工具。不起作用意味着什么?这是错误吗?它返回不正确的结果集?它不返回结果?