Skip to content

Commit

Permalink
feat: MSS compaibility with vds and splitgill updates
Browse files Browse the repository at this point in the history
BREAKING CHANGE: MSS compaibility with vds and splitgill updates
  • Loading branch information
jrdh committed Sep 20, 2024
1 parent a99721d commit 3a27890
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions iiif/profiles/mss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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']
Expand All @@ -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']
Expand Down

0 comments on commit 3a27890

Please sign in to comment.