Need suggestion ----- about Mappings

Hi To All.,

         Actually., First I will discuss about my Requirement, is., 

Suppose we have 3 files like.,
1. abc_1234_20130502201030_cdr65.txt
2. abc_1234_20130502201030_dat66.txt
3. abc_1234_20130502201030_log67.txt
now., we have to index above data into ElasticSearch. But as per
my requirement
we have to take the index name as "20130502201030" <which is the 3rd word
in file name>
and index type as "cdr65" <which is the 4rt word in file name>for first
file and so on.

That means as per my file name we have to create index and index type
dynamically.

In these 3 files we have date format like "yyyymmddhhmiss" format. So we
have used the put-mapping for configure the date field as we have for the
three index types.
Upto here all is fine.

Problem is:
later we have got some more files for which we need to store them in same
index with different index type.
but unfortunately.,

  1. when we are trying to add some more mappings[for new types] for existing
    index we are getting "Index Already Exists" Exception.
  2. and also if we load data with different index type in the same index
    data is loading, but the date field is taken as "string".

Can Any One Know About This., Please Tell me
A. How to do mappings for new types for existing Index.
B. Why I am getting exception for adding mapping[for new type ] for
existing index?
C. Is There any approach for give the default date format for whole index
so that
if we Index new date fields [with "yyyymmddhhmmss" format]
then new field create as the default date format only.
[And if i create new type then default date format only
taken for new date fields.]
D. If My Requirement is wrong please tell me how to solve the new date
format must fix as date only when we index?

Thanks and Regards to All,
Mohammad Rafi.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi to All.,

      I have some more Question in my Mind.. they are,
  1.             if we create a index with type [say, type1] which has 
    

the mappings for custom date fields.
now if we want to use the same type1[existing index type which has date
format mappings settings] for new index. is it Possible?
2. is it possible to have a default mapping settings so
that for all newly created index
will check date format like "yyyymmddhhmmss" instead of "dateoptionaltime"
when we pass date in string format?

If Any One Know about this issue, Please tell me.

Thanks and Regards to All,
Mohammad Rafi.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,

A. This one should work fine:

B. Check if A. works fine
C. As far as I know there are 2 possibilities:

  1. Dynamic templates: you can create indices templates but you have to know
    all the document types in an index:
    Elasticsearch Platform — Find real-time answers at scale | Elastic
  2. Changing date format for a root object type:
    Elasticsearch Platform — Find real-time answers at scale | Elastic

Best regards.

2013/5/28 rafi me.mrafi.en@gmail.com

Hi To All.,

         Actually., First I will discuss about my Requirement, is.,

Suppose we have 3 files like.,
1. abc_1234_20130502201030_cdr65.txt
2. abc_1234_20130502201030_dat66.txt
3. abc_1234_20130502201030_log67.txt
now., we have to index above data into Elasticsearch. But as per
my requirement
we have to take the index name as "20130502201030" <which is the 3rd word
in file name>
and index type as "cdr65" <which is the 4rt word in file name>for first
file and so on.

That means as per my file name we have to create index and index type
dynamically.

In these 3 files we have date format like "yyyymmddhhmiss" format. So we
have used the put-mapping for configure the date field as we have for the
three index types.
Upto here all is fine.

Problem is:
later we have got some more files for which we need to store them in same
index with different index type.
but unfortunately.,

  1. when we are trying to add some more mappings[for new types] for
    existing index we are getting "Index Already Exists" Exception.
  2. and also if we load data with different index type in the same index
    data is loading, but the date field is taken as "string".

Can Any One Know About This., Please Tell me
A. How to do mappings for new types for existing Index.
B. Why I am getting exception for adding mapping[for new type ] for
existing index?
C. Is There any approach for give the default date format for whole index
so that
if we Index new date fields [with "yyyymmddhhmmss" format]
then new field create as the default date format only.
[And if i create new type then default date format only
taken for new date fields.]
D. If My Requirement is wrong please tell me how to solve the new date
format must fix as date only when we index?

Thanks and Regards to All,
Mohammad Rafi.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

  1. It should be possible, because each ES index is fully separated so the
    mappings and types are separated too. But check this out to be sure :slight_smile:
  2. Please check
    Elasticsearch Platform — Find real-time answers at scale | Elastic

Best regards.

2013/5/29 rafi me.mrafi.en@gmail.com

Hi to All.,

      I have some more Question in my Mind.. they are,
  1.             if we create a index with type [say, type1] which has
    

the mappings for custom date fields.
now if we want to use the same type1[existing index type which has date
format mappings settings] for new index. is it Possible?
2. is it possible to have a default mapping settings so
that for all newly created index
will check date format like "yyyymmddhhmmss" instead of "dateoptionaltime"
when we pass date in string format?

If Any One Know about this issue, Please tell me.

Thanks and Regards to All,
Mohammad Rafi.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.