Skip to content

Conversation

@burhandodhy
Copy link
Contributor

@burhandodhy burhandodhy commented Jan 14, 2026

Description of the Change

This PR ensures that the sync creates the search template across the network when the plugin is network-wide. It also adds support for the network-wide flag for put-search-template command.

Additionally, we don’t need to set the index property during the constructor because if we run epio_save_site_search_template, the index property still holds the old value, which can cause incorrect endpoints.

Closes #4227

How to test the Change

  1. Enable the ElasticPress network-wide.
  2. Enable the Instant Results.
  3. Create a new site.
  4. Run Sync and ensure that Instant Results works find on newly created site.

Changelog Entry

Fixed - Ensure the Sync creates the Instant Resutls templates for all the sites

Credits

Props @burhandodhy @anjulahettige

Checklist:

Copy link
Member

@felipeelia felipeelia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few questions for you on this one @burhandodhy

Comment on lines +1542 to +1546
* ## OPTIONS
*
* [--network-wide]
* : Delete the template for all sites in the network if plugin is network activated. Otherwise, delete the template for the current site only.
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this also affect the method code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was my mistake; I have added the code.

$sites = Utils\get_sites( 0, true );
foreach ( $sites as $site ) {
switch_to_blog( $site['blog_id'] );
$this->index = Indexables::factory()->get( 'post' )->get_index_name();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn’t be there. I added that before making this change

@felipeelia felipeelia added this to the 5.3.3 milestone Jan 19, 2026
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.

Instant Results fail on multisite subsites due to missing search template

2 participants