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.,
when we are trying to add some more mappings[for new types] for existing
index we are getting "Index Already Exists" Exception.
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?
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?
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.,
when we are trying to add some more mappings[for new types] for
existing index we are getting "Index Already Exists" Exception.
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?
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?
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.