Commit 06b50a73 authored by jonnybradley's avatar jonnybradley

[bp/r65927][FIX] search: Prevent elastic search from failing to index objects...

[bp/r65927][FIX] search: Prevent elastic search from failing to index objects with "at least one immense term" IllegalArgumentException due to the contents (combined) field being used as a sort index, so these are now limited to 1000 bytes in length (also increase the existing sort ignore_above to 1000 and limit the keyword term itself to the maximum 32765 in total for Search_Type_Whole and Search_Type_MultivaluePlain, otherwise nothing gets indexed for that field)
Thanks Victor/kroky6 and marcalporte
parent 84253e56
......@@ -107,11 +107,12 @@ class Search_Elastic_Index implements Search_Index_Interface, Search_Index_Query
return [
"type" => $this->connection->getVersion() >= 5 ? "keyword" : "string",
"index" => $this->connection->getVersion() >= 5 ? true : "not_analyzed",
"ignore_above" => 32765,
"fields" => [
"sort" => $this->connection->getVersion() >= 5 ?
[
"type" => "keyword",
"ignore_above" => 200,
"ignore_above" => 1000,
] : [
"type" => "string",
"analyzer" => "sortable",
......@@ -161,9 +162,8 @@ class Search_Elastic_Index implements Search_Index_Interface, Search_Index_Query
"fields" => [
"sort" => $this->connection->getVersion() >= 5 ?
[
"type" => "text",
"analyzer" => "sortable",
"fielddata" => true,
"type" => "keyword",
"ignore_above" => 1000,
] : [
"type" => "string",
"analyzer" => "sortable",
......
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