Guide

ElasticPress External Content architecture

Maintainer overview of how external file bodies enter ElasticPress documents.

Modules

ModuleInitialization loads PHP modules under includes/classes/. Two primary modules:

ClassRole
ExternalContentReads meta keys, fetches file contents, appends stored meta for ES, adds search fields
FeatureOn feature posts with prc-platform/feature-loader, writes feature_files JSON meta and opts that key into external-content indexing

Indexing flow

Flow

External content index

4 relationships
File text is stripped of tags; JS reserved words are removed for .js files.

ep_external_content_meta_keys lists which meta keys hold JSON arrays of paths/URLs. Contents are read from the local filesystem when possible, otherwise via wp_remote_get. Filters:

FilterPurpose
ep_external_content_meta_keysDeclare source meta keys
ep_external_content_stored_meta_keyOverride stored meta key name (default ep_external_content_{key})
ep_external_content_file_contentTransform file body before storage

Feature files

For feature posts, Feature::set_post_meta parses prc-platform/feature-loader blocks, collects JS asset URLs and data attachment URLs, and stores them on feature_files. That key is allow-listed for VIP Search meta and registered via ep_external_content_meta_keys.

Bootstrap

Entry file prc-ep-external-content.php loads helpers and includes/core.php. When PRC_PLATFORM is defined, the monorepo root autoloader is used; otherwise the plugin vendor Jetpack Autoloader may load.

Was this helpful?