search_index isn't an option for content preview

Created on 29 January 2025, 2 months ago

Problem/Motivation

#1510544: Allow to preview content in an actual live environment added the the ability to preview content which is an invaluable tool to both site developers and content creators. In the context of that discussion search_index was concluded to not be part of a "actual live environment" so where excluded from previews. While accurate in the original requirements, not being able to quickly review what content will be indexed makes search development more difficult for developers and excludes a tool that could help content editors be confident the correct content is being indexed.

Steps to reproduce

Preview content with a search_index display mode. Search index is not an available display mode.

Proposed resolution

Allow search index to be select-able as a preview display mode.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.1 🔥

Component

node system

Created by

🇺🇸United States neclimdul Houston, TX

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @neclimdul
  • 🇺🇸United States neclimdul Houston, TX

    Should be a simple fix in the merge request

  • Pipeline finished with Success
    2 months ago
    Total: 2111s
    #410438
  • 🇺🇸United States smustgrave

    Here are some tickets where this appears to have been tweaked/altered

    #2322503: getDisplayModeOptions() returns only full or teaser regardless of the status of the entity display
    Added in #1510544: Allow to preview content in an actual live environment

    From what I can tell search_index was mentioned twice but not really discussed. Personally don't see a reason not, it's 100% front-end view.
    Change also seems small enough that probably doesn't warrant test coverage. Also we never hid search_result so not sure why to hide this one.

    I applied the MR and confirmed search_index now appears.

  • 🇬🇧United Kingdom catch

    Search index isn't a front end view, it's what the search module sees when it indexes content. You could have a 'search result' view mode for use with search_api module or similar but that wouldn't be the same as the one for indexing.

    I don't have a strong opinion on showing it or not, but I think we could use a product or UX review here given that was the original reason for hiding it.

  • 🇧🇪Belgium borisson_ Mechelen, 🇧🇪

    I agree with catch, this is not simply for frontend usage. However it might be useful to help figure out why some entity is not indexed into search api correctly.
    It doesn't look like there's an easy way for search api to reenable this for those purposes?

  • 🇺🇸United States neclimdul Houston, TX

    Yeah I don't disagree with classifying search_index as not strictly a frontend view.

    I think what I was trying to convey in the summary was that while Drupal we called the preview interface "Preview in live environment" in the original issue, but that is in no way conveyed to the site user. To a developer and content editor its just "Preview" so seeing how something will be pushed into a search index can provide a lot of valuable information.

    So limiting the interface to strictly frontend displays doesn't always meet user expectations. At least it didn't meet mine.

  • 🇫🇮Finland lauriii Finland

    I wonder if we could hide this behind "Administer search" permission so that this wouldn't be visible to people who can't actually make changes to search?

  • 🇺🇸United States smustgrave

    I think that's a good compromise

  • 🇧🇪Belgium borisson_ Mechelen, 🇧🇪

    I'm not sure about this. Administer Search is from the core search module. Search API doesn't have that permission, but it does have a Search index view mode as well.

    How would we, as search API maintainers, allow this to work without asking people to enable core search, just to get that permission.

  • 🇺🇸United States smustgrave

    Oh I didn't think about search API...

    Not sure a good middle ground now.

Production build 0.71.5 2024