问题
I'm interested in using AWS Cloud Search for my web app. I have 3 different document types that I want to make searchable (users - articles - images).
What is the best way to do this with Cloud Search? Do I need to create 3 different AWS search domains? And does this mean i need to pay for at least 3 search instances?
Or can I put all of them in 1 domain / instance and use something like indexes or types (to use elastic search terminology)?
Thanks!
回答1:
You can try this:
- Add a "searchable_text" index of type text, "category" index of type literal which is faceted enabled.
- Upload documents of all types with full text search field as "searchable_text" and category as one of "users", "articles" or "images".
- Query based on
category
to return results from each type.
If your search query is going to be complex with many index fields, you may end up having a lot of null values in many indexed fields if you try to maintain a single domain for different document types. Empty values are not good for indexes and it's better to separate document types into their own domains if you end up there.
来源:https://stackoverflow.com/questions/15797190/aws-cloudsearch-different-documents-in-1-domain