# How to use cardinality add more fields

**URL:** <https://discuss.elastic.co/t/how-to-use-cardinality-add-more-fields/313967>\
**Category:** Elasticsearch\
**Created:** [September 8, 2022, 8:50am UTC](https://discuss.elastic.co/t/how-to-use-cardinality-add-more-fields/313967 "2022-09-08T08:50:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![githup-DK](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/githup-dk/32/110641_2.png) [@githup-DK](https://discuss.elastic.co/u/githup-DK)\
**Post date:** [September 8, 2022, 8:50am UTC](https://discuss.elastic.co/t/how-to-use-cardinality-add-more-fields/313967/1 "2022-09-08T08:50:45Z")

</div>

```auto
Hi bro
I can't upgrade my instance. my instance is 7.9.3. I want to use three field to search .I create a table with three cardinality `fields` ,but there is no effective,the data looks like repeated

```

```auto
GET /testPreformatted text_2022_9/_search
{
  "query": {
    "bool": {
      "filter": [
        {
          "match": {
            "field1": "123"
          }
        }
      ]
    }
  },
  "from": 0,
  "size": 200,
 
  "aggs": {
    "job_count": {
      "cardinality": {
         "script": "doc['field2'].value + '#' + doc['field3'].value + '#' + doc['field4'].value",
        "precision_threshold": 40000
      }
    }
  },
  "track_total_hits": true
}

```

---

<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:** [October 6, 2022, 8:51am UTC](https://discuss.elastic.co/t/how-to-use-cardinality-add-more-fields/313967/2 "2022-10-06T08:51:05Z")

</div>

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