Hi, I want to create a termAggregation query with wildcard in Java API. It works in Elasticsearch console, but not in Java code. Would you mind shedding some lights? Thank you!
I don't think it should. The terms aggregation does not do anything special with wildcard characters - they are treated like any other character and assumed to be a part of the field name.
Hi Mark, thank you for the quick reply
Would you mind sharing how to get the distinct count in the wildcard field? I thought about using cardinality, but it doesn't work unfortunately...
If you have content that you'd like to centralise in one field for analysis then using the copy_to setting in the leaf fields would be a way to create a shared field full of values you can aggregate on.
This would require reindexing.
Thanks for the answer, but I'm not sure if this is a bit too complicated to solve my case. I just want to create a distinct aggregation in a wildcard field (profileContent.*.fieldName in the following case), which contains non-null value. Do you maybe have some other ideas I could try?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.