Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Align dashboard search query tests

Jakub Draganek5f4fd513f2ef
diff --git a/saleor/search/backends/elasticsearch_dashboard.py b/saleor/search/backends/elasticsearch_dashboard.py
index 97295f4e81..7aaa601b17 100644
--- a/saleor/search/backends/elasticsearch_dashboard.py
+++ b/saleor/search/backends/elasticsearch_dashboard.py
@@ -10,8 +10,7 @@ def _search_products(phrase):
def _search_users(phrase):
- user_query = MultiMatch(fields=['user'], query=phrase)
- return UserDocument.search().query(user_query).source(False)
+ return UserDocument.search().query('match', user=phrase).source(False)
def _search_orders(phrase):
diff --git a/saleor/search/backends/test_dashboard.py b/saleor/search/backends/test_dashboard.py
index 3ba0621813..a6895f51ad 100644
--- a/saleor/search/backends/test_dashboard.py
+++ b/saleor/search/backends/test_dashboard.py
@@ -16,7 +16,7 @@ ORDERS_QUERY = {
'_source': False,
'query': {
'multi_match': {
- 'fields': ['user_email', 'status', 'discount_name'],
+ 'fields': ['user', 'status', 'discount_name'],
'query': PHRASE
}
}
@@ -25,7 +25,7 @@ USERS_QUERY = {
'_source': False,
'query': {
'match': {
- 'email': PHRASE
+ 'user': PHRASE
}
}
}