Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions elasticsearch_dsl/aggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ class MultiTerms(Bucket):
name = "multi_terms"


class CategorizeText(Bucket):
name = "categorize_text"


# metric aggregations
class TopHits(Agg):
name = "top_hits"
Expand Down
17 changes: 17 additions & 0 deletions tests/test_aggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,23 @@ def test_multi_terms_aggregation():
} == a.to_dict()


def test_categorize_text_aggregation():
a = aggs.CategorizeText(
field="tags",
categorization_filters=["\\w+\\_\\d{3}"],
max_matched_tokens=2,
similarity_threshold=30,
)
assert {
"categorize_text": {
"field": "tags",
"categorization_filters": ["\\w+\\_\\d{3}"],
"max_matched_tokens": 2,
"similarity_threshold": 30,
}
} == a.to_dict()


def test_median_absolute_deviation_aggregation():
a = aggs.MedianAbsoluteDeviation(field="rating")

Expand Down