问题
On cloudsearch we can fetch facet information by passing facets.FIELD parameter in query, but I want cloudsearch to return all the available (returnable) facets. Is there a way we can do it? I have many facets which have return enabled.
回答1:
There is no way to retrieve facet information for all facets -- you must explicitly specify each facet you're interested in, eg to get the values for facets FOO and BAR, your query would specify:
facet.FOO={}&facet.BAR={}
Here are the faceting docs if you haven't seen them: http://docs.aws.amazon.com/cloudsearch/latest/developerguide/faceting.html
I also want to make sure you're not confused about what 'return enabled' means. That means a field can be included in search results and it is unrelated to facets. I'm guessing you meant that the fields are FacetEnabled. You can read more about that at: http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-index-fields.html
来源:https://stackoverflow.com/questions/28856521/how-to-fetch-all-the-facets-from-cloudsearch