- Status changed to Needs work
almost 2 years ago 1:18pm 23 January 2023 - π¬π§United Kingdom guy_schneerson
The patch did not work for me as is. Looks like I have a similar issue as that of #29. The existence of the aggregations _global data courses the main if condition to be skipped and the count, as a result, is wrong. Removing that part of the condition causes that block to run every time and the counts look correct.
I am using a locally modified patch but I assume it is not the correct solution, I just don't have enough understanding of the issue to figure it out. - π«π·France Renrhaf π Strasbourg π¦π¦
I had to revert the update because of some issues with this patch with the new version. Will try again later and update my comment.
Patch in #42 did not work for me.
Is there any solution for this issue?- Status changed to Needs review
almost 2 years ago 5:19pm 15 March 2023 Patch #44 works for me.
But I am facing issue when there is a exposed filter search text box along with facets. When there is any keyword entered into the search text box of a ajax enabled view, the facet should also filter out accordingly.- Status changed to RTBC
almost 2 years ago 5:21pm 15 March 2023 - heddn Nicaragua
I'm not sure the issue title and description are quite accurate. But this does fix many of the issues I'm seeing w/ using a multi lingual website with multiple facets. The facets counts were "off" and generally elastic search wasn't matching what we had configured using Solr. With the patch, all those issues went away.
This could use an updated IS.
- Status changed to Needs work
about 1 year ago 6:19pm 19 December 2023 - πΊπΈUnited States jlstrecker Athens, Ohio, USA
The latest patch (#44) partly breaks result counts for facets that use the AND operator.
Basic steps to reproduce:
- Set up a search page with a full-text search and one facet (list of links, AND operator).
- Click on one of the facet links.
- Without the patch, the counts on the facet links are updated to reflect that the result set has been narrowed.
- With the patch, the counts on the facet links fail to update.
Tested on a fresh Drupal 10 installation with:
- Elasticsearch Connector 8.x-7.0-alpha4 + patch #44
- Umami installation profile
- Search index of Article content with fields for Title (fulltext) and Tags
- View showing indexed Title field with exposed filter for fulltext search
- Facet for Tags field β List of links, Show the amount of results, Operator=AND
- πͺπΈSpain Carlitus
My problem was:
I have n facets, for example:
Quality
- New (100)
- Medium (300)
- Poor (50)Family
- Item family 1 (500)
- Item family 2 (30)
...I want users to be able to filter on each of the facets with as many facet items as they want, using an OR.
But between the different facets it has to be an AND.
That is, if someone selects Item family 2 and Quality new and Quality Poor it would really be:
(Item family 2) AND (Quality New OR Quality Poor)
This already works this way by default, but it is not reflected in the number of results, so the logic that can be applied to the facets according to the results does not work well. For example hide a facet item if the results are 0. Or hide a facet if it is empty, having all its facet items deactivated.
Without the patch this doesn't work like that, but applying patch #44 it seems to work perfectly. Thanks to everyone who made this possible!
I'm using:
"drupal/search_api":"^1.34",
"drupal/elasticsearch_connector": "7.x-dev@dev",
"drupal/facets": "^2.0", - π¦πΊAustralia tisteegz
Drupal - 10.2.7
Elastic search connector - 8.x-7.0-alpha5Same issue as above, OR amongst checkboxes but then AND between facets which functionally works but the numbers weren't correct. Patch #44 applied and solved the number issue however it now removes the options which will have 0 results which is not the behaviour we are after. We have it set to not remove any options even if they won't narrow down the search, we would rather make them 'inactive' instead of them disappearing.