Hi,
I’m seeing an issue with the “Move to existing topic” modal (this previously worked on my site, so appears to be a regression):
- Typing in Search for a Topic does not refine results
- Network requests return 200 with correct parameters
- No JS errors in the browser console
- Whole-site
/searchworks as expected - The issue has persisted across rebuilds
Example request being made:
/search/query?term=Eve Park&type_filter=topic&search_for_id=true&restrict_to_archetype=regular
The chooser list appears to remain a static set of topics and does not change as the
termchanges.
After client-side debugging, I initially suspected this might be caused by pg_trgm not being enabled in Postgres, but wanted to confirm this before proceeding.
I ran the following commands:
./launcher enter app
rails c
ActiveRecord::Base.connection.execute(
"SELECT extname FROM pg_extension WHERE extname = 'pg_trgm';"
).to_a
This diagnosis would be valid if the command returned:
[]
However, instead it returned:
[{"extname"=>"pg_trgm"}]
So pg_trgm is enabled, and this does not appear to be the root cause.
I therefore intend to run the following command:
./launcher enter app
rake search:reindex
This may be relevant because a particular category of my forum has a very large number of topics.
What’s confusing is that:
- Discourse otherwise continues to function normally
- Full
/searchworks as expected - The topic-move autocomplete silently degrades instead of warning
As part of debugging, I also enabled the search prefer recent posts setting and reloaded the browser. This had no effect on the behaviour - the “Move to existing topic” search still does not refine results as I type.
Since that setting only affects full /search ranking and not the topic chooser endpoint, this seems consistent with the issue being specific to /search/query rather than general search performance.
Before running rake search:reindex, I wanted to sanity-check the reasoning:
The topic-move chooser uses /search/query with search_for_id=true, which relies more directly on indexed lookups than the full /search endpoint. A partially stale or inconsistent search index could therefore affect the chooser while full search still appears to work.
Given that:
- the endpoint is being called,
- responses return 200,
pg_trgmis enabled,- and toggling
search prefer recent postshas no effect,
A full rake search:reindex seems like the next logical step to rule out index inconsistency. Separately, the lack of any warning or feedback makes this particularly confusing from an admin UX perspective.