Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding "should" and "minimum_should_match" to QueryType #62

Merged
merged 1 commit into from
Jan 17, 2021
Merged
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
6 changes: 6 additions & 0 deletions elasticmock/fake_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class QueryType:
TERMS = 'TERMS'
MUST = 'MUST'
RANGE = 'RANGE'
SHOULD = 'SHOULD'
MINIMUM_SHOULD_MATCH = 'MINIMUM_SHOULD_MATCH'

@staticmethod
def get_query_type(type_str):
Expand All @@ -48,6 +50,10 @@ def get_query_type(type_str):
return QueryType.MUST
elif type_str == 'range':
return QueryType.RANGE
elif type_str == 'should':
return QueryType.SHOULD
elif type_str == 'minimum_should_match':
return QueryType.MINIMUM_SHOULD_MATCH
else:
raise NotImplementedError(f'type {type_str} is not implemented for QueryType')

Expand Down