Repository navigation
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PopularWordHelperfalls back tosuggest.popular.word.tagsandsuggest.popular.word.excludesonly 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.suggest.popular.word.excludesis no longer returned.