Skip to content
Discussion options

You must be logged in to vote

Hey @snakemastr

As @wesleysmyth pointed out, richText and block fields aren't searchable via the list view search bar out of the box since their content is stored as structured JSON — the search bar only does basic string matching against flat text fields.

@wesleysmyth's suggestion for computed searchIndex is on the right track, however using consolidatedBlockEditorText would be a cleaner approach. See below:

Add a hidden computed searchIndex field that extracts plain text from your Lexical content via a beforeChange hook (using consolidatedBlockEditorText from @payloadcms/richtext-lexical) and include it in listSearchableFields — this works but only gives you basic substring matching at …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zubricks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants