Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rethink how we approach Date Range Facets #406

Open
DiegoPino opened this issue Jan 24, 2024 · 1 comment
Open

Rethink how we approach Date Range Facets #406

DiegoPino opened this issue Jan 24, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request Facets Safely navigating the too many choices Javascript Favourite language of a PHP developer Search and Discovery Mess around and find out Search API Sub Modules When you need more .info.yml files to keep life organized
Milestone

Comments

@DiegoPino
Copy link
Member

DiegoPino commented Jan 24, 2024

What?

Date range facets are a mess. First we need to actually know the min and max, which also means if we have like 10K different dates, the count must be unlimited to actually get the right values. But also, the way facet/Solr search api is setup requires either an INT (timestamp) for the date to use a native facet.range solr query argument (which is better than what we can do right now) or to write (what I want) our own processor/data type that allows a facet.range to be used with real dates and %YEAR/DATE native solr nomenclature, see https://solr.apache.org/guide/solr/latest/indexing-guide/date-formatting-math.html#date-math

Happens that I found that there is "native" support for actual granularity, but only for numbers. Still very promising bc
https://git.drupalcode.org/project/search_api_solr/-/commit/61bbdb7669ff0ae5a809f1b495da2babc97b5d24

but using the proper config values

https://solarium.readthedocs.io/en/stable/queries/select-query/building-a-select-query/components/facetset-component/facet-range/

Can be used to get native dates, on a e.g Year granularity.. with steps in between (e.g every 10 years) which in turn reduces complete the need of handling 10K results to show all dates ... and we could, if possible have Variable granularity? Like if the current start/end dates are 10 years apart, then the increment can be 1 month ... etc

All this said, this requires a LOT of code... e.g we need to tap into a new "data type" that forces "granularity" to be used via hook_facets_search_api_query_type_mapping_alter()

@alliomeria can we talk about this tomorrow afternoon? Bit tired of dealing with dates tbh

@DiegoPino DiegoPino added enhancement New feature or request Javascript Favourite language of a PHP developer Search and Discovery Mess around and find out Facets Safely navigating the too many choices Search API Sub Modules When you need more .info.yml files to keep life organized labels Jan 24, 2024
@DiegoPino DiegoPino self-assigned this Jan 24, 2024
@DiegoPino DiegoPino added this to the 1.4.0 milestone Jan 24, 2024
@patdunlavey
Copy link
Collaborator

following...

@DiegoPino DiegoPino modified the milestones: 1.4.0, 1.5.0 Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Facets Safely navigating the too many choices Javascript Favourite language of a PHP developer Search and Discovery Mess around and find out Search API Sub Modules When you need more .info.yml files to keep life organized
Projects
None yet
Development

No branches or pull requests

2 participants