Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CloudSearch: different documents in 1 domain?

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!

like image 818
stikkos Avatar asked Apr 03 '13 20:04

stikkos


1 Answers

You can try this:

  1. Add a "searchable_text" index of type text, "category" index of type literal which is faceted enabled.
  2. Upload documents of all types with full text search field as "searchable_text" and category as one of "users", "articles" or "images".
  3. 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.

like image 149
Emil Avatar answered Nov 14 '22 15:11

Emil