alleyinteractive / alleyinteractive/searchpress

Render Gutenberg markup before indexing

オープン
#118 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
PHP
スター
85
フォーク
10
PR マージ指標
30日以内にマージされた PR はありません

説明

Currently, SearchPress indexes the raw contents of `post_content`, which historically wasn't much of an issue because the only thing that wasn't indexed was the rendered output of shortcodes. However, now that Gutenberg is becoming utilized more heavily, the fact that Gutenberg markup (comment tags, for example) are stored in the Elasticsearch index is problematic for a few reasons:

1. It bloats the index by adding data that doesn't need to be in there;
2. It interferes with the ability to do highlighting because the highlighting breaks *within* comment tags, which makes them break on render,
3. Any dynamically rendered blocks (that is, blocks that render via PHP rather than saving markup in `post_content`, which is the case for a lot of custom blocks) will not have their actual content saved in the index, and will therefore not be searchable.

I recommend that we run `the_content` against post content before sending it up to the index.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。