Search code examples
searchrankingalgolia

Setting custom criteria for date objects in algolia


Currently I am only able to select numerical/boolean attributes for custom criteria. I would want to select a date attribute so that my products which are recently updated gets more priority then older products. How can I do it using Algolia? One way I understand is to convert the date object into timestamp myself while uploading the data and then use the same. Is there any direct way to do this through algolia dashboard.


Solution

  • If you want to order by date, you're right, using a timestamp attribute is the way to go.

    The advantage of using a timestamp is that you could then convert it to any format you want when you'll be using/displaying it, no matter what your language of choice is.