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

Add default_search analyzer for terms and comments #3703

Merged
merged 2 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 15 additions & 9 deletions includes/mappings/comment/7-0.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,20 @@
'analyzer' => [
'default' => [
'tokenizer' => 'standard',
'filter' => [ 'ewp_word_delimiter', 'lowercase', 'ep_stop', 'ewp_snowball' ],
/* This filter is documented in includes/mappings/post/7-0.php */
'filter' => apply_filters( 'ep_default_analyzer_filters', [ 'lowercase', 'ep_stop', 'ewp_snowball' ] ),
/* This filter is documented in includes/mappings/post/7-0.php */
'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
],
'default_search' => [
'tokenizer' => 'standard',
/* This filter is documented in includes/mappings/post/7-0.php */
'filter' => apply_filters( 'ep_default_search_analyzer_filters', [ 'lowercase', 'ep_stop', 'ewp_snowball' ] ),
/* This filter is documented in includes/mappings/post/7-0.php */
'char_filter' => apply_filters( 'ep_default_search_analyzer_char_filters', [ 'html_strip' ] ),
/* This filter is documented above */
'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
],
'shingle_analyzer' => [
'type' => 'custom',
'tokenizer' => 'standard',
Expand All @@ -80,27 +90,23 @@
],
],
'filter' => [
'shingle_filter' => [
'shingle_filter' => [
'type' => 'shingle',
'min_shingle_size' => 2,
'max_shingle_size' => 5,
],
'ewp_word_delimiter' => [
'type' => 'word_delimiter_graph',
'preserve_original' => true,
],
'ewp_snowball' => [
'ewp_snowball' => [
'type' => 'snowball',
/* This filter is documented in includes/mappings/post/7-0.php */
'language' => apply_filters( 'ep_analyzer_language', 'english', 'filter_ewp_snowball' ),
],
'edge_ngram' => [
'edge_ngram' => [
'side' => 'front',
'max_gram' => 10,
'min_gram' => 3,
'type' => 'edge_ngram',
],
'ep_stop' => [
'ep_stop' => [
'type' => 'stop',
'ignore_case' => true,
/* This filter is documented in includes/mappings/post/7-0.php */
Expand Down
12 changes: 11 additions & 1 deletion includes/mappings/comment/initial.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,20 @@
'analyzer' => [
'default' => [
'tokenizer' => 'standard',
'filter' => [ 'standard', 'ewp_word_delimiter', 'lowercase', 'ep_stop', 'ewp_snowball' ],
/* This filter is documented in includes/mappings/post/7-0.php */
'filter' => apply_filters( 'ep_default_analyzer_filters', [ 'standard', 'ewp_word_delimiter', 'lowercase', 'ep_stop', 'ewp_snowball' ] ),
/* This filter is documented in includes/mappings/post/7-0.php */
'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
],
'default_search' => [
'tokenizer' => 'standard',
/* This filter is documented in includes/mappings/post/7-0.php */
'filter' => apply_filters( 'ep_default_search_analyzer_filters', [ 'lowercase', 'ep_stop', 'ewp_snowball' ] ),
/* This filter is documented in includes/mappings/post/7-0.php */
'char_filter' => apply_filters( 'ep_default_search_analyzer_char_filters', [ 'html_strip' ] ),
/* This filter is documented above */
'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
],
'shingle_analyzer' => [
'type' => 'custom',
'tokenizer' => 'standard',
Expand Down
24 changes: 15 additions & 9 deletions includes/mappings/term/7-0.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,20 @@
'analyzer' => [
'default' => [
'tokenizer' => 'standard',
'filter' => [ 'ewp_word_delimiter', 'lowercase', 'ep_stop', 'ewp_snowball' ],
/* This filter is documented in includes/mappings/post/7-0.php */
'filter' => apply_filters( 'ep_default_analyzer_filters', [ 'lowercase', 'ep_stop', 'ewp_snowball' ] ),
/* This filter is documented in includes/mappings/post/7-0.php */
'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
],
'default_search' => [
'tokenizer' => 'standard',
/* This filter is documented in includes/mappings/post/7-0.php */
'filter' => apply_filters( 'ep_default_search_analyzer_filters', [ 'lowercase', 'ep_stop', 'ewp_snowball' ] ),
/* This filter is documented in includes/mappings/post/7-0.php */
'char_filter' => apply_filters( 'ep_default_search_analyzer_char_filters', [ 'html_strip' ] ),
/* This filter is documented above */
'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
],
'shingle_analyzer' => [
'type' => 'custom',
'tokenizer' => 'standard',
Expand All @@ -44,27 +54,23 @@
],
],
'filter' => [
'shingle_filter' => [
'shingle_filter' => [
'type' => 'shingle',
'min_shingle_size' => 2,
'max_shingle_size' => 5,
],
'ewp_word_delimiter' => [
'type' => 'word_delimiter_graph',
'preserve_original' => true,
],
'ewp_snowball' => [
'ewp_snowball' => [
'type' => 'snowball',
/* This filter is documented in includes/mappings/post/7-0.php */
'language' => apply_filters( 'ep_analyzer_language', 'english', 'filter_ewp_snowball' ),
],
'edge_ngram' => [
'edge_ngram' => [
'side' => 'front',
'max_gram' => 10,
'min_gram' => 3,
'type' => 'edge_ngram',
],
'ep_stop' => [
'ep_stop' => [
'type' => 'stop',
'ignore_case' => true,
/* This filter is documented in includes/mappings/post/7-0.php */
Expand Down
12 changes: 11 additions & 1 deletion includes/mappings/term/initial.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,19 @@
'analyzer' => [
'default' => [
'tokenizer' => 'standard',
'filter' => [ 'standard', 'ewp_word_delimiter', 'lowercase', 'ep_stop', 'ewp_snowball' ],
/* This filter is documented in includes/mappings/post/7-0.php */
'filter' => apply_filters( 'ep_default_analyzer_filters', [ 'standard', 'ewp_word_delimiter', 'lowercase', 'ep_stop', 'ewp_snowball' ] ),
'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
],
'default_search' => [
'tokenizer' => 'standard',
/* This filter is documented in includes/mappings/post/7-0.php */
'filter' => apply_filters( 'ep_default_search_analyzer_filters', [ 'lowercase', 'ep_stop', 'ewp_snowball' ] ),
/* This filter is documented in includes/mappings/post/7-0.php */
'char_filter' => apply_filters( 'ep_default_search_analyzer_char_filters', [ 'html_strip' ] ),
/* This filter is documented above */
'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
],
'shingle_analyzer' => [
'type' => 'custom',
'tokenizer' => 'standard',
Expand Down