diff --git a/sde_collections/sinequa_api.py b/sde_collections/sinequa_api.py index fb797dc7..483e21fe 100644 --- a/sde_collections/sinequa_api.py +++ b/sde_collections/sinequa_api.py @@ -41,6 +41,7 @@ class Api: def __init__(self, server_name: str) -> None: + self.server_name = server_name self.app_name: str = server_configs[server_name]["app_name"] self.query_name: str = server_configs[server_name]["query_name"] self.base_url: str = server_configs[server_name]["base_url"] @@ -56,7 +57,10 @@ def process_response(self, url: str, payload: dict[str, Any]) -> Any: return meaningful_response def query(self, page: int, collection_config_folder: str = "") -> Any: - url = f"{self.base_url}/api/v1/search.query" + if self.server_name == "lis_server": + url = f"{self.base_url}/api/v1/search.query?Password=admin&User=admin" + else: + url = f"{self.base_url}/api/v1/search.query" payload = { "app": self.app_name, "query": { @@ -71,7 +75,7 @@ def query(self, page: int, collection_config_folder: str = "") -> Any: if collection_config_folder: payload["query"]["advanced"][ "collection" - ] = f"/SMD/{collection_config_folder}/" + ] = f"/SDE/{collection_config_folder}/" response = self.process_response(url, payload)