Repository: vrcmarcos/elasticmock

Issue:
NotImplementedError: Fake query evaluation not implemented for query type: MATCH_ALL
Using Python 3.7, elasticsearch==7.10.0 and ElasticMock==1.6.2
Match all queries don't work.

```python
es.search({"query": {"match_all", {}}})
```

Discussion:

Patch:
diff --git a/elasticmock/fake_elasticsearch.py b/elasticmock/fake_elasticsearch.py
index 98e5a6e..f9980e8 100644
--- a/elasticmock/fake_elasticsearch.py
+++ b/elasticmock/fake_elasticsearch.py
@@ -62,6 +62,8 @@ class FakeQueryCondition:
     def _evaluate_for_query_type(self, document):
         if self.type == QueryType.MATCH:
             return self._evaluate_for_match_query_type(document)
+        elif self.type == QueryType.MATCH_ALL:
+            return True
         elif self.type == QueryType.TERM:
             return self._evaluate_for_term_query_type(document)
         elif self.type == QueryType.TERMS:


Test patch:
diff --git a/tests/fake_elasticsearch/test_search.py b/tests/fake_elasticsearch/test_search.py
index 74079fe..df67f22 100644
--- a/tests/fake_elasticsearch/test_search.py
+++ b/tests/fake_elasticsearch/test_search.py
@@ -24,6 +24,14 @@ class TestSearch(TestElasticmock):
         search = self.es.search()
         self.assertEqual(index_quantity, search.get('hits').get('total'))
 
+    def test_should_return_all_documents_match_all(self):
+        index_quantity = 10
+        for i in range(0, index_quantity):
+            self.es.index(index='index_{0}'.format(i), doc_type=DOC_TYPE, body={'data': 'test_{0}'.format(i)})
+
+        search = self.es.search(body={'query': {'match_all': {}}})
+        self.assertEqual(index_quantity, search.get('hits').get('total'))
+
     def test_should_return_only_indexed_documents_on_index(self):
         index_quantity = 2
         for i in range(0, index_quantity):