I was investigating issues with facets support #2827696: Facets support and I came to a conclusion that the ID used in the annonation (in src/Plugin/search_api/display/ViewsDataDisplay.php) is not correct.

There is an issue with the name of the facet source and the name that facets is expecting in facets_search_api_query_alter()

In "/admin/config/search/facets"

facets.module, facets_search_api_query_alter()

Facets is expecting the name to have "_export" in it.

I guess this come from the annotation that was introduced in #2827696: Facets support

+++ b/src/Plugin/search_api/display/ViewsDataDisplay.php
@@ -0,0 +1,16 @@
+ * @SearchApiDisplay(
+ *   id = "views_data",
+ *   views_display_type = "data_export",
+ *   deriver = "Drupal\search_api\Plugin\search_api\display\ViewsDisplayDeriver"
+ * )

Using id = "views_data_export", as the ID solves the issue for me.

What do you think about ?

Comments

Haza created an issue. See original summary.

haza’s picture

Issue summary: View changes
haza’s picture

Status: Active » Needs review
StatusFileSize
new584 bytes

Patch attached.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

We (or rather, search_api), expect that the id matches the display type. So this patch does solve it.

  • jhedstrom committed 124b526 on 8.x-1.x authored by Haza
    Issue #2846357 by Haza: Facets support, annotation uses a wrong ID name
    
jhedstrom’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! I've committed #3.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.