简体   繁体   English

AWS CloudSearch:如何搜索较大的子集?

[英]AWS CloudSearch: how to search a large subset?

I simply want to search a large subset of ids within our CloudSearch index. 我只想在CloudSearch索引中搜索大量ID。

I have tried with a structured query (and also with a simple query plus a filterQuery), for example this narrows the search to three records only, those with item_key of 36933, 36940, or 36950. 我已经尝试过使用结构化查询(以及简单查询和filterQuery),例如,这item_key搜索范围缩小到仅三个记录,即item_key为36933、36940或36950的记录。

(or (term field=item_key 'item_36933') (term field=item_key 'item_36940') (term field=item_key 'item_36950'))

This works, and it is obviously easy to expand that structured query to include many items. 这行得通,并且很容易将结构化查询扩展为包含许多项。 However, there seems to be a limit of 50 such terms in CloudSearch :-( which is a problem as I need to search sets of many more than 50 items, but still only a fraction of the overall index. 但是,CloudSearch中似乎限制了50个这样的术语:-(这是一个问题,因为我需要搜索50多个项目的集合,但仍然只占整体索引的一小部分。

How can I do this, for an arbitrary set of say 1000 items, without resorting to searching the entire index and then filtering the results? 我如何针对任意一组(例如1000个项目)执行此操作,而又不求助于搜索整个索引,然后过滤结果?

CloudSearch supports 1024 clauses per search. CloudSearch每次搜索支持1024个子句

This means you can do a search against a field matching up to 1024 values, like 这意味着您可以对最多匹配1024个值的字段进行搜索,例如

field_name: "value1" OR "value2" OR ... OR "value1024" field_name:“ value1”或“ value2”或...或“ value1024”

If your service needs to support more than 1024 individual matches, then you will need to split into multiple queries of 1024 and combine the results. 如果您的服务需要支持1024个以上的单个匹配项,那么您将需要拆分为1024个的多个查询并合并结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM