Skip to content

fix(api): apply suggest.popular.word.excludes and .tags to /api/v2/popular-words - #4002

Open
marevol wants to merge 1 commit into
mainfrom
fix/popular-word-excludes-setting
Open

marevol wants to merge 1 commit into
mainfrom
fix/popular-word-excludes-setting

Conversation

@marevol

@marevol marevol commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

PopularWordHelper falls back to suggest.popular.word.tags and suggest.popular.word.excludes only when it is given null, but the v2 handler always passed empty arrays, so neither setting was ever applied to /api/v2/popular-words. The handler now passes null for the excludes (the API has no parameter for them) and, when the request gives no label and there is no virtual host key, for the tags. A label in the request still wins, and with a virtual host key the tags stay that key, as before. The popular word cache key is built from the resolved values, so configured and empty values do not share a cached list. This also happens in 15.9.0.

The same pattern is in the classic API and v1 API plugins; they are not changed here.

Tests

  • PopularWordsHandlerTest, PopularWordHelperTest.
  • Checked against a running build: a word listed in suggest.popular.word.excludes is no longer returned.

…pular-words

PopularWordHelper#getWordList falls back to suggest.popular.word.tags and
suggest.popular.word.excludes only when it is given null, but
PopularWordsHandler always passed an empty array for the excludes and an
empty array for the tags when the request had no label, so neither setting
was ever applied.

The handler now passes null for the excludes (the API has no parameter for
them) and for the tags when the request gives no label and there is no
virtual host key. A label given in the request still wins. The cache key of
PopularWordHelper is built from the resolved values, so a configured value
and an empty one do not share a cached list.
@marevol marevol added this to the 15.10.0 milestone Nov 30, 2026
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.

1 participant