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

http 500 on NC and 400 Bad Request to Elasticsearch when exceeding index.highlight.max_analyzed_offset #324

Open
cue108 opened this issue Sep 30, 2023 · 1 comment

Comments

@cue108
Copy link
Contributor

cue108 commented Sep 30, 2023

Error logging:

{\"type\":\"illegal_argument_exception\",\"reason\":\"The length [2049605] of field [content] in doc[724]\/index[nc_fulltextsearch] exceeds the [index.highlight.max_analyzed_offset] limit [1000000]. To avoid this error, 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.\"}}},\"status\":400}"}

There are two ways to handle this:

  1. On the connector side, hence "fulltextsearch_elasticsearch" a simple
    determine the max content size:
GET yourindexname/_search
{
  "size": 0,
  "aggs": {
    "max_content_length": {
      "max": {
        "field": "attachment.content_length"
      }
    }
  }
}

and increase the max_analyzed_offset accordingly:

PUT indexname/_settings
{
"index" : {
    "highlight.max_analyzed_offset" : 3000000
  }
}

Will mitigate this error already

  1. On the Elasticsearch side an index template will do:
PUT /_index_template/indexname
{
  "index_patterns" : ["indexname"],
  "priority" : 1,
  "template": {
    "settings" : {
      "highlight.max_analyzed_offset" : 3000000
    }
  }
}
@meonkeys
Copy link

meonkeys commented Oct 1, 2023

I'm also seeing that illegal_argument_exception error in my browser console for about half the XHR requests to https://mycloud.example.com/apps/fulltextsearch/v1/search.

I've got:

  • nc server: 27.1.1
  • fulltextsearch: 27.0.2
  • files_fulltextsearch: 27.0.1
  • fulltextsearch_elasticsearch: 27.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants