Time Facet


(Ridvan Gyundogan) #1

Hi, does anyone know how to make a facet only on the time part of a
datetime field?
I was thinking to duplicate the datetime field with only the time
information filled.

Do you know better solution for this?


(Shay Banon) #2

What kind of facet are you after? The date histogram allows to configure
the interval is will work on.

On Mon, Jan 23, 2012 at 5:33 PM, Ridvan Gyundogan ridvansg@gmail.comwrote:

Hi, does anyone know how to make a facet only on the time part of a
datetime field?
I was thinking to duplicate the datetime field with only the time
information filled.

Do you know better solution for this?


(Mark Waddle) #3

Hi Ridvan,

I think your proposed solution is the right one. Use the same date for all
of them, just specify a different time. In your rendering you can ignore
the date.

Mark


(Ridvan Gyundogan) #4

Hi Shay,
my case is the following:
I have Purchases which are created on a certain date and time - the
field is Purchase.creationDate.

Now I want to know for the last year how many of the purchases have
been made in the hours 0-8, 8-16, 16-24, no matter the date.
This is bit different than the date histogram facet which allows me to
count the purchases for example Jan 1 - March 1, June 1 ....

I can still use the date histogram facet if I create a new field
Purchase.creationTime which is of type datetime but the year = 0 ,
month = 0 and day = 1 and the time is the same as in
Purchase.creationDate,
I was wondering is there other solution to this?

On Jan 23, 8:36 pm, Shay Banon kim...@gmail.com wrote:

What kind of facet are you after? The date histogram allows to configure
the interval is will work on.

On Mon, Jan 23, 2012 at 5:33 PM, Ridvan Gyundogan ridva...@gmail.comwrote:

Hi, does anyone know how to make a facet only on the time part of a
datetime field?
I was thinking to duplicate the datetime field with only the time
information filled.

Do you know better solution for this?


(Ridvan Gyundogan) #5

Thanks Mark

On Jan 24, 5:26 am, Mark Waddle m...@markwaddle.com wrote:

Hi Ridvan,

I think your proposed solution is the right one. Use the same date for all
of them, just specify a different time. In your rendering you can ignore
the date.

Mark


(Shay Banon) #6

You have several options:

  1. Still use the creationDate, and use a histogram facet, with a key script
    that does: doc.createDate.data.hourOfDay to get the hour. Note, you will
    need to provide a value_script in this case as well, you can just use a
    script of "1" that simply returns 1 if you don't need anything fancy there.

  2. The previous option comes with the overhead of running a script. If you
    don't want it, index an hour field, and use histogram on that.

  3. Use your purposed solution, basically having creationTime field that has
    the same day.

On Tue, Jan 24, 2012 at 9:42 AM, Ridvan Gyundogan ridvansg@gmail.comwrote:

Hi Shay,
my case is the following:
I have Purchases which are created on a certain date and time - the
field is Purchase.creationDate.

Now I want to know for the last year how many of the purchases have
been made in the hours 0-8, 8-16, 16-24, no matter the date.
This is bit different than the date histogram facet which allows me to
count the purchases for example Jan 1 - March 1, June 1 ....

I can still use the date histogram facet if I create a new field
Purchase.creationTime which is of type datetime but the year = 0 ,
month = 0 and day = 1 and the time is the same as in
Purchase.creationDate,
I was wondering is there other solution to this?

On Jan 23, 8:36 pm, Shay Banon kim...@gmail.com wrote:

What kind of facet are you after? The date histogram allows to configure
the interval is will work on.

On Mon, Jan 23, 2012 at 5:33 PM, Ridvan Gyundogan <ridva...@gmail.com
wrote:

Hi, does anyone know how to make a facet only on the time part of a
datetime field?
I was thinking to duplicate the datetime field with only the time
information filled.

Do you know better solution for this?


(system) #7