Skip to content

Make results searcheable#15881

Merged
greenwoodt merged 3 commits intodevelopfrom
feature/searchable-results
Jan 15, 2026
Merged

Make results searcheable#15881
greenwoodt merged 3 commits intodevelopfrom
feature/searchable-results

Conversation

@alecslupu
Copy link
Copy Markdown
Contributor

🎩 What? Why?

While working on #15834 i have noticed that the Accountability component registers the result resource, which states that the result should not be searchable. Browsing the Result model, i have seen it includes Decidim::Searchable concern which created a contradiction.
Asking the @decidim/product about the behavior, they confirmed that results should be filterable. This PR does just that.

Testing

  1. As an user visit the search page.
  2. See there is no Result option in the left menu
  3. See that you cannot search for any results
  4. Apply the patch
  5. Restart your server. Wait for queues to run
  6. Refresh the Search page
  7. See that you have Results entries and you can filter / search through it

📷 Screenshots

Nightly without feature

image

Dev - having the feature

image

♥️ Thank you!

github-actions[bot]
github-actions bot previously approved these changes Jan 13, 2026
@alecslupu alecslupu marked this pull request as ready for review January 13, 2026 13:17
Copilot AI review requested due to automatic review settings January 13, 2026 13:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request makes accountability results searchable by changing the resource configuration from searchable = false to searchable = true and adding publish/unpublish hooks to manage search indexes. It also includes a data migration to reindex existing results.

Changes:

  • Enables search functionality for accountability results by setting the resource as searchable
  • Adds component lifecycle hooks to update/remove search indexes when components are published/unpublished
  • Includes a data migration to reindex all existing accountability results

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
decidim-accountability/lib/decidim/accountability/component.rb Adds publish/unpublish hooks for search indexing and changes searchable flag to true
decidim-accountability/db/data/20260113140600_reindex_results.rb Data migration to reindex existing results by triggering publish hooks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

github-actions[bot]
github-actions bot previously approved these changes Jan 13, 2026
@alecslupu alecslupu requested a review from a team January 14, 2026 00:15
@greenwoodt
Copy link
Copy Markdown
Member

Wouldn't this make the PR a fix if it is the incorrect behaviour @alecslupu?

Copy link
Copy Markdown
Member

@greenwoodt greenwoodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with the implementation.

I guess this is one of those PR's where its a fine line between a fix or a feature to an issue. On a second glance I am gravitating towards more of a feature than a bug.

Created a failing test with the changes in decidim-accountability/spec/lib/decidim/accountability/component_spec.rb and works fantastic.

LGTM

@greenwoodt greenwoodt merged commit 71ea61d into develop Jan 15, 2026
28 checks passed
@greenwoodt greenwoodt deleted the feature/searchable-results branch January 15, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants