Browse Source

Merge pull request #6115 from weseek/fix/es-set-max_analyzed_offset

fix: Set max_analyzed_offset to elasticsearch querying options
Yuki Takei 3 years ago
parent
commit
789fdf1fbd

+ 1 - 0
packages/app/src/server/service/search-delegator/elasticsearch.ts

@@ -943,6 +943,7 @@ class ElasticsearchDelegator implements SearchDelegator<Data, ESTermsKey, ESQuer
 
 
   appendHighlight(query) {
   appendHighlight(query) {
     query.body.highlight = {
     query.body.highlight = {
+      max_analyzed_offset: 1000000 - 1, // Set the query parameter [max_analyzed_offset] to a value less than index setting [1000000] and this will tolerate long field values by truncating them.
       fields: {
       fields: {
         '*': {
         '*': {
           fragment_size: 40,
           fragment_size: 40,