I have detailed my question on stackoverflow here:
Briefing it here as well :
I have been reading a lot on mappings in Elasticsearch and here's something
interesting that I found
Field names with the same name across types are highly recommended to have
the same type and same mapping characteristics (analysis settings for
example). There is an effort to allow to explicitly "choose" which field to
use by using type prefix (my_type.my_field), but it’s not complete, and there
are places where it will never work (like faceting on the field).
I found the above quote from the documentation here
http://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html
Now my use case is exactly that .. Here's an example. Suppose that some
field in tenant1 has to have the following mapping (for a given entity
user):
{
"tenantId1_user": {
"properties": {
"someField": {
"type": "string",
"index":"analyzed"
}
}
}
}
Now, for the same field in a different tenant (for the same entity type,
lets say user), the type has to change like this:
{
"tenantId2_user": {
"properties": {
"someField": {
"type": "int",
"index":"analyzed"
}
}
}
}
Now from what I understand from the above quote, it means that technically
even though I can provide this mapping, it is not recommended because deep
down Lucene handles them in the same way.
My questions are:
-
How can I handle my usecase ? Should I just separate out each tenant in
a different index so I don't have to worry about this mapping ? -
Is there any other workaround ? Considering the fact that if I have too
many tenants that means I will have too many indices? -
What's the recommended way for this usecase?
All help appreciated!
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/0264dafc-82e9-44fb-8193-b2661e8225a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.