# Aggregation with significant\_text on wildcard fields

**URL:** <https://discuss.elastic.co/t/aggregation-with-significant-text-on-wildcard-fields/255921>\
**Category:** Elasticsearch\
**Created:** [November 19, 2020, 3:33am UTC](https://discuss.elastic.co/t/aggregation-with-significant-text-on-wildcard-fields/255921 "2020-11-19T03:33:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newman\_chiang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/newman_chiang/32/79279_2.png) [@newman\_chiang](https://discuss.elastic.co/u/newman_chiang)\
**Post date:** [November 19, 2020, 3:33am UTC](https://discuss.elastic.co/t/aggregation-with-significant-text-on-wildcard-fields/255921/1 "2020-11-19T03:33:40Z")

</div>

Hi, everyone  
I have query below

```auto
GET contract/_search
{
    "query": {
        "bool": {
            "should": [
                {
                    "query_string": {
                    "fields": [
                        "contract*_content"
                    ],
                    "query": "company1"
                    }
                },
                {
                    "query_string": {
                    "fields": [
                        "contract*_content"
                    ],
                    "query": "keyword1"
                    }
                }
            ]
        }
    },
    "aggregations": {
        "my_sample": {
            "sampler": {
                "shard_size": 1000
            },
            "aggregations": {
                "keywords": {
                    "significant_text": { "field": "contract*_content"}
                }
            }
        }
    }
}

```

This throws an error since field contract\*\_content doesn't exist.  
If I change it to contract1\_content, contract2\_content, respectively, and so on. it will work, but it only get significant keywords on the specified field.

Is there any workaround to get it done to aggregate with significant\_text on wildcard fields?

Thanks,  
Newman

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [November 19, 2020, 8:39am UTC](https://discuss.elastic.co/t/aggregation-with-significant-text-on-wildcard-fields/255921/2 "2020-11-19T08:39:07Z")

</div>

No, there is no wildcard support in field names but multiple significant text aggregations can be stacked under the same sampler aggregation.

---

<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:** [December 17, 2020, 8:39am UTC](https://discuss.elastic.co/t/aggregation-with-significant-text-on-wildcard-fields/255921/3 "2020-12-17T08:39:33Z")

</div>

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