# Query terms search miss content depending on what is searched

**URL:** https://discuss.elastic.co/t/query-terms-search-miss-content-depending-on-what-is-searched/270193
**Category:** Elasticsearch
**Created:** [April 15, 2021, 7:00am UTC](https://discuss.elastic.co/t/query-terms-search-miss-content-depending-on-what-is-searched/270193 "2021-04-15T07:00:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![pyrovoice](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@pyrovoice](https://discuss.elastic.co/u/pyrovoice)
#### Post date: [April 15, 2021, 7:00am UTC](https://discuss.elastic.co/t/query-terms-search-miss-content-depending-on-what-is-searched/270193/1 "2021-04-15T07:00:15Z")

</div>

Hello, I have a strange issue with the ES query search: When searching for an array of ID, some of them will be skipped, but looking for those IDs individually of in a different array will return the skipped IDs correctly. For example, with the following search:

```auto
localhost:9200/myIndex/_search?pretty

{
  "query": {
    "terms": {
      "cid": ["5705179", "5705302", "5705191", "5725846", "5704789", "5705284", "5705239", "5704798", "5705038", "5705254", "5705278", "5706640"]
    }
  }
}

```

The first ID 5705179 will not be found. However, if I remove any of the following IDs and search again, it will be listed.

Do you know what could cause this issue ? Thank you for your help.

This is what data is in the skipped ID:

```auto
    hits": [
            {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5705179/fussball/bundesliga/2021/02/fc-bayern-bvb-stuermer-erling-haaland-folgt-auf-robert-lewandowski-kommentar",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:39.898Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5705179,
                    "url": "/fussball/bundesliga/2021/02/fc-bayern-bvb-stuermer-erling-haaland-folgt-auf-robert-lewandowski-kommentar",
                    "@version": "1",
                    "short_url": null
                }
            }

```

And in one of the other content:

```auto
    {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5705284/us-sport/nhl/2021/02/nhl-goalie-rask-geht-versehentlich-vom-eis-unterhaltungsbranche",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:22.156Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5705284,
                    "url": "/us-sport/nhl/2021/02/nhl-goalie-rask-geht-versehentlich-vom-eis-unterhaltungsbranche",
                    "@version": "1",
                    "short_url": null
                }
            },

```

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 15, 2021, 7:21am UTC](https://discuss.elastic.co/t/query-terms-search-miss-content-depending-on-what-is-searched/270193/2 "2021-04-15T07:21:37Z")

</div>

By default 10 results are returned and you have more than 10 terms. Can you show the full response which should show number of hits?

---

<div class="post-metadata">

### Author: ![pyrovoice](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@pyrovoice](https://discuss.elastic.co/u/pyrovoice)
#### Post date: [April 15, 2021, 7:23am UTC](https://discuss.elastic.co/t/query-terms-search-miss-content-depending-on-what-is-searched/270193/3 "2021-04-15T07:23:47Z")

</div>

Hello, thank you for your answer. The query returns all other 13 results:

```auto
    {
    "took": 554,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 13,
            "relation": "eq"
        },
        "max_score": 1.0,
        "hits": [
            {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5705284/us-sport/nhl/2021/02/nhl-goalie-rask-geht-versehentlich-vom-eis-unterhaltungsbranche",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:22.156Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5705284,
                    "url": "/us-sport/nhl/2021/02/nhl-goalie-rask-geht-versehentlich-vom-eis-unterhaltungsbranche",
                    "@version": "1",
                    "short_url": null
                }
            },
            {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5705278/us-sport/nba/2021/02/nba-mark-cuban-von-dallas-mavericks-aeussert-sich-zur-hymnen-debatte",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:21.790Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5705278,
                    "url": "/us-sport/nba/2021/02/nba-mark-cuban-von-dallas-mavericks-aeussert-sich-zur-hymnen-debatte",
                    "@version": "1",
                    "short_url": null
                }
            },
            {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5705254/kampfsport/wrestling/2021/02/aew-dynamite-knall-in-jerichos-inner-circle-mjf-vergrault-sammy-guevara",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:20.297Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5705254,
                    "url": "/kampfsport/wrestling/2021/02/aew-dynamite-knall-in-jerichos-inner-circle-mjf-vergrault-sammy-guevara",
                    "@version": "1",
                    "short_url": null
                }
            },
            {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5705239/us-sport/nba/2021/02/nba-luka-doncic-fuehrt-dallas-mavericks-zum-sieg-aerger-bei-atlanta-hawks",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:19.223Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5705239,
                    "url": "/us-sport/nba/2021/02/nba-luka-doncic-fuehrt-dallas-mavericks-zum-sieg-aerger-bei-atlanta-hawks",
                    "@version": "1",
                    "short_url": null
                }
            },
            {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5706640/fussball/2-bundesliga/2021/02/2-liga-bochum-jagt-den-hsv",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:35.417Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5706640,
                    "url": "/fussball/2-bundesliga/2021/02/2-liga-bochum-jagt-den-hsv",
                    "@version": "1",
                    "short_url": null
                }
            },
            {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5705038/wintersport/2021/02/dsv-will-ex-biathleten-um-dahlmeier-fuer-nachwuchsfoerderung-gewinnen",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:22.803Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5705038,
                    "url": "/wintersport/2021/02/dsv-will-ex-biathleten-um-dahlmeier-fuer-nachwuchsfoerderung-gewinnen",
                    "@version": "1",
                    "short_url": null
                }
            },
            {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5704789/tennis/grand-slams/2021/02/tennis-neuer-podcast-cross-court-auf-sport1-zu-den-australian-open",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:23.237Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5704789,
                    "url": "/tennis/grand-slams/2021/02/tennis-neuer-podcast-cross-court-auf-sport1-zu-den-australian-open",
                    "@version": "1",
                    "short_url": null
                }
            },
            {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5705302/internationaler-fussball/premier-league/2021/02/england-pep-guardiola-und-manchester-city-mit-historischer-siegesserie",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:23.278Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5705302,
                    "url": "/internationaler-fussball/premier-league/2021/02/england-pep-guardiola-und-manchester-city-mit-historischer-siegesserie",
                    "@version": "1",
                    "short_url": null
                }
            },
            {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5704798/tennis/grand-slams/2021/02/australian-open-jessica-pegula-schlaegt-azarenka-und-mischt-tennis-szene-auf",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:23.804Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5704798,
                    "url": "/tennis/grand-slams/2021/02/australian-open-jessica-pegula-schlaegt-azarenka-und-mischt-tennis-szene-auf",
                    "@version": "1",
                    "short_url": null
                }
            },
            {
                "_index": "url_alias",
                "_type": "_doc",
                "_id": "5705191/us-sport/nfl/2021/02/brady-grosser-wurf-bei-der-siegesparade",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2021-04-14T13:07:40.733Z",
                    "modification_time": "2021-02-16T11:38:59.000Z",
                    "lang_id": "de",
                    "cid": 5705191,
                    "url": "/us-sport/nfl/2021/02/brady-grosser-wurf-bei-der-siegesparade",
                    "@version": "1",
                    "short_url": null
                }
            }
        ]
    }
}

```

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 15, 2021, 9:18am UTC](https://discuss.elastic.co/t/query-terms-search-miss-content-depending-on-what-is-searched/270193/4 "2021-04-15T09:18:27Z")

</div>

The query matched 13 documents but the results array by default only shows 10 of these. If you want to see all you need to provide a size parameter with a larger value.

---

<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: [May 13, 2021, 9:18am UTC](https://discuss.elastic.co/t/query-terms-search-miss-content-depending-on-what-is-searched/270193/5 "2021-05-13T09:18:49Z")

</div>

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