'no such index', 'solution' => sprintf( /* translators: Sync Page URL */ __( 'It seems one of the indices is missing. Delete all data and sync to fix the issue.', 'elasticpress' ), $sync_url ), ]; } if ( preg_match( '/no such index \[(.*?)\]/', $error, $matches ) ) { return [ 'error' => 'no such index [???]', 'solution' => sprintf( /* translators: 1. Index name; 2. Sync Page URL */ __( 'It seems the %1$s index is missing. Delete all data and sync to fix the issue.', 'elasticpress' ), '' . $matches[1] . '', $sync_url ), ]; } if ( preg_match( '/No mapping found for \[(.*?)\] in order to sort on/', $error, $matches ) ) { return [ 'error' => 'No mapping found for [???] in order to sort on', 'solution' => sprintf( /* translators: 1. Index name; 2. Sync Page URL */ __( 'The field %1$s was not found. Make sure it is added to the list of indexed fields and run a new sync to fix the issue.', 'elasticpress' ), '' . $matches[1] . '', $sync_url ), ]; } /* translators: 1. Field name; 2. Sync Page URL */ $field_type_solution = __( 'It seems you saved a post without doing a full sync first because %1$s is missing the correct mapping type. Delete all data and sync to fix the issue.', 'elasticpress' ); if ( preg_match( '/Fielddata is disabled on text fields by default. Set fielddata=true on \[(.*?)\]/', $error, $matches ) ) { return [ 'error' => 'Fielddata is disabled on text fields by default. Set fielddata=true on [???]', 'solution' => sprintf( $field_type_solution, $matches[1], $sync_url ), ]; } if ( preg_match( '/field \[(.*?)\] is of type \[(.*?)\], but only numeric types are supported./', $error, $matches ) ) { return [ 'error' => 'field [???] is of type [???], but only numeric types are supported.', 'solution' => sprintf( $field_type_solution, $matches[1], $sync_url ), ]; } if ( preg_match( '/Alternatively, set fielddata=true on \[(.*?)\] in order to load field data by uninverting the inverted index./', $error, $matches ) ) { return [ 'error' => 'Alternatively, set fielddata=true on [???] in order to load field data by uninverting the inverted index.', 'solution' => sprintf( $field_type_solution, $matches[1], $sync_url ), ]; } if ( preg_match( '/Limit of total fields \[(.*?)\]( in index \[(.*?)\])? has been exceeded/', $error, $matches ) ) { return [ 'error' => 'Limit of total fields [???] in index [???] has been exceeded', 'solution' => sprintf( /* translators: Elasticsearch or ElasticPress.io; 2. Link to article; 3. Link to article */ __( 'Your website content has more public custom fields than %1$s is able to store. Check our articles about Elasticsearch field limitations and how to index just the custom fields you need and sync again.', 'elasticpress' ), Utils\is_epio() ? __( 'ElasticPress.io', 'elasticpress' ) : __( 'Elasticsearch', 'elasticpress' ), 'https://elasticpress.zendesk.com/hc/en-us/articles/360051401212-I-get-the-error-Limit-of-total-fields-in-index-has-been-exceeded-', 'https://elasticpress.zendesk.com/hc/en-us/articles/360052019111' ), ]; } if ( Utils\is_epio() ) { return [ 'error' => $error, 'solution' => sprintf( /* translators: ElasticPress.io My Account URL */ __( 'We did not recognize this error. Please open an ElasticPress.io support ticket so we can troubleshoot further.', 'elasticpress' ), 'https://www.elasticpress.io/my-account/' ), ]; } return [ 'error' => $error, 'solution' => sprintf( /* translators: New GitHub issue URL */ __( 'We did not recognize this error. Please consider opening a GitHub Issue so we can add it to our list of supported errors.', 'elasticpress' ), 'https://github.com/10up/ElasticPress/issues/new/choose' ), ]; } }