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

  1. Install the Varbase Content Base recipe.
  2. Go to Structure > Display modes > View modes (/admin/structure/display-modes/view).
  3. 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_index config 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.
Command icon 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

josebc created an issue. See original summary.

josebc’s picture

Assigned: Unassigned » rajab natshah

rajab natshah made their first commit to this issue’s fork.

  • rajab natshah committed 58cc4c16 on 1.0.x authored by josebc
    feat: #3620191 Add the Search index view mode for nodes to the Varbase...
rajab natshah’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.