Fusion Tables过滤条件OR [英] Fusion Tables filter conditions OR

查看:93
本文介绍了Fusion Tables过滤条件OR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 https://developers.google.com/fusiontables/docs/developers_reference OR操作不允许作为过滤条件的一部分。所以我试图想出一个创造性的方式来解决以下问题:

我有一个融合表支持谷歌地图数以百计的地方,并希望过滤它只有具有包含搜索参数的标签或标题的地方。



理想情况下,我可以将以下内容用作我的过滤条件:

 标签CONTAINS IGNORING CASE'searchterm'OR title CONTAINS IGNORING CASE'searchterm'

但融合表API根本不允许它。那么该怎么办?进行2个单独的查询,然后过滤出重复项?这意味着我无法使用好的FusionTablesLayer预渲染的tile功能。



你会怎么做?

解决方案

一个可能的答案是预先渲染表中的数据。本质上添加另一列,它是标签和标题的集合。然后,我只需要查询一个'tags_or_titles'列。当然,这意味着当我将数据导出到融合表中时,事先会有更多的数据传输,并且感觉不那么好,干净......


According to https://developers.google.com/fusiontables/docs/developers_reference OR operations are not allowed as part of filter conditions. So I'm trying to come up with a creative way to solve the following:

I have a fusion table backed google map with hundreds of places and want to filter it to only places that have 'tags' or a 'title' containing a search parameter.

Ideally I could just use the following as my filter condition:

tags CONTAINS IGNORING CASE 'searchterm' OR title CONTAINS IGNORING CASE 'searchterm'

But the fusion table API simply doesn't allow it. So what to do? Make 2 separate queries, then filter out the duplicates? That means I can't use the nice FusionTablesLayer pre-rendered tile functionality.

What would you do?

解决方案

A possible answer is to pre-render the data within the table. Essentially add another column which is an aggregate of tags and title. Then I only need to query the one 'tags_or_titles' column. Of course this means more data munging beforehand when I export the data into the fusion table and doesn't feel so nice and clean...

这篇关于Fusion Tables过滤条件OR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆