fix: ngram min_gram=1 indexes tokens that can never be matched
Flarum's search UI enforces a minimum query length of 3 characters (MIN_SEARCH_LEN in Search.tsx), so 1- and 2-character ngram tokens are indexed but can never be queried. Changed min_gram from 1 to 3 and updated max_ngram_diff accordingly.
This commit is contained in:
parent
369ee504f3
commit
6699c8cb58
|
|
@ -87,7 +87,7 @@ class BuildCommand extends Command
|
||||||
'index' => $index,
|
'index' => $index,
|
||||||
'body' => [
|
'body' => [
|
||||||
'settings' => [
|
'settings' => [
|
||||||
'index.max_ngram_diff' => 10,
|
'index.max_ngram_diff' => 7,
|
||||||
'analysis' => [
|
'analysis' => [
|
||||||
'analyzer' => [
|
'analyzer' => [
|
||||||
'flarum_analyzer' => [
|
'flarum_analyzer' => [
|
||||||
|
|
@ -105,7 +105,7 @@ class BuildCommand extends Command
|
||||||
'filter' => [
|
'filter' => [
|
||||||
'partial_search_filter' => [
|
'partial_search_filter' => [
|
||||||
'type' => 'ngram',
|
'type' => 'ngram',
|
||||||
'min_gram' => 1,
|
'min_gram' => 3,
|
||||||
'max_gram' => 10,
|
'max_gram' => 10,
|
||||||
'token_chars' => ['letter', 'digit', 'symbol'],
|
'token_chars' => ['letter', 'digit', 'symbol'],
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue