search: enable AND operator and cross_field #2134
Annotations
3 errors
tests/api/test_documents_search.py#L1
Black format check
--- /home/runner/work/cds-ils/cds-ils/tests/api/test_documents_search.py 2024-10-21 19:44:20.959292+00:00
+++ /home/runner/work/cds-ils/cds-ils/tests/api/test_documents_search.py 2024-10-21 19:46:44.154249+00:00
@@ -25,20 +25,22 @@
assert response.get_json()["hits"]["total"] == 1
# test that searching with AND operator without cross-fields will return 0 results
def and_operator(extra_params={}):
extra_params["default_operator"] = "AND"
+
app.config["RECORDS_REST_ENDPOINTS"]["docid"]["search_query_parser"] = and_operator
response = client.get(f"{url}?q=American%20Caroline", headers=json_headers)
assert response.status_code == 200
assert response.get_json()["hits"]["total"] == 0
# test that searching with AND operator with cross-fields will return the result
def and_operator(extra_params={}):
extra_params["default_operator"] = "AND"
extra_params["type"] = "cross_fields"
+
app.config["RECORDS_REST_ENDPOINTS"]["docid"]["search_query_parser"] = and_operator
response = client.get(f"{url}?q=American%20Caroline", headers=json_headers)
assert response.status_code == 200
assert response.get_json()["hits"]["total"] == 1
|
tests/api/test_documents_search.py#L34
test_search_and_operator
assert 1 == 0
|
|
The logs for this run have expired and are no longer available.
Loading