亚马逊Cloudsearch:如果过滤器存在 [英] Amazon Cloudsearch : Filter if exists

查看:183
本文介绍了亚马逊Cloudsearch:如果过滤器存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个亚马逊cloudsearch域。这样做的目的是滤除如果字段语言的存在。 并不是所有的对象都具有一种语言,我希望有那些它确实有语言的过滤,而且还可以返回没有任何语言的人。

I have an amazon cloudsearch domain. The aim is to filter if the field 'language' exists. Not all objects have a language, and I want to have the ones which do have a language filtered, but the ones that do not have any language to also be returned.

我想和筛选 (或语言:'恩'的语言:空)

I want to filter with ( or language:'en' language:null )

不过空不能在字符串中过去了。

However null cannot be passed within a string.

这可能吗?如果是的话会是怎样来完成。

Is this possible? If so how would it be done.

推荐答案

我看着别处藏汉,看来:

I looked elsewhere aswell, it seems :

要做到这一点最简单的方法,就是用来设置字段的默认值,然后使用该值你空。

The simplest way to do that, is to set a default value for the field, and then use that value for your null.

例如,设置默认为字符串空,那么你就可以很容易地为测试。

For example, set the default to the string "null", then you can easily test for that.

我相信你可以添加一个默认值,并重新编制索引,并应重新应用默认的。

I believe you can add a default value, and re-index, and that should reapply the default.

这篇关于亚马逊Cloudsearch:如果过滤器存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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