Hello all,

I had this year filter with the total of results next to each option (see default.png)
Everytime I selected multiple years, the count of each year would be the total of all results (see active.png), which is wrong! It should keep the default values.

Comments

luispereira1317 created an issue. See original summary.

luispereira1317’s picture

luispereira1317’s picture

drunken monkey’s picture

StatusFileSize
new1.81 KB

Thanks a lot for reporting this!
You’re right, when finally providing basic OR support for date facets, we missed that part. However, while your patch should work in most cases, it doesn’t make sure that active items are always provided as options, even if the underlying search backend doesn’t return them.
I think my patch sould resolve that. Please test/review!

luispereira1317’s picture

StatusFileSize
new42.7 KB
new43.16 KB

I just applied your patch and it's not working properly, at least in my case.
On the default screenshot (default_1.png) you can see the date options and when a date is selected (active_1.png) the exclude items are also being displayed, as you can see the "1970" option. If I select multi options, the filter disappears.

drunken monkey’s picture

Status: Needs review » Postponed (maintainer needs more info)

Can you explain what you mean with “the exclude items”? Is there a result with a date in 1970 (or, more likely, 0/FALSE as the date which gets incorrectly converted to Jan 1 1970)?
Also, do you maybe just have the limit set to 10 items, so that the 1970 is present on the default page, too, but just not part of the first page?

luispereira1317’s picture

Under the page to configure the facet filters there is the option "Exclude specified items" and I added the year 1970. The date field on the node is filled in with the value 1970-01-01.
But there is also the problem of the filter disappearing after selecting, at least, two options.

drunken monkey’s picture

I don’t see that option. Can you tell me exactly where to find it, maybe with a screenshot or two?
Does it work correctly with your patch, and without any patch? (At least when setting to AND operator?)

In any case, I’d suggest for your specific case to fix your underlying data instead of relying on this option. But of course we should still make sure it works, if it is there.

luispereira1317’s picture

StatusFileSize
new21.29 KB
new93.98 KB

Check the two screenshots, the facet_config_click.png to open the configuration and in the facet_config_page.png to check the configuration. As you can see I am excluding the year 1970.
With my patch it works perfectly. I think my case is very specific...

drunken monkey’s picture

That filter doesn’t seem part of the Facet API module. Can you tell me which module it comes from? Is it possible that the bug is just in the filter?

luispereira1317’s picture

So the module is https://www.drupal.org/project/facetapi_bonus
I also think the bug is related with this facetapi_bonus module.

drunken monkey’s picture

Project: Search API » Facet API Bonus
Component: Facets » Code
Status: Postponed (maintainer needs more info) » Active

OK, then let’s see what the maintainers there say.

joseph.olstad’s picture

try the latest dev release, this issue might be fixed in latest release, if this issue still occurs then please provide helpful details.