From 4062894c339831d0ed61293ee993de18365329af Mon Sep 17 00:00:00 2001 From: Santiago Aguiar Date: Mon, 22 Aug 2022 19:22:12 -0300 Subject: [PATCH] support brief wildcard/prefix queries --- elasticmock/fake_elasticsearch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticmock/fake_elasticsearch.py b/elasticmock/fake_elasticsearch.py index dab9b74..6a72948 100644 --- a/elasticmock/fake_elasticsearch.py +++ b/elasticmock/fake_elasticsearch.py @@ -336,7 +336,7 @@ def _evaluate_for_multi_match_query_type(self, document): return self._evaluate_for_fields(document) def _compare_value_for_field(self, doc_source, field, value, ignore_case, is_wildcard=False, is_prefix=False): - if is_wildcard or is_prefix: + if (is_wildcard or is_prefix) and type(value) == type({}): value = value['value'] if ignore_case and isinstance(value, str): value = value.lower()