Skip to content

support search indexing and searching for multi-instance fields - #13991

Merged
brandonkelly merged 8 commits into
6.xfrom
bugfix/13987-searching-and-indexing-for-multi-instance-fields
Oct 3, 2026
Merged

brandonkelly merged 8 commits into
6.xfrom
bugfix/13987-searching-and-indexing-for-multi-instance-fields

Conversation

@i-just

@i-just i-just commented Dec 5, 2023

Copy link
Copy Markdown
Contributor

Description

We can no longer rely solely on the one-to-one relationship between the field handle and fieldId.

  • Added a migration that adds the layoutElementUid column to the searchindex table.
  • Updated primary key to factor in that new column.
  • Updated the indexing logic to store the layoutElementUid.
  • Updated the search logic to rely primarily on the layoutElementUid and fall back on the fieldId.

Upgrade impact:
When updating from c4 to c5, after all migrations are run, a resave command with update search index param should be run for all element types that have custom field layouts (e.g. craft resave/entries --update-search-index=1, craft resave/addresses --update-search-index=1 etc.). This is so that layoutElementId is populated in the searchindex table. This is needed to support the indexing and searching through the multi-instance fields.

Related issues

#13987

@i-just
i-just requested a review from brandonkelly December 5, 2023 11:41
@i-just
i-just marked this pull request as draft December 5, 2023 11:56
@i-just
i-just marked this pull request as ready for review December 6, 2023 08:51
@i-just
i-just marked this pull request as draft December 6, 2023 09:35
@i-just
i-just marked this pull request as ready for review December 6, 2023 09:58
…-instance-fields

# Conflicts:
#	src/config/app.php
brandonkelly added a commit that referenced this pull request Dec 27, 2023
Still may want to do #13991 though
@brandonkelly
brandonkelly changed the base branch from 5.0 to 5.x March 26, 2024 17:52
@linear-code

linear-code Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

CMS-1290

@brandonkelly
brandonkelly changed the base branch from 5.x to 6.x October 2, 2026 23:26
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/ui — open Storybook

No changed components detected in this Storybook.

resources/js — open Storybook

No changed components detected in this Storybook.

@brandonkelly
brandonkelly merged commit f4a7085 into 6.x Oct 3, 2026
20 checks passed
@brandonkelly
brandonkelly deleted the bugfix/13987-searching-and-indexing-for-multi-instance-fields branch October 3, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants