Skip to content

Content Search result customizability #395

Open

Description

@cr0ybot

I work on a news publisher site with loads of content. We used to be able to customize the ContentSearch component's query and renderItemType in order to extract additional necessary information for content editors, particularly the publish date of a post. We did this by:

  1. Using the queryFilter prop and adding the _links and _embedded fields (_embed=true is already added by the component but without these other fields nothing is actually embedded)
  2. Utilizing the _embedded property passed to renderItemType to customize the results items to display the post date

After this normalizeResults line was added, it is now impossible to reference any properties of the response items other than id, subtype, title, type, and url, which makes renderItemType almost completely useless for our purposes.

I'm not sure what the correct answer is here, but I would love to at least be able to include the _embedded property as part of the normalized results type since that is a standard part of the search endpoint schema. It would be a nice bonus to be able to make use of custom fields added to the search results schema, but that would probably be harder to account for.

Activity

  1. cr0ybot commented on Sep 15, 2025

    @cr0ybot
    Author

    Looks like #373 was meant to address this kind of problem but the effort stalled due to the implementation method. I think we already have (or had) enough ways to alter the query and results item render, the normalized results just needs to be tweaked. I might open a PR here in a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions