Closed (fixed)
Project:
Search API
Version:
7.x-1.x-dev
Component:
Facets
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Oct 2013 at 08:54 UTC
Updated:
6 Mar 2021 at 17:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
drunken monkeyOh, you're right, thanks for reporting! We currently seem to handle multi-valued fields completely wrong in the facet definition code.
The attached patch should fix this, please test!
Comment #2
anrikun commentedThank you!
The option shows up but something else is going wrong :-(
First, I get these items as expected:
But when I click on 2012, I get these:
2013 has gone away and September 2013 is displayed inside 2012!
Comment #3
drunken monkeyWell, that's a different problem, and harder to solve: one part of it is that range filters on multi-valued fields are fundamentally broken in the Search API – see #1783746: Add support for "between" operator. So when you use a date facet on a multi-valued field, it currently cannot possibly work correctly, as long as the field really has multiple values sometimes.
Once that is fixed, we'd probably also have to fix the code in the date facet handler to a) use the new operator and b) sort out field values that are out of range for the currently active filter.
Not sure if we should commit the patch until then. Making the date facet handler available for multi-valued date fields is probably not a good idea as long as it won't work anyways. On the other hand, it works fine for fields that are technically multi-valued but always only have a single value – which is the case sometimes.
Still, probably not. Unless you disagree there, please follow the issue I linked and bump this one as soon as the other is committed, so we won't forget.
Comment #5
drunken monkeyUnless I'm missing something I think this should still be postponed?
Comment #6
legolasboThis issue has not seen activity in over 2,5 years. I am therefore closing this issue to clean up the issue queue. Feel free to re-open and update this issue if you feel this issue is still relevant and of importance.
Comment #7
klausiThis patch is still relevant for us to make date facets work.
Comment #8
anrikun commentedYes, let's bump this for @drunken monkey as #1783746: Add support for "between" operator is now fixed (see #3)
Comment #9
drunken monkeyAh, yes, thanks a lot for bumping!
Can you verify the attached works for you?
Comment #10
drunken monkeyAnyone able/willing to test?
About to create a new release, so would be great to still get that in.
Comment #12
drunken monkeyWell, I’m pretty confident that this at least doesn’t break anything, and also the next release is still a while off, so I’m just committing this now.
Thanks again, everyone!