Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 您可以使用数据存储同时搜索多个字段吗_Google App Engine_Google Cloud Datastore - Fatal编程技术网

Google app engine 您可以使用数据存储同时搜索多个字段吗

Google app engine 您可以使用数据存储同时搜索多个字段吗,google-app-engine,google-cloud-datastore,Google App Engine,Google Cloud Datastore,在我为GAE设计的应用程序中,我想要一个全向搜索栏 据我所知,数据存储是如何存储记录的,它基本上是一个hashmap的hashmap。所以我有一个键,然后是一个字符串(为了概念上的简单性),它是一个JSON返回值 在关系数据库世界中,如果我想同时搜索名字和姓氏,我必须有这样的东西 select * from user where user.firstname like 'bob' or user.lastname like 'bob' 使用数据存储,我可以执行以下操作吗 select from

在我为GAE设计的应用程序中,我想要一个全向搜索栏

据我所知,数据存储是如何存储记录的,它基本上是一个hashmap的hashmap。所以我有一个键,然后是一个字符串(为了概念上的简单性),它是一个JSON返回值

在关系数据库世界中,如果我想同时搜索名字和姓氏,我必须有这样的东西

select * from user where user.firstname like 'bob' or user.lastname like 'bob'
使用数据存储,我可以执行以下操作吗

select from user where user.anyfield like 'bob'

它将搜索用户实体的所有字段,自动返回user.firstname和/或user.lastname类似于“bob”的任何记录。

应用程序引擎不支持
,但正如尼克所建议的,您可以通过查询firstname和另一个lastname并组合结果来完成相同的操作


您也不能像那样直接执行
比较,但可以执行“从开始”查询,如图所示。

有一种解决方案可以完全满足您的需要。它使用列表属性和关系索引实体


您可以在我的博客中找到使用Objectify实现的示例。要了解有关关系索引实体的更多信息,请参阅此Google IO。

应用程序引擎既没有
,也没有类似
。这两种方法都有合适的变通方法。你应该把它们作为一个答案发布@scphantm没有任何东西阻止您在App Engine中过滤多个属性-受hyperslug提到的限制。