Hello everyone.
Upgrading from search_api 1.18 to 1.19 breaks facet-filters with "date range". The problem also exists in search_api 1.20.
I have date fields (ISO format) indexed as date in my search_api index.
I use Acquia Solr as server. Problem also exists when I use "database" as server (search_api_db).
Bug
After upgrading to search_api 7.x-1.19 and 7.x-1.20, facet-filters return "empty facet behavior" when I use "date range" as widget and query type.
When I downgrade to search_api 1.18, "date range" works fine again.
Facet-filter widget "links" with query type "date" is not broken in search_api 7.19 and 7.20.
Temporary Solution
Downgrade from search_api 1.20 to 1.18 in order to get "date range" to work.
Can anyone else please confirm this bug?
Thank you. Cheers :)
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | search-api-date-facetapi-regex-2780341-5.patch | 835 bytes | berdir |
Comments
Comment #2
gromani14 commentedHi eevensen, i have the same issue.. what i can see is that the regular expresion used to parse date is not working, I've changed by the expression defined into SearchApi and works.. i'm not sure if this is a final solution.. but maybe can help.
Comment #3
drunken monkeyWhere is the "date range" widget defined?
PS: It seems you (like many others – it's really easy to misinterpret) are confused by the "Issue tags" field. As the guidelines state, they aren't meant for free text tags related to the issue, but only for specific categorization purposes, usually by module maintainers.
So, if you aren't sure your current usage is correct, please just leave the field empty.
Comment #4
berdirLooks like we are seeing this as well. This is coming through facetapi/facetapi_pretty_paths with a url that looks ike this:
/kurse/Start/[2017-04-14%20TO%202017-04-16]
What still works is just specifying the date.
/kurse/Start/2017-04-14
That this breaks between 1.18 and 1.19 helps, looking into whether I can find the exact issue now.
Comment #5
berdir#2709719: Custom date range filter in [start TO end] format does not work is related and was closed.
Not sure why in your example this was still working in 7.x-1.18, but I tracked this down to #2665586: Notice: A non well formed numeric value encountered in SearchApiFacetapiDate->createRangeFilter(). There, a regex was introduced for the filter value, and it is a) broken (missing escape of ]) and doesn't match on [date TO date].
This fixes this for me, but it might not be the complete/right fix, as I assume the splitting/logic below is also not working as it should, this is just working around it by returning early.
Obviously solr specific then but I can live with that.
Comment #6
drunken monkeyThanks a lot for looking into this, seems your analysis is spot-on! It's indeed just a bad regex, otherwise this seems to work fine. And it's only Solr-specific if you use Solr's date format (or another kind of date string) – if you use UNIX timestamps, this should also work fine with all other backends, as far as I can see.
So: committed.
Thanks again!
Comment #8
berdird.o doesn't want this to be fixed ;)