Search API: Paragraph IDs and Cross-Domain Search Issues

Created on 13 December 2024, 9 days ago

Problem/Motivation

When using Paragraphs, Domain, and Search API together, a search view is configured to query nodes across all domains, displaying them even if the current domain does not match. This works correctly for displaying results.

However, two issues arise:

  • When performing a search that uses an excerpt, everything functions correctly except when a node does not belong to the current domain. In this case, paragraphs are displayed as IDs (e.g.,123..124..125..126) instead of their text or formatted content.
  • If a search query includes a term that exists in a paragraph attached to a node from another domain, the result is not returned at all. This prevents the search from functioning across all domains as expected.

Steps to reproduce

  • Install and configure the Paragraphs, Domain, and Search API modules.
    • Ensure that Domain is set up to manage content visibility across multiple domains.
    • Configure Paragraphs to be used as fields in nodes.
    • Set up Search API to index nodes and their paragraph content.
  • Create nodes with paragraph fields.
    • Assign some nodes to different domains using the Domain module.
    • Populate the paragraph fields with text content for testing.
  • Configure a Search API view:
    • Ensure the view is set up to query all indexed nodes, regardless of their domain.
    • Add an excerpt field to display search context in the results.
  • Perform the following searches from a specific domain:
    • Search for a term that matches the content of a paragraph in a node from a different domain.
    • Observe whether the node appears in the search results.
    • Check the excerpt field for nodes from other domains: other fields display correctly, but paragraph fields are shown as IDs.

Proposed resolution

  • Modify the Search API integration to ensure that paragraphs render their content in the excerpt field, even when the node belongs to a different domain.
  • Adjust the indexing or querying logic to ensure that paragraph content is indexed and searchable across domains.
  • Extend normalization plugins to better handle paragraphs in the search context.
  • Document the required configuration or implement an option to handle these edge cases effectively.

Remaining tasks

🐛 Bug report
Status

Active

Version

1.37

Component

General code

Created by

🇧🇪Belgium hezounay

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

Comments & Activities

Production build 0.71.5 2024