I'm building an application which could greatly benefit from ElasticSearch. In my current version I'm using 1 single index: "messages" with just 1 type: "message".
Messages are composed of the following format (averaging 10kb):
messages
- id
- subject (string)
- date (date) (format: dateOptionalTime)
- account_id (integer)
- body (string)
- receivers (nested)
properties:
name (string)
email (string)
- files (nested)
properties:
content_type (string)
filename (string)
size (long)
Searches are currently on an account_id basis (adding a filter to each query). In my mySQL database each account has an company_id (one company can have multiple accounts). In the future I might be willing to allow a user to search company-wide instead of within a single account. My dataset is kind of large (>50m documents).
My question is what would be best, just using this single index (messages) with a single type (message), or do something like on a company-wide index where each I would create a new index for each company (like messages_%company_id%).
My dataset will grow between 1 - 5M documents a month, documents almost never have to be deleted. Old data can be as valuable in here as a fresh inserted document.