Advise for mapping options

Hi,

I have multi-tenant application in which I want to index customer data, new
tenants can come very frequent. Each tenant has in advance known what index
type it needs. But, common for all indexes (types and tenants) is 3 fields
: date, id of data and user account and I have to not store _source.

I need to provide mapping for all indexes / types once I start to index new
tenant. But, also possible that new index type will be added for all
tenants.
So, I think best solution is default-mapping.json, but may be I'm missing
something and there better solution ?

Thank You and Best Regards.

index templates can also help:

.

On Fri, Dec 16, 2011 at 9:35 AM, slavag slavago@gmail.com wrote:

Hi,

I have multi-tenant application in which I want to index customer data,
new tenants can come very frequent. Each tenant has in advance known what
index type it needs. But, common for all indexes (types and tenants) is 3
fields : date, id of data and user account and I have to not store _source.

I need to provide mapping for all indexes / types once I start to index
new tenant. But, also possible that new index type will be added for all
tenants.
So, I think best solution is default-mapping.json, but may be I'm missing
something and there better solution ?

Thank You and Best Regards.

Can I set template that will match any type ?

You can set the type name as default, and then it will match any type.

On Fri, Dec 16, 2011 at 7:12 PM, slavag slavago@gmail.com wrote:

Can I set template that will match any type ?

Thank You

Hi

I have a question regarding get template from java.
I found put template, and I also found cluster state (getting all template)
, but somehow I can't find get single template by name in java.

Thank You.

There isn't one, you get it from the cluster state. Here is the code for
hte REST endpoint for get template which uses the Java API:
https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/rest/action/admin/indices/template/get/RestGetIndexTemplateAction.java
.

On Thu, Dec 22, 2011 at 12:20 AM, slavag slavago@gmail.com wrote:

Hi

I have a question regarding get template from java.
I found put template, and I also found cluster state (getting all
template) , but somehow I can't find get single template by name in java.

Thank You.