How to correctly query inside of terms aggregate values in elasticsearch, using include and regex?
问题 How do you filter out/search in aggregate results efficiently? Imagine you have 1 million documents in elastic search. In those documents, you have a multi_field (keyword, text) tags : { ... tags: ['Race', 'Racing', 'Mountain Bike', 'Horizontal'], ... }, { ... tags: ['Tracey Chapman', 'Silverfish', 'Blue'], ... }, { ... tags: ['Surfing', 'Race', 'Disgrace'], ... }, You can use these values as filters, (facets), against a query to pull only the documents that contain this tag: ... "filter": [