Closed (duplicate)
Project:
Search API
Version:
7.x-1.x-dev
Component:
Facets
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Oct 2013 at 17:56 UTC
Updated:
31 May 2019 at 14:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
hefox commentedhttp://gyazo.com/ab6beaf84d16de37d8c2ab97f502a3bb
This looks to work
Other than there's another bug that I shall be filling now (http://gyazo.com/7b34d5753a3bff7fdbe41fd73f262a8a)
Comment #2
drunken monkeyThanks for opening this issue and providing a patch!
I tested it, but I don't see any difference after applying the patch. Is your date field maybe multi-valued? That's a whole different can of worms, which can currently not be solved – see #2104623-3: Date facet: granularity option does not show up for multiple date fields.
Regarding the OR issue: Currently, the OR option isn't supported at all for date facets, we should probably have removed it altogether. (Unless we come up with a way to fix it here, we probably should.) And I think that larger changes would be necessary to support it. For one, we'd have to check the hierarchy more carefully, to see whether ranges lower down are actually part of the upper ranges, and then drill down separately for all selections. Several selections in the same hierarchy (e.g., both "2012" and "March 2012") should then of course not be ORed together, but only the most specific one used.
If you'd be able to come up with a patch that solves this, I'd gladly review and commit it! But, as said, the provided one doesn't seem to work for me.
(Note: I marked the other issue as a duplicate, I think they're both about the same problem.)
Comment #3
hefox commentedI re-opened that issue before reading this as these look like separate but related issues to me. The patch works for me; single value field, but using granualrity. Would both 2012 and March 2012 appear at the same time?
Comment #4
drunken monkeyAh, OK, I see now what the patch does, and yes, it really corrects how the filters are applied at least in some cases (two separate ranges). However, the hierarchy is still completely wrong, and as it's unusable in the current state (with #1 applied) I don't think we should split this into two issues, but solve these problems all at once. (Especially, just removing hierarchy altogether, as proposed in #2114465: OR-ed date facet with granulitiry has messed up hierarchy, is certainly no alternative.) I'd certainly not commit this one with the other being ready too, and therefore this only makes testing the patches harder.
Have you tried the facet out with AND, to see how the hierarchy should work? I think we should keep the same style for OR facets, just displaying separate trees for disjoint active facets. Furthermore, as explained above, we'd have to take care to only apply the most specific ranges (i.e., active facets with no active descendants) – with the above patch, selecting "May 2012" after "2012" will have no effect (as the range becomes "2012 OR May 2012").
To illustrate this with an example:
Initial facets:
Click on "2012" -> only results from 2012 are shown. New facets (active ones in bold):
Click on "2013" -> results from 2012 or 2013 are shown. New facets:
Click on "May 2012" -> results from May 2012 or from 2013 are shown. New facets:
Comment #4.0
drunken monkeyforgot ?
Comment #5
acrazyanimal commented@drunken_monkey Curious to know if any work has been done on this or if you are awaiting a contributed patch?
Comment #6
drunken monkeyI'm currently just waiting whether someone wants to contribute a patch. I can't really say when I'd have the time to look into this more closely myself.
However, this should get quite a lot easier if #1888174-11: Offset between stored and indexed date gets committed, so anyone who wants to give this issue a try should probably base their patch on that one (and help me get it committed by verifying that everything still works fine with it).
Comment #7
BarisW commentedIn cases where only a year is displayed, an OR filter would be very useful. For example; listing items in 2017 OR 2016.
The OR operator also enables the option to use the facets as navigational buttons, like here: http://vnconline.nl/actueel
With the AND operator set as default makes that when you select 2017, all other years are removed from the facet.
Comment #8
bohus ulrychFYI Here I've found working solution for me #2290019 Year facet drills down to the remaining year values
Comment #9
ronino commentedThis is indeed a duplicate of #2290019: Year facet drills down to the remaining year values which adds support for the OR operator and already has been committed to dev.