diff --git a/swh/web/common/archive.py b/swh/web/common/archive.py --- a/swh/web/common/archive.py +++ b/swh/web/common/archive.py @@ -385,7 +385,10 @@ """ results = [] - if search and config.get_config()["search_config"]["backend"] == "swh-search": + if ( + search + and config.get_config()["search_config"]["metadata_backend"] == "swh-search" + ): page_result = search.origin_search(metadata_pattern=fulltext, limit=limit,) matches = idx_storage.origin_intrinsic_metadata_get( [r["url"] for r in page_result.results] diff --git a/swh/web/config.py b/swh/web/config.py --- a/swh/web/config.py +++ b/swh/web/config.py @@ -59,7 +59,10 @@ ), "search_config": ( "dict", - {"backend": "swh-indexer-storage", "enable_ql": False}, # or "swh-search" + { + "metadata_backend": "swh-indexer-storage", # or "swh-search" + "enable_ql": False, + }, ), "log_dir": ("string", "/tmp/swh/log"), "debug": ("bool", False), diff --git a/swh/web/tests/api/views/test_origin.py b/swh/web/tests/api/views/test_origin.py --- a/swh/web/tests/api/views/test_origin.py +++ b/swh/web/tests/api/views/test_origin.py @@ -549,7 +549,7 @@ def test_api_origin_search_use_ql(api_client, mocker): mock_config = mocker.patch("swh.web.common.archive.config") mock_config.get_config.return_value = { - "search_config": {"backend": "swh-search", "enable_ql": True} + "search_config": {"metadata_backend": "swh-search", "enable_ql": True} } expected_origins = { @@ -624,7 +624,9 @@ def test_api_origin_metadata_search(api_client, mocker, backend): mock_config = mocker.patch("swh.web.common.archive.config") - mock_config.get_config.return_value = {"search_config": {"backend": backend}} + mock_config.get_config.return_value = { + "search_config": {"metadata_backend": backend} + } url = reverse( "api-1-origin-metadata-search", query_params={"fulltext": ORIGIN_METADATA_VALUE}