# Lucene query runs slower after upgrade from ES 5.4 to 6.2

**URL:** https://discuss.elastic.co/t/lucene-query-runs-slower-after-upgrade-from-es-5-4-to-6-2/191053
**Category:** Elasticsearch
**Created:** [July 17, 2019, 3:53pm UTC](https://discuss.elastic.co/t/lucene-query-runs-slower-after-upgrade-from-es-5-4-to-6-2/191053 "2019-07-17T15:53:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![SMAWarsi](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@SMAWarsi](https://discuss.elastic.co/u/SMAWarsi)
#### Post date: [July 17, 2019, 3:53pm UTC](https://discuss.elastic.co/t/lucene-query-runs-slower-after-upgrade-from-es-5-4-to-6-2/191053/1 "2019-07-17T15:53:46Z")

</div>

After upgrade from ElasticSearch 5.4 to 6.2, we have noticed severe performance degradation in queries we ran from Kibana. The same query which executed faster with 5.4 runs slower after upgrade in ES 6.2.

Kibana 5.6.5  
Query:  
tags:(Hello, World, Test, Universe) AND NOT "_Something_" AND "_Anything here_"

WE have enabled slow logs and the query phase takes close to 5 minutes. There were more documents in ElasticSearch in 5.4 when compared to 6.2. The same query executed within few seconds in 5.4.

Can anyone suggest how to troubleshoot this problem?

We have tried to re-write the query in ElasticSearch query DSL which executes faster. We ran with profile API but the response does not print any profiling information.

Equivalent query:

{  
"profile": "true",  
"query": {  
"bool": {  
"should": {  
"terms": {  
"tags": ["Hello", "World", "Test", "Universe"]  
}  
},  
"must\_not": {  
"wildcard": {  
"tags": "_Something_"  
}  
},  
"must": {  
"wildcard": {  
"tags": "_Anything here_"  
}  
}  
}  
}  
}

Thanks in advance.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 14, 2019, 3:53pm UTC](https://discuss.elastic.co/t/lucene-query-runs-slower-after-upgrade-from-es-5-4-to-6-2/191053/2 "2019-08-14T15:53:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
