Theme Directory: Searching within the Commercial/Community views returns no results#732
Open
obenland wants to merge 1 commit into
Open
Conversation
…ity views The theme_business_model taxonomy is absent from the site's Elasticsearch index, so the term filter Jetpack Search builds from the tax query excludes every document and searches like browse/commercial/?s=shop return no results. Opting these queries out via jetpack_search_should_handle_query lets them use the SQL search path, which already handles the tax query correctly, until the taxonomy is indexed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011pfhLmrkpmrMsMMwrZEKJV
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
See #8376.
Problem
https://wordpress.org/themes/browse/commercial/?s=shopreturns zero results, whilebrowse/commercial/alone works fine (same forbrowse/community/). Thetheme_business_modeltaxonomy is absent from the site's Elasticsearch index — no documents carrytaxonomy.theme_business_model.slug— so the term filter Jetpack Search builds from the tax query excludes every document.The taxonomy is missing because WP.com's indexing pipeline strips any taxonomy not in the
Jetpack_Sync_Module_Search::taxonomiesallowlist at document build time. Theplugin_*taxonomies are in that list (which is how Plugin Directory search works);theme_business_modelis not.Temporary fix
Filter
jetpack_search_should_handle_queryto returnfalsefor searches carrying atheme_business_modeltax query, so they fall back to the SQL search path, which already applies the tax filter correctly. The Photo Directory uses the same filter to opt out of Jetpack Search.This is a workaround: the proper fix is adding
theme_business_modelto the WP.com-side taxonomy allowlist and bulk-reindexing the themes site, after which this filter should be reverted so these searches get ES relevance again.Verification
After sandboxing/deploy:
browse/commercial/?s=shopandbrowse/community/?s=newsreturn results./themes/search/shop/still uses Jetpack Search (unchanged counts).🤖 Generated with Claude Code
https://claude.ai/code/session_011pfhLmrkpmrMsMMwrZEKJV