Help with query in CLI

Hi guys, please help me understand how to make a query work from the cli. I either match too much or nothing at all...

So here's the payload sample:

{
  "took": 3,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 172,
    "max_score": 2.0947983,
    "hits": [
      {
        "_index": "hnt-fnxo5ynwr4m0tu87tm7xk5qct.2021-10-25",
        "_type": "_doc",
        "_id": "x8bsrVrJWitAyfX",
        "_score": 2.0947983,
        "_source": {
          "data": [
            {}
          ],
          "docId": "hotspot.collector.activity.1635129209",
          "collectionTime": "2021-10-25T02:33:29"
        }
      }
    ]
  }
}

Im using a curl command to retrieve this data from Elasticsearch. I supply a query like this.

{
  "query": {
    "query_string": {
      "query": "hotspot.collector.activity",
      "default_field": "docId"
    }
  }
}

And I get in return:

hotspot.collector.activity
hotspot.collector.activity.1635129209
hotspot.collector.activity.1635129208
hotspot.collector.rewards
hotspot.collector.rewards.1635129209

How can I return only the ones that match hotspot.collector.activity including the hotspot.collector.activity.* but NOT the others like hotspot.collector.rewards

Thanks!!

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