Only show results with date from now forward

I have an index with a collection of events. I would like to only show events for the current day and forward. Is there a configuration option or some such I could set for that?

There’s multiple ways to pass filters depending on which frontend integration you’re using, but at the end of the day it comes to these steps:

  1. add a timestamp to your index, as number
  2. add a filter to your fronted: start > ${Date.now()}

If you want to do this statically, you can use the Configure widget with filters: `start > ${Date.now()}` . If you want to do this dynamically you can use connectRange or the Range slider, Numeric menu widgets

1 Like

I am using an old version of instasearch v2.8. Having trouble getting to work. Says object not found. Any ideas?

Can you make a reproduction please? Object not found isn’t the error I’d expect here

        instantsearch.widgets.configure({
            analytics: true,
            hitsPerPage: 24,
            facets: ['festivalID'],
            facetsRefinements: {
                festivalID: ["{{entry.id}}"] {# Twig Festival title #}
            },
            filters: 'day > Date.now()'
        })
    );```

Hey! You have to interpolate the value: filters: 'start > ' + Date.now()

1 Like