Skip to content
Home » Questions » how to add date facet in faceted search

how to add date facet in faceted search

Hi.

How can I include DATE RANGE  search criteria in Faceted Search?

(while I was trying, I am getting the following error.

Facet is not supported for DATE or TIMESTAMP columns.)

Thanks,

 

3 Answer(s) on "how to add date facet in faceted search"

  1. You need to get the date column as varchar2 and use the input field instead. For example:

    select ORDER_ID,
    CUSTOMER_ID,
    ORDER_TOTAL,
    to_char(trunc(ORDER_TIMESTAMP), 'mm-dd-yyyy') od,
    USER_NAME,
    TAGS
    from DEMO_ORDERS

    Now for the OD column, use the input field and for the database column property, specify the OD column. Then you would be able to enter a date using the same format specified in the SQL query to filter the result at runtime.

    1. Thank you very much for your quick response, and it works :).

      Unfortunately, I have some more queries.

      I want to put the date range (from_date and to_date as date picker) and filter according to the date range selected.

      (select PROJECT,TASK_NAME,
      to_char(trunc(START_DATE), 'mm-dd-yyyy') od,
      to_char(trunc(END_DATE), 'mm-dd-yyyy') ed
      from EBA_DEMO_IR_PROJECTS)

      So could you please advise me on how I can achieve it, please?

  2. I think to make two facets input fields (the first one with greater than and the second less than). How can I group it and use a date picker or date picker range as an input type? Would you please let me know if there is a more effective method?

    Thank you very much.

Leave a Reply