owncloud / search_elastic

Elasticsearch based full text search
https://github.com/owncloud/search_elastic
GNU General Public License v2.0
8 stars 1 forks source link

ES7: The length of [file.content] field of [0] doc of [oc-ocu5gka0ocd4] index has exceeded [1000000] - maximum allowed to be analyzed for highlighting. #194

Open DeepDiver1975 opened 3 years ago

DeepDiver1975 commented 3 years ago

Problem

'The length of [file.content] field of [0] doc of [oc-ocu5gka0ocd4] index has exceeded [1000000] - maximum allowed to be analyzed for highlighting. This maximum can be set by changing the [index.highlight.max_analyzed_offset] index level setting. For large texts, indexing with offsets or term vectors is recommended! [reason: all shards failed]'

{"reqId":"dlQl5e1Dz0rTxh0D68mZ","level":3,"time":"2020-12-10T11:12:58+00:00","remoteAddr":"95.91.255.178","user":"admin","app":"search_elastic","method":"GET","url":"\/core\/search?query=xxx&inApps%5B%5D=files&page=1&size=30","message":"Exception: {\"Exception\":\"Elastica\\\\Exception\\\\ResponseException\",\"Message\":\"The length of [file.content] field of [0] doc of [oc-ocu5gka0ocd4] index has exceeded [1000000] - maximum allowed to be analyzed for highlighting. This maximum can be set by changing the [index.highlight.max_analyzed_offset] index level setting. For large texts, indexing with offsets or term vectors is recommended! [reason: all shards failed]\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/apps\\\/search_elastic\\\/vendor\\\/ruflin\\\/elastica\\\/src\\\/Request.php(181): Elastica\\\\Transport\\\\Http->exec()\\n#1 \\\/var\\\/www\\\/owncloud\\\/apps\\\/search_elastic\\\/vendor\\\/ruflin\\\/elastica\\\/src\\\/Client.php(521): Elastica\\\\Request->send()\\n#2 \\\/var\\\/www\\\/owncloud\\\/apps\\\/search_elastic\\\/vendor\\\/ruflin\\\/elastica\\\/src\\\/Search.php(281): Elastica\\\\Client->request()\\n#3 \\\/var\\\/www\\\/owncloud\\\/apps\\\/search_elastic\\\/lib\\\/SearchElasticService.php(205): Elastica\\\\Search->search()\\n#4 \\\/var\\\/www\\\/owncloud\\\/apps\\\/search_elastic\\\/lib\\\/Search\\\/ElasticSearchProvider.php(190): OCA\\\\Search_Elastic\\\\SearchElasticService->search()\\n#5 \\\/var\\\/www\\\/owncloud\\\/apps\\\/search_elastic\\\/lib\\\/Search\\\/ElasticSearchProvider.php(102): OCA\\\\Search_Elastic\\\\Search\\\\ElasticSearchProvider->fetchResults()\\n#6 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Search.php(67): OCA\\\\Search_Elastic\\\\Search\\\\ElasticSearchProvider->searchPaged()\\n#7 \\\/var\\\/www\\\/owncloud\\\/core\\\/search\\\/ajax\\\/search.php(56): OC\\\\Search->searchPaged()\\n#8 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Route.php(155): require_once('\\\/var\\\/www\\\/ownclo...')\\n#9 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(342): OC\\\\Route\\\\Route->OC\\\\Route\\\\{closure}(*** sensitive parameters replaced ***)\\n#10 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(916): OC\\\\Route\\\\Router->match()\\n#11 \\\/var\\\/www\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n#12 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/search_elastic\\\/vendor\\\/ruflin\\\/elastica\\\/src\\\/Transport\\\/Http.php\",\"Line\":182}"}

Temporary solution

Only temporary because this value can be exceeded as well. Deeper research is required on how to properly setup ES


curl -XPUT "localhost:9200/oc-ocu5gka0ocd4/_settings" -H 'Content-Type: application/json' -d' {
    "index" : {
        "highlight.max_analyzed_offset" : 60000000
    }
}