i have a bit of a hard time understanding how to specify a default mapping
that is used for all types in an index.
My usage scenario is as follows (inspired by some discussions on this list
that seemed to advocate for one-type-per-user over
one-index-per-user-configurations for scalability reasons when you have
many user-specific documents):
I have an index, named e.g. "contacts", and one predefined type "general"
in that index (which is used for contacts that are not specific to one
user, at the moment only this type has any specific mapping). Then, for
each user, a type "user_someuserid" is created in the same index.
My problem now is that even after quite some reading of the documentation,
I can't figure out how to specify one general default mapping for all types
in an index. I know I could probably do a "put mapping" (with always the
same mapping) when creating the user-specific type, but if possible I want
to avoid that since the types get created on the fly when the first
document is indexed for that user.
The JSON used in all the sub-types of one index will be the same. I already
tried specifying/changing the "_default" mapping, but that didn't seem to
be used for documents in the newly created sub-types.
Any pointers on what (apart from the "put mapping" before the first
document for each user gets indexed) I could look at to specify one mapping
that is valid for all types in an index, even types created in the future?
Thanks a lot! That was too easy, should have looked more closely
there. I think I even tried with default once, but got confused
(i.e. thought it didn't work) because analyze requests seem to ignore
the default mapping until the first document is indexed in that
index/type.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.