Let's say in a Microservices architecture there are 100s of different entities and search needs to be supported that can look for matches in all those entities. I see a few ways of doing this.
- Create one index for each entity - make as many search queries as number of indexes in parallel and then merge the results.
- Create multiple really wide indexes ( going all the way to max allowed columns in an index). Create multiple such indexes as need. Do same as 1 for these indexes.
- Add only a limited number of pre-defined columns that are common to all entities. Add one more column like "searchableData" that holds data from other entity fields but not the file names. This means that all fields from individual entities are not provided as "filters" but their data is indexed and can be searched. This is not ideal but seems like a reasonable solution.
Any suggestions?