# Why elasticsearch term query is difference from the same term query？

**URL:** <https://discuss.elastic.co/t/why-elasticsearch-term-query-is-difference-from-the-same-term-query/189025>\
**Category:** Elasticsearch\
**Created:** [July 5, 2019, 7:13am UTC](https://discuss.elastic.co/t/why-elasticsearch-term-query-is-difference-from-the-same-term-query/189025 "2019-07-05T07:13:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ping\_luo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ping_luo/32/46063_2.png) [@ping\_luo](https://discuss.elastic.co/u/ping_luo)\
**Post date:** [July 5, 2019, 7:13am UTC](https://discuss.elastic.co/t/why-elasticsearch-term-query-is-difference-from-the-same-term-query/189025/1 "2019-07-05T07:13:07Z")

</div>

hi guys, i have a tough problem, each term query results are different. i also got some infomation by setting preference parameters, but it still didn't work.any help would be very much sappreciated.  
node: 1  
replica: 0  
no delete operation

```auto
{
	"sort": {
		"timestamp": {
			"order": "desc"
		}
	},
	"query": {
	  	"bool":{
		    "must" : [
		      {
		        "term" : {
		          "event_type.keyword" : {
		            "value" : "QUERY"
		    
		          }
		        }
		      },
		      {
		      	"range": {
		      		"timestamp":{
		      			"from":"2019-07-05T09:51:04",
		      			"to":"2019-07-05T10:11:04",
		      			"include_lower":true,
		      			"include_upper":true,
		      			"format":"yyyy-MM-dd'T'HH:mm:ss",
		      			"boost":1.0
		      		}
		      	}
		      }
		    ]
	    }
    }
}

```

i got this:

```auto
"hits": {
        "total": 8787285,
        "max_score": null,
...

```

```auto
"hits": {
        "total": 8805754,
        "max_score": null,
...

```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 5, 2019, 2:43pm UTC](https://discuss.elastic.co/t/why-elasticsearch-term-query-is-difference-from-the-same-term-query/189025/2 "2019-07-05T14:43:03Z")

</div>

Hey,

can you mention what Elasticsearch version you are using? Can you share the output of

```auto
GET your_index_name

```

and also the full query including index name and additional parameters?

Does this happen if you specify two searches with `preference=abc` (two times the same string).

--Alex

---

<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 2, 2019, 2:46pm UTC](https://discuss.elastic.co/t/why-elasticsearch-term-query-is-difference-from-the-same-term-query/189025/3 "2019-08-02T14:46:56Z")

</div>

Closed on August 2, 2019, 2:46pm UTC

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