CloudSearch - 返回时,字段不存在结果 [英] CloudSearch - Return results when a field does not exist

查看:236
本文介绍了CloudSearch - 返回时,字段不存在结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有CloudSearch结构化查询返回没有字段中的值的结果吗?例如,我有一个名为领域 target_date ,这并不总是有一个价值,我想返回所有结果,没有target_date。此字段未被zero'd出或设置为默认;它不带日期的项目存在的。

Is there a CloudSearch structured query to return results that do not have a value within a field? For example, I have a field called target_date that does not always have a value and I want to return all results with no target_date. This field is not zero'd out or set to a default; it doesn't exist at all for items without the date.

还有另外一种情况了。我需要经过 target_date 返回所有结果文件,包括但现有的日期的任何结果。我使用的结构化查询 target_date:['2000-03-03T00:00:00Z'} 。查询发现不存在的日期应与运营商合作,如:(和target_date:['2000-03-03T00:00: 00Z'} [QUERY_GOES_HERE])

There is another case too. I need to return all results after a target_date AND include any results without an existing date. The structured query I am using is target_date:['2000-03-03T00:00:00Z',}. The query to find non-existing dates should work with an and operator, like: (and target_date:['2000-03-03T00:00:00Z',} [QUERY_GOES_HERE])

推荐答案

我相信你问同样的事情,<一个href="http://stackoverflow.com/questions/26591773/amazon-cloudsearch-filter-if-exists/26593341">Amazon Cloudsearch:过滤器是否存在

I believe you're asking the same thing as Amazon Cloudsearch : Filter if exists

要在那里总结的选项:

  1. 添加一个新的布尔字段名为has_target_date
  2. 设置默认target_date(例如1/1/1970)意味着它不存在
  3. 的黑客:(范围字段= target_date [0,})

所有这些选项应该与你的问题的QUERY_GOES_HERE部分。

Any of those options should work with the QUERY_GOES_HERE portion of your question.

这篇关于CloudSearch - 返回时,字段不存在结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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