From 3a278900f20075637c176a7b6dd705cafc509fed Mon Sep 17 00:00:00 2001 From: Josh Humphries Date: Fri, 20 Sep 2024 11:10:20 +0100 Subject: [PATCH] feat: MSS compaibility with vds and splitgill updates BREAKING CHANGE: MSS compaibility with vds and splitgill updates --- iiif/profiles/mss.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iiif/profiles/mss.py b/iiif/profiles/mss.py index bd43f8f..7dba64e 100644 --- a/iiif/profiles/mss.py +++ b/iiif/profiles/mss.py @@ -131,7 +131,7 @@ def __init__(self, es_hosts: List[str], mss_url: str, mss_ssl: bool = True, - mss_index: str = 'mss', + mss_index: str = 'data-mss-latest', mss_limit: int = 10, es_limit: int = 10, info_cache_size: int = 100_000, @@ -384,7 +384,7 @@ class MSSElasticsearchHandler: Class that handles requests to Elasticsearch for the MSS profile. """ - def __init__(self, es_hosts: List[str], limit: int = 20, mss_index: str = 'mss'): + def __init__(self, es_hosts: List[str], limit: int = 20, mss_index: str = 'data-mss-latest'): """ :param es_hosts: a list of elasticsearch hosts to use :param limit: the maximum number of simultaneous connections that can be made to @@ -403,7 +403,7 @@ async def get_mss_doc(self, guid: str) -> Tuple[int, Optional[dict]]: :return: the total number of hits and the first hit's source """ search_url = f'{next(self.es_hosts)}/{self.mss_index}/_search' - search = Search().filter('term', **{'guid.keyword': guid}).extra(size=1) + search = Search().filter('term', **{'parsed.guid.^ks': guid}).extra(size=1) async with self.es_session.post(search_url, json=search.to_dict()) as response: result = await response.json(encoding='utf-8') total = result['hits']['total'] @@ -418,7 +418,7 @@ async def lookup_guid(self, asset_id: str) -> Tuple[int, Optional[str]]: :return: the total hits and the GUID (or None if there are no hits) """ search_url = f'{next(self.es_hosts)}/{self.mss_index}/_search' - search = Search().filter('term', **{'old_asset_id.keyword': asset_id}).extra(size=1) + search = Search().filter('term', **{'parsed.old_asset_id.^ks': asset_id}).extra(size=1) async with self.es_session.post(search_url, json=search.to_dict()) as response: result = await response.json(encoding='utf-8') total = result['hits']['total']