如何获取构面中每个存储桶最相关的文档 ID?

How can I get the most relevant document ID for each bucket in the facet?

如何为构面中的每个存储桶获取最相关的文档 ID。 例如,我想知道存储桶 "Comedy"、"Drama"、"Adventure" 和其他最相关的文档 ID:

<results>
    <status rid="v7r9hs8oFQqMHnk=" time-ms="3"/>
    <hits found="85" start="0">
        <hit id="tt1411664"/>
        <hit id="tt1911658"/>
        <hit id="tt0086190"/>
        <hit id="tt0120601"/>
        <hit id="tt2141761"/>
        <hit id="tt1674771"/>
        <hit id="tt0056687"/>
        <hit id="tt0397892"/>
        <hit id="tt0258153"/>
        <hit id="tt0796366"/>
    </hits>
    <facets>
        <facet name="genres">
            <bucket value="Comedy" count="41"/>  <<???? What is the most relevant document ID for this bucket? 
            <bucket value="Drama" count="35"/> <<???? What is the most relevant document ID for this bucket?
            <bucket value="Adventure" count="29"/>  <<???? What is the most relevant document ID for this bucket?
            <bucket value="Sci-Fi" count="24"/> <<???? What is the most relevant document ID for this bucket?
            <bucket value="Action" count="20"/> <<???? What is the most relevant document ID for this bucket?
        </facet>
    </facets>
</results>

您必须针对每个方面进行一个查询。在过滤器查询中指定构面,例如:

fq=genres:'Comedy'&size=1

查看有关使用方面信息的文档: http://docs.aws.amazon.com/cloudsearch/latest/developerguide/faceting.html