选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

Retrieving Data from Index Fields in Amazon CloudSearch - Amazon CloudSearch
此页面尚未翻译为您的语言。 请求翻译

Retrieving Data from Index Fields in Amazon CloudSearch

By default, the search results include all return enabled fields. To return a subset of the return enabled fields or return expression values for the matching documents, you can specify the return parameter. To return only the document IDs for the matching documents, specify return=_no_fields. To retrieve the relevance score calculated for each document, specify return=_score. You specify multiple return fields as a comma separated list. For example, return=title,_score returns just the title and relevance score of each matching document.

Only fields configured to be return enabled can be included in the search results. Making fields return enabled increases the size of your index, which can increase the cost of running your domain. You should only store document data in the search index by making fields return enabled when it's difficult or costly to retrieve the data using other means. Because it can take some time to apply document updates across the domain, you should retrieve critical data such as pricing information by using the returned document IDs instead of returned from the index.

For example, to include the title and relevance _score in the search results, specify the following:

search?q=star -wars&return=title,_score&size=3

The specified fields are included with each hit in the search results:

{ "status" : { "rid" : "y9Dzhs8oEwqMHnk=", "time-ms" : 2 }, "hits" : { "found" : 76, "start" : 0, "hit" : [ { "id" : "tt1411664", "fields" : { "title" : "Bucky Larson: Born to Be a Star", "_score" : "9.231539" } }, { "id" : "tt1911658", "fields" : { "title" : "The Penguins of Madagascar", "_score" : "7.1051397" } }, { "id" : "tt0120601", "fields" : { "title" : "Being John Malkovich", "_score" : "6.206055" } } ] } }
隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。