查询野外生存的CloudSearch [英] Query for field existence in CloudSearch

查看:142
本文介绍了查询野外生存的CloudSearch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个可选字段名为XYZ在我在CloudSearch索引的文件清单。

Suppose I have an optional field called 'xyz' in the list of documents I've indexed in CloudSearch.

如何查询CloudSearch,使其只返回那些包含XYZ?

How do I query CloudSearch so that it returns only those documents that contain 'xyz'?

如果我预先知道,这是一个正整数,我也许可以做这样的事情,以获得所需的列表: Q = XYZ:[0,}&安培; q.parser =结构化

If I know up front, that it's a positive integer, I can probably do something like this to get the required list: q=xyz:[0,}&q.parser=structured

但我怎么做,如果XYZ存储一些其他类型的如字符串或整数/字符串列表等,?

But how do I do it if 'xyz' stores some other type like a string or a list of ints/strings etc.,?

顺便说一句,我使用Solr的面前,在那里,我可以简单地做 Q = XYZ:* 来实现这一目标。请问CloudSearch支持这种定期EX pressions?

BTW, I've used Solr before, and there, I could simply do q=xyz:* to achieve this. Does CloudSearch support such regular expressions?

推荐答案

您可以使用*运算符,在你的情况下,其将是XYZ查询字段中的非空值解析器为您查询CloudSearch。

You can query for non empty values in a field using * operator, in your case its going to be xyz:* This will only work if you are using Lucene parser for your query to CloudSearch.

这篇关于查询野外生存的CloudSearch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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