Index json file with new Date field

Hi,

I've got a large json file which contains information i need to index, each
entry looks like this:
{"_id":"1002004000002182","createDate":new
Date(1208563200000),"modifiedContentDate":new Date(1360281600000),
.................}

Is there a way to use the REST API to handle 'new Date(####)' fields as
mentioned? Right now it seems it can't. The goal is to create a bootstrap
mechanism to bulk-index the entire content from several large json files.

Thanks,
Maarten

--
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.

Hey Maarten,

If I understand well, what you would have to do is to set the field type of
your date field as "date" into the mapping, then instead of passing new
Date(###) just pass ### and it will be stored as a date, which is really
only a long in the end.

On Friday, August 9, 2013 5:59:46 AM UTC-4, Maarten Roosendaal wrote:

Hi,

I've got a large json file which contains information i need to index,
each entry looks like this:
{"_id":"1002004000002182","createDate":new
Date(1208563200000),"modifiedContentDate":new Date(1360281600000),
.................}

Is there a way to use the REST API to handle 'new Date(####)' fields as
mentioned? Right now it seems it can't. The goal is to create a bootstrap
mechanism to bulk-index the entire content from several large json files.

Thanks,
Maarten

--
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,

I thought so, the challenge is that this file contains 15 mln entries, so
in order to do what you propose i need to preprocess this file and remove
all new Date(##) entries but keep the ###.

Thanks,
Maarten

Op vrijdag 9 augustus 2013 14:40:19 UTC+2 schreef Jérôme Gagnon:

Hey Maarten,

If I understand well, what you would have to do is to set the field type
of your date field as "date" into the mapping, then instead of passing new
Date(###) just pass ### and it will be stored as a date, which is really
only a long in the end.

On Friday, August 9, 2013 5:59:46 AM UTC-4, Maarten Roosendaal wrote:

Hi,

I've got a large json file which contains information i need to index,
each entry looks like this:
{"_id":"1002004000002182","createDate":new
Date(1208563200000),"modifiedContentDate":new Date(1360281600000),
.................}

Is there a way to use the REST API to handle 'new Date(####)' fields as
mentioned? Right now it seems it can't. The goal is to create a bootstrap
mechanism to bulk-index the entire content from several large json files.

Thanks,
Maarten

--
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.