Aggregation with significant_text on wildcard fields

Hi, everyone
I have query below

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

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

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