问题
I am using aws cloud search to search a group of docs. I want to group the results by a field value, say 'color', and return only one (most relevant) of each. So if i have
doc1 : {
color: 'green',
number: 3,
relevance: 'high'
},
doc2 : {
color: 'red',
number: 3,
relevance: 'medium'
},
doc3 : {
color: 'green',
number: 3,
relevance: 'medium
}
And searching for 'number: 3, I only want doc1 and doc2, the most popular ones in their respective 'color' groups. Is this possible?
来源:https://stackoverflow.com/questions/48526523/aws-cloud-search-grouping-search-results-by-field-value-and-returning-only-most