Views blocks/attachments with facet search do not respect search

Created on 26 February 2020, over 4 years ago
Updated 26 June 2024, 4 days ago

Hi there,

I'm trying to build a search API view that lists data in a table, with a map attachment on the top. I've been unable to get the attachment to respect the search results (based on a facet that I am using to search with). For instance, lets say I have content with a field called "state". If I build a list of facets (as a block) and then also have a view, I can successfully get the facet selection to limit the search correctly for the main page. However, if I am trying to put an attachment there to also map the results (or anything, really -- I've even tried just an unsorted list to eliminate maps being a problem), the search does not seem to reflect in this attachment. I've also tried a block on the same page as the view, with similar results.

Is there any way to have an attachment to the view respect a search when someone chooses a facet?

Thanks for the help.

πŸ’¬ Support request
Status

RTBC

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡§πŸ‡·Brazil batalhasamuel

    @john.oltman and @attisan I tested the patch from #16 and it worked partially. If the result exists in both View and Attached View, the facet shows the filter option and filters considering the two parts. But if the filter has an option that only has results for the view, the facet filter option is not shown.
    To add more information I'll give a real example: I have a view with a Live event list, and an Attached View with a Recorded event list.
    If both lists have events in the French language, the filter option French appears and works for both. If the French language is only present in the attached view from the Recorded event list, the filter option is not shown to me because the rule from facet settings that handle the empty filter result behavior is just considering the View, not the Attachment.

    Can someone help me with this? I couldn't go further than this yet.

  • πŸ‡§πŸ‡·Brazil thiagomoraesp

    Same problem as Samuel ( #20 ) here, someone can help?

  • Status changed to RTBC 5 months ago
  • πŸ‡§πŸ‡ͺBelgium StryKaizer Belgium

    concerning #20.

    For building facet items, we need 1 single query to retrieve the possible filter values.
    Since you have different filters in your attachment, that wont technically be possible as these are 2 different queries to retrieve your resultset.

    This is something which facets will probably never support, as it will get complicated very fast if we merge filters from different sources.

    Patch from #16 works fine for my use-case, where the attachment renders the first result in a different layout (and other results have offset 1)

  • πŸ‡§πŸ‡ͺBelgium borisson_ Mechelen, πŸ‡§πŸ‡ͺ

    This looks great, but I think we should probably add a test or it also?

Production build 0.69.0 2024