Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Old mappings #3704

Merged
merged 4 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions includes/classes/Indexable/Comment/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,7 @@ public function generate_mapping() {

$mapping_file = 'initial.php';

if ( version_compare( $es_version, '5.0', '<' ) ) {
$mapping_file = 'pre-5-0.php';
} elseif ( version_compare( $es_version, '7.0', '>=' ) ) {
if ( version_compare( $es_version, '7.0', '>=' ) ) {
$mapping_file = '7-0.php';
}

Expand Down
14 changes: 1 addition & 13 deletions includes/classes/Indexable/Post/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,7 @@ public function get_mapping_name() {

$mapping_file = '5-2.php';

if ( ! $es_version || version_compare( $es_version, '5.0' ) < 0 ) {
$mapping_file = 'pre-5-0.php';
} elseif ( version_compare( $es_version, '5.0', '>=' ) && version_compare( $es_version, '5.2', '<' ) ) {
if ( version_compare( $es_version, '5.0', '>=' ) && version_compare( $es_version, '5.2', '<' ) ) {
$mapping_file = '5-0.php';
} elseif ( version_compare( $es_version, '5.2', '>=' ) && version_compare( $es_version, '7.0', '<' ) ) {
$mapping_file = '5-2.php';
Expand Down Expand Up @@ -1435,16 +1433,6 @@ protected function determine_mapping_version_based_on_existing( $mapping, $index
return '5-0.php';
}

/**
* Check for pre-5-0 mapping.
* `string` fields were deprecated in ES 5.0 in favor of text/keyword
*
* @see https://www.elastic.co/guide/en/elasticsearch/reference/5.0/release-notes-5.0.0.html
*/
if ( 'string' === $post_title_sortable['type'] ) {
return 'pre-5-0.php';
}

return 'unknown';
}

Expand Down
4 changes: 1 addition & 3 deletions includes/classes/Indexable/Term/Term.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,7 @@ public function generate_mapping() {

$mapping_file = 'initial.php';

if ( version_compare( $es_version, '5.0', '<' ) ) {
$mapping_file = 'pre-5-0.php';
} elseif ( version_compare( $es_version, '7.0', '>=' ) ) {
if ( version_compare( $es_version, '7.0', '>=' ) ) {
$mapping_file = '7-0.php';
}

Expand Down
342 changes: 0 additions & 342 deletions includes/mappings/comment/pre-5-0.php

This file was deleted.

Loading