Commit 043c17b3 authored by kroky6's avatar kroky6

[bp/r65983] [FIX] ElasticSearch use sortable normalizer with lowercase and...

[bp/r65983] [FIX] ElasticSearch use sortable normalizer with lowercase and ascriifolding filters on new keyword .sort field, fix tests and match initial on whole field content rather than the sortable keyword
parent 97656bd4
......@@ -164,6 +164,7 @@ class Search_Elastic_Index implements Search_Index_Interface, Search_Index_Query
[
"type" => "keyword",
"ignore_above" => 1000,
"normalizer" => "sortable",
] : [
"type" => "string",
"analyzer" => "sortable",
......@@ -210,6 +211,13 @@ class Search_Elastic_Index implements Search_Index_Interface, Search_Index_Query
'filter' => ['lowercase', 'asciifolding'],
],
],
'normalizer' => [
'sortable' => [
'type' => 'custom',
'char_filter' => [],
'filter' => ['lowercase', 'asciifolding']
],
],
'filter' => [
'tiki_stop' => [
'type' => 'stop',
......
......@@ -138,7 +138,7 @@ class Search_Elastic_QueryBuilder
} elseif ($node instanceof Initial) {
return [
'match_phrase_prefix' => [
$this->getNodeField($node) . '.sort' => [
$this->getNodeField($node) => [
"query" => $this->getTerm($node),
"boost" => $node->getWeight(),
],
......
......@@ -255,7 +255,7 @@ class Search_Elastic_QueryBuilderTest extends PHPUnit_Framework_TestCase
$this->assertEquals(
[
"match_phrase_prefix" => [
"title.sort" => [
"title" => [
"query" => "hello",
"boost" => 1.5,
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment