Applying a single field to a specific field in a CloudSearch request

I am looking into AWS CloudSearch for a new search engine.

Let's assume that each article has articles and some comments . The search API should return articles that match or have matching comments. So, is there a way to extract the DISTINCT values ​​(in this case, the unique article ID) from CloudSearch with a single query? If not, would it be a good solution to solve this feature with cloud search?

I know the text array type for the document field in CloudSearch, but it seems expensive to update the documents as there are N comments in a single article can be over a thousand.

+3


source to share


1 answer


I ran into a similar problem, so comments in your case are not an option, as array elements cannot be more than 1000 in cloudearch. I will make two search domains, articles and comments. I will search both of them in parallel (asynchronous or multi-threaded depending on the language), articles will always generate non-duplicate IDs, but based on the results of requesting comments, you should apply logic to the ID of the article only once and always select the top one since the results are sorted by coincidence of points.



+1


source







All Articles