# My query result will change in same params

**URL:** https://discuss.elastic.co/t/my-query-result-will-change-in-same-params/29208
**Category:** Elasticsearch
**Created:** [September 13, 2015, 11:18pm UTC](https://discuss.elastic.co/t/my-query-result-will-change-in-same-params/29208 "2015-09-13T23:18:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jianfeng\_ye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jianfeng_ye/32/4753_2.png) [@jianfeng\_ye](https://discuss.elastic.co/u/jianfeng_ye)
#### Post date: [September 13, 2015, 11:18pm UTC](https://discuss.elastic.co/t/my-query-result-will-change-in-same-params/29208/1 "2015-09-13T23:18:42Z")

</div>

my query params like that

```
$params = [
            'index' => "questions",
            'type' => "baichebao",
            'body' => [
                'from' => $from,
                'size' => 1,
                'sort' => [
                    "_score" => 'desc',
                ],
                'query' => [
                    'filtered' => [
                        "query" => [
                            "match" => [
                                'content' => '我的斯巴鲁启动不了了'
                            ]
                        ]
                    ]
                ]
            ]
        ];

```

but when I query twice, I got diffrent result:

one is

```
{
    "code": 0,
    "message": "处理成功",
    "timestamp": 1442186044,
    "im": true,
    "result": {
        "took": 16,
        "timed_out": false,
        "_shards": {
            "total": 5,
            "successful": 5,
            "failed": 0
        },
        "hits": {
            "total": 119124,
            "max_score": 3.9808903,
            "hits": [
                {
                    "_index": "questions",
                    "_type": "baichebao",
                    "_id": "901543",
                    "_score": 3.9808903,
                    "_source": {
                        "id": 901543,
                        "content": "斯巴鲁新车启动冒烟",
                        "uid": 1,
                        "all_answer_count": 0,
                        "answer_users": 0,
                        "best_answer": 0,
                        "status": 1,
                        "is_closed": false,
                        "tags": [],
                        "channel_type": 6,
                        "channel_sub_type": 0,
                        "created_at": 1430748122,
                        "distrust": 0,
                        "is_expert": false,
                        "series_id": 0
                    }
                }
            ]
        }
    }
}

```

the other one is:

```
{
    "code": 0,
    "message": "处理成功",
    "timestamp": 1442186188,
    "im": true,
    "result": {
        "took": 17,
        "timed_out": false,
        "_shards": {
            "total": 5,
            "successful": 5,
            "failed": 0
        },
        "hits": {
            "total": 255033,
            "max_score": 3.4157248,
            "hits": [
                {
                    "_index": "questions",
                    "_type": "baichebao",
                    "_id": "2229710",
                    "_score": 3.4157248,
                    "_source": {
                        "id": 2229710,
                        "content": "斯巴鲁翼豹一键启动困难",
                        "uid": 1,
                        "all_answer_count": 1,
                        "answer_users": 1,
                        "best_answer": 0,
                        "status": 1,
                        "is_closed": false,
                        "tags": [],
                        "channel_type": 6,
                        "channel_sub_type": 0,
                        "created_at": 1439695773,
                        "distrust": 0,
                        "is_expert": false,
                        "series_id": 0
                    }
                }
            ]
        }
    }
}

```

By the way, I have two node in my cluster, but I saw green in the head, It is strange right? does it mean my cluster builded wrong?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 13, 2015, 11:26pm UTC](https://discuss.elastic.co/t/my-query-result-will-change-in-same-params/29208/2 "2015-09-13T23:26:15Z")

</div>

Is this related to [script\_score return is strange](https://discuss.elastic.co/t/script-score-return-is-strange/29207)?

---

<div class="post-metadata">

### Author: ![jianfeng\_ye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jianfeng_ye/32/4753_2.png) [@jianfeng\_ye](https://discuss.elastic.co/u/jianfeng_ye)
#### Post date: [September 14, 2015, 1:56am UTC](https://discuss.elastic.co/t/my-query-result-will-change-in-same-params/29208/3 "2015-09-14T01:56:38Z")

</div>

Yes, the two question is in same index, and i solve this question by rebuild index, but i do not know the solution for question "[script\_score return is strange](https://discuss.elastic.co/t/script-score-return-is-strange/29207)"

---

<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: [July 5, 2017, 11:50pm UTC](https://discuss.elastic.co/t/my-query-result-will-change-in-same-params/29208/4 "2017-07-05T23:50:33Z")

</div>


