Skip to content

Commit

Permalink
Merge pull request #3844 from 10up/feature/issue-3816-es-8-modules
Browse files Browse the repository at this point in the history
Acknowledge all default modules as ES plugins
  • Loading branch information
felipeelia authored Feb 28, 2024
2 parents e789e14 + 4b0de0e commit a5f423a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions includes/classes/Elasticsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -1483,18 +1483,22 @@ public function set_elasticsearch_info( $force = false ) {
// Save version of last node. We assume all nodes are same version.
$this->elasticsearch_version = $node['version'];

// Elasticsearch calls "modules" all default plugins that can't be uninstalled
if ( isset( $node['modules'] ) && is_array( $node['modules'] ) ) {
foreach ( $node['modules'] as $plugin ) {
$this->elasticsearch_plugins[ $plugin['name'] ] = $plugin['version'];
}

if ( ! empty( $node['modules'] ) && ! empty( $node['modules'][0]['opensearch_version'] ) ) {
$this->server_type = 'opensearch';
}
}

if ( isset( $node['plugins'] ) && is_array( $node['plugins'] ) ) {
foreach ( $node['plugins'] as $plugin ) {
$this->elasticsearch_plugins[ $plugin['name'] ] = $plugin['version'];
}
}
if ( isset( $node['modules'] )
&& is_array( $node['modules'] )
&& ! empty( $node['modules'] )
&& ! empty( $node['modules'][0]['opensearch_version'] )
) {
$this->server_type = 'opensearch';
}
}

/**
Expand Down

0 comments on commit a5f423a

Please sign in to comment.