Retrieve new records by date range

Hi,
I want to retrieve how many new records was indexed for a specific index by a date range. Is there a way to do this?.

The time of indexing is not available in the record but you can add this info.

When indexing your data, you can add the current timestamp in a updated_at attribute for instance, then when querying you can filter on this attribute (where xxxx and yyyy are timestamps:

index.search({
  filters: 'updated_at: xxxx TO yyyy'
});

You can find the related documentation here: https://www.algolia.com/doc/guides/searching/filtering/?language=php#advanced-filtering

Please let me know if that would work for you.

It is what i need, thanks! @julienbourdeau

1 Like