I don't think that's possible but if it is please let me know how to accomplish it. I want to be able to create a list view for each group. Lets say news list for example. I want to use search api and search api facets for it. This means I have to make views against the already configured index and I have og_group_ref and oa_section_ref included in that index. Now on views I would like to use the same functionality as in normal view where I cant put the space adn section as filters and expose them to panels where I am able to send in "Active space" and "Active section". With search api the field filter handler is not the one that renders group list for you. I tried to simply add the handler to the field in oa_core_views_data_alter like this:
$data['search_api_index_name_here']['og_group_ref']['filter']['handler'] = 'oa_core_og_group_ref_views_handler_filter_in_operator';

but it didn't work out of the box. All i got was "Select all", "Yes" and "No" options in my views. I tried to understand the handler and its logic but it was too much for me to comprehend. Is there an easy fix for this. Maybe someone could show a correct example how to alter the field correctly or extend the "oa_core_og_group_ref_views_handler_filter_in_operator" class so it would work with search api.

Thanks in advance.

Comments

mpotter’s picture

The built-in oa_search module already uses Search API and already supports search facets for Space and Section via the Facets API. This should all work currently "out of the box". When you enter a search term into the top search bar you should see a search results page with the spaces and sections facets (and others) in the right sidebar column.

Martin.’s picture

I dont want to use the space filter as facet. I want to use it as context. I have news list specific to each space and section and want to include tags, date etc facets there. To accomplish this my views should be done against search index, but I dont want to display content not relevant that is not assigned to the section being viewed. I need to be able to prefilter the results in panels by giving it the "active section" as argument.

Martin.’s picture

I was able to solve this problem by adding section as contextual filter and providing it with ad default value from URL. Not ideal but good enough for my purposes. That being said, it would still be nice to be able to control the filter for seach api views from panels pane configuration like it is on normal views.

ChrisZZ’s picture

Dear All,

I just struggled with the same issue. I was able to solve it using %node:nodeid as an argument input for the panels - which worked nicely.

Now I need to get the autocomplete search also to respect the space/section...

regards