| @@ -71,11 +71,19 @@ | ||
| 71 | 71 | * @hook ep_default_analyzer_filters |
| 72 | 72 | * @param {array<string>} $filters Default filters |
| 73 | 73 | * @return {array<string>} New filters |
| 74 | 74 | */ |
| 75 | - 'filter' => apply_filters( 'ep_default_analyzer_filters', array( 'ewp_word_delimiter', 'lowercase', 'stop', 'ewp_snowball' ) ), | |
| 76 | - 'char_filter' => array( 'html_strip' ), | |
| 75 | + 'filter' => apply_filters( 'ep_default_analyzer_filters', array( 'lowercase', 'ep_stop', 'ewp_snowball', 'ep_asciifolding' ) ), | |
| 77 | 76 | /** |
| 77 | + * Filter Elasticsearch default analyzer's char_filter | |
| 78 | + * | |
| 79 | + * @since 4.2.2 | |
| 80 | + * @hook ep_default_analyzer_char_filters | |
| 81 | + * @param {array<string>} $char_filters Default filter | |
| 82 | + * @return {array<string>} New filters | |
| 83 | + */ | |
| 84 | + 'char_filter' => apply_filters( 'ep_default_analyzer_char_filters', array( 'html_strip' ) ), | |
| 85 | + /** | |
| 78 | 86 | * Filter Elasticsearch default language in mapping |
| 79 | 87 | * |
| 80 | 88 | * @hook ep_analyzer_language |
| 81 | 89 | * @param {string} $lang Default language |
| @@ -83,8 +91,31 @@ | ||
| 83 | 91 | * @return {string} New language |
| 84 | 92 | */ |
| 85 | 93 | 'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ), |
| 86 | 94 | ), |
| 95 | + 'default_search' => array( | |
| 96 | + 'tokenizer' => 'standard', | |
| 97 | + /** | |
| 98 | + * Filter Elasticsearch default analyzer's filters | |
| 99 | + * | |
| 100 | + * @since 5.0.0 | |
| 101 | + * @hook ep_default_search_analyzer_filters | |
| 102 | + * @param {array<string>} $filters Default filters | |
| 103 | + * @return {array<string>} New filters | |
| 104 | + */ | |
| 105 | + 'filter' => apply_filters( 'ep_default_search_analyzer_filters', array( 'lowercase', 'ep_stop', 'ewp_snowball', 'ep_asciifolding' ) ), | |
| 106 | + /** | |
| 107 | + * Filter Elasticsearch default analyzer's char_filter | |
| 108 | + * | |
| 109 | + * @since 5.0.0 | |
| 110 | + * @hook ep_default_search_analyzer_char_filters | |
| 111 | + * @param {array<string>} $char_filters Default filter | |
| 112 | + * @return {array<string>} New filters | |
| 113 | + */ | |
| 114 | + 'char_filter' => apply_filters( 'ep_default_search_analyzer_char_filters', array( 'html_strip' ) ), | |
| 115 | + /* This filter is documented above */ | |
| 116 | + 'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ), | |
| 117 | + ), | |
| 87 | 118 | 'shingle_analyzer' => array( |
| 88 | 119 | 'type' => 'custom', |
| 89 | 120 | 'tokenizer' => 'standard', |
| 90 | 121 | 'filter' => array( 'lowercase', 'shingle_filter' ), |
| @@ -95,35 +126,33 @@ | ||
| 95 | 126 | 'filter' => array( 'lowercase' ), |
| 96 | 127 | ), |
| 97 | 128 | ), |
| 98 | 129 | 'filter' => array( |
| 99 | - 'shingle_filter' => array( | |
| 130 | + 'shingle_filter' => array( | |
| 100 | 131 | 'type' => 'shingle', |
| 101 | 132 | 'min_shingle_size' => 2, |
| 102 | 133 | 'max_shingle_size' => 5, |
| 103 | 134 | ), |
| 104 | - 'ewp_word_delimiter' => array( | |
| 105 | - 'type' => 'word_delimiter_graph', | |
| 106 | - 'preserve_original' => true, | |
| 107 | - ), | |
| 108 | - 'ewp_snowball' => array( | |
| 135 | + 'ewp_snowball' => array( | |
| 109 | 136 | 'type' => 'snowball', |
| 110 | - /** | |
| 111 | - * Filter Elasticsearch default language in mapping | |
| 112 | - * | |
| 113 | - * @hook ep_analyzer_language | |
| 114 | - * @param {string} $lang Default language | |
| 115 | - * @param {string} $lang_context Language context | |
| 116 | - * @return {string} New language | |
| 117 | - */ | |
| 137 | + /* This filter is documented in includes/mappings/post/7-0.php */ | |
| 118 | 138 | 'language' => apply_filters( 'ep_analyzer_language', 'english', 'filter_ewp_snowball' ), |
| 119 | 139 | ), |
| 120 | - 'edge_ngram' => array( | |
| 121 | - 'side' => 'front', | |
| 140 | + 'edge_ngram' => array( | |
| 122 | 141 | 'max_gram' => 10, |
| 123 | 142 | 'min_gram' => 3, |
| 124 | 143 | 'type' => 'edge_ngram', |
| 125 | 144 | ), |
| 145 | + 'ep_stop' => [ | |
| 146 | + 'type' => 'stop', | |
| 147 | + 'ignore_case' => true, | |
| 148 | + /* This filter is documented in includes/mappings/post/7-0.php */ | |
| 149 | + 'stopwords' => apply_filters( 'ep_analyzer_language', 'english', 'filter_ep_stop' ), | |
| 150 | + ], | |
| 151 | + 'ep_asciifolding' => [ | |
| 152 | + 'type' => 'asciifolding', | |
| 153 | + 'preserve_original' => true, | |
| 154 | + ], | |
| 126 | 155 | ), |
| 127 | 156 | 'normalizer' => array( |
| 128 | 157 | 'lowerasciinormalizer' => array( |
| 129 | 158 | 'type' => 'custom', |
| @@ -433,8 +462,11 @@ | ||
| 433 | 462 | 'ID' => array( |
| 434 | 463 | 'type' => 'long', |
| 435 | 464 | ), |
| 436 | 465 | 'src' => array( |
| 466 | + 'type' => 'text', | |
| 467 | + ), | |
| 468 | + 'srcset' => array( | |
| 437 | 469 | 'type' => 'text', |
| 438 | 470 | ), |
| 439 | 471 | 'width' => array( |
| 440 | 472 | 'type' => 'integer', |