The DynamicRangeFilter in Searchkit is a nice and easy solution to e.g. filter years. You would just save a year field in Elasticsearch and use the filter:
<DynamicRangeFilter
field="year"
id="year"
title="Year"
/>
So far I didn't find out how it could be used to filter a multi-value property, e.g. a range of years. Imagine you have a duration property with a start and end:
[
{
"id": 123,
"title": "Foo",
"duration": {
"start": 2013,
"end": 2016
}
},
{
"id": 234,
"title": "Bar",
"duration": {
"start": 2015,
"end": 2015
}
},
{
"id": 345,
"title": "Baz",
"duration": {
"start": 2017,
"end": 2020
}
}
]
Now, the filter should respect the duration and display all items within range. I'm not sure if and how fieldOptions could be used to achieve this.
You can achieve this if you use date filter component for Searchkit like follows:
A calendar-style date filter component for Searchkit
The full example from the part of code above you can find here.
I hope it helps you. Good luck!