Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nick committed Apr 13, 2024
1 parent b6400cf commit 7e08f6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/SearchRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Name | Type | Description | Notes
compAgg1 = AggregationCompositeSourcesInnerValue(compAggTerms1)
compAggTerms2 = AggregationCompositeSourcesInnerValueTerms('rating')
compAgg2 = AggregationCompositeSourcesInnerValue(compAggTerms2)
compSources = {'comp_agg_1': compAgg1, 'comp_agg_2': compAgg2}
compSources = [{'comp_agg_1': compAgg1}, {'comp_agg_2': compAgg2}]
compAgg = AggregationComposite(size=5, sources=compSources)
agg = Aggregation(composite=compAgg)

Expand Down
8 changes: 3 additions & 5 deletions manticoresearch/model/search_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,12 +568,10 @@ def to_dict(self):
del result['source']
if result['aggs'] is not None:
for k,v in result['aggs'].items():
if v['composite'] is not None:
del result['aggs'][k]['terms']
if v['sort'] is None:
result['aggs'][k]['sort'] = []
if v['terms'] is None:
result['aggs'][k]['terms'] = []
if v['composite'] is None:
result['aggs'][k]['composite'] = []
del result['aggs'][k]['sort']
if result['highlight'] is not None:
if result['highlight']['fields'] is None:
result['highlight']['fields'] = result['highlight']['fieldnames']
Expand Down

0 comments on commit 7e08f6f

Please sign in to comment.