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

how to add date facet in faceted search


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



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,
    to_char(trunc(ORDER_TIMESTAMP), 'mm-dd-yyyy') od,
    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

      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