Problem with histogram date facet

Hi,

I have my data in couchdb and using couchdb river plugin indexing is done.
The date is stored in gregorian calender milliseconds.

I want to do faceting on that date field. so, my idea is convert it to unix
seconds and store it as date type in mapping.

convertion to unix timestamp can be done by "Gregorian seconds -
62167219200 = Unix seconds".

This is my JSON mapping.

{
"myuser2" : {
"properties" : {

"pvt_created" : {
  "type": "multi_field",
      "fields": {
          "pvt_created": { "type": "string", "index": "not_analyzed", 

"store": "yes" },
"dt_created": { "type": "date", "format": "date_hour_minute",
"index": "no", "store": "yes" }
}

}


  }
}

}

pvt_created is the field with Gregorian seconds. dt_created wanted to be in
unix seconds. How can i do a minus operation at mapping?

Please let me know how I can achieve histogram date faceting on this field.

Thanks,
Srilatha

--
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 have used script tag while creating river as below to convert the
gregorian seconds to unix milliseconds.

"script" : "ctx.doc.pvt_created = (ctx.doc.pvt_created - 62167219200)*1000"

This works fine. But I cannot use couchdb "filter" and "script" tags
simultaneously.

Is there any other way of doing this? especially in mappings?

Thanks,
Srilatha

On Wednesday, February 20, 2013 7:09:07 PM UTC+5:30, srilatha nallapati
wrote:

Hi,

I have my data in couchdb and using couchdb river plugin indexing is done.
The date is stored in gregorian calender milliseconds.

I want to do faceting on that date field. so, my idea is convert it to
unix seconds and store it as date type in mapping.

convertion to unix timestamp can be done by "Gregorian seconds -
62167219200 = Unix seconds".

This is my JSON mapping.

{
"myuser2" : {
"properties" : {

"pvt_created" : {
  "type": "multi_field",
      "fields": {
          "pvt_created": { "type": "string", "index": "not_analyzed", 

"store": "yes" },
"dt_created": { "type": "date", "format":
"date_hour_minute", "index": "no", "store": "yes" }
}

}


  }
}

}

pvt_created is the field with Gregorian seconds. dt_created wanted to be
in unix seconds. How can i do a minus operation at mapping?

Please let me know how I can achieve histogram date faceting on this field.

Thanks,
Srilatha

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