Problem/Motivation
Search integrations (Search API and other search-index rendering) currently have no dedicated node view mode to control indexed output. Indexing typically falls back to the Full content view mode, which pulls in elements not meant for search-index consumption (metadata, related content, calls to action, etc.) instead of a lean, dedicated view for search.
Steps to reproduce
- Install the Varbase Content Base recipe.
- Go to Structure > Display modes > View modes (
/admin/structure/display-modes/view). - Notice there is no "Search index" view mode available for the Node entity type to control search-indexed output separately from Full/Teaser.
Proposed resolution
Add config/core.entity_view_mode.node.search_index.yml to the recipe, providing a new "Search index" view mode (node.search_index) for the Node entity type:
langcode: en status: false dependencies: module: - node id: node.search_index label: 'Search index' description: '' targetEntityType: node cache: true
Drupal recipes auto-import every YAML file placed under the recipe's config/ directory, so no change to recipe.yml is required — this file alone is the change.
The view mode ships disabled (status: false), which is the standard Drupal pattern for a view mode: it only becomes active for a given content type once a core.entity_view_display.node.<bundle>.search_index display is created for that bundle. This is additive and non-breaking — nothing changes on an existing site until a bundle explicitly opts in.
search_index is not currently referenced anywhere else in the repository (recipe.yml, other config, tests). This issue only ships the view mode; wiring it into an actual search index (e.g. via Search API) is out of scope / a follow-up.
Remaining tasks
- ✅ File an issue about this project
- ❌ Addition/Change/Update/Fix to this project
- ❌ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ➖ UX/UI designer responsibilities
- ➖ Accessibility and Readability
- ❌ Reviewed by a human
- ❌ Code review by maintainers
- ❌ Full testing and approval
- ❌ Credit contributors
- ❌ Review with the product owner
- ❌ Update Release Notes
- ❌ Release
User interface changes
- A new "Search index" view mode appears at
/admin/structure/display-modes/view(disabled by default, until a bundle-specific display is configured for it).
API changes
- N/A
Data model changes
- New
core.entity_view_mode.node.search_indexconfig entity: a disabled-by-default "Search index" view mode for the Node entity type.
Release notes snippet
- Adds a disabled-by-default "Search index" view mode for nodes (
node.search_index), so search integrations can control indexed output separately from Full/Teaser.
Issue fork varbase_content_base-3620191
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
josebc commentedComment #6
rajab natshah