Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/solr/conf/managed-schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<field name="lccn" type="text_general" multiValued="true"/>
<field name="ia" type="string" multiValued="true"/>
<field name="ia_box_id" type="string" multiValued="true"/>
<field name="ia_loaded_id" type="string" multiValued="true"/>

<field name="ia_count" type="pint"/>
<field name="ia_collection" type="string" multiValued="true" />
<field name="oclc" type="text_en_splitting" multiValued="true"/>
Expand Down
1 change: 0 additions & 1 deletion openlibrary/solr/solr_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class SolrDocument(TypedDict):
lccn: Optional[list[str]]
ia: Optional[list[str]]
ia_box_id: Optional[list[str]]
ia_loaded_id: Optional[list[str]]
ia_count: Optional[int]
ia_collection: Optional[list[str]]
oclc: Optional[list[str]]
Expand Down
20 changes: 0 additions & 20 deletions openlibrary/solr/updater/work.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,27 +608,9 @@ def language(self) -> set[str]:
return {lang for ed in self._solr_editions for lang in ed.language}

def build_legacy_ia_fields(self) -> dict:
ia_loaded_id = set()
ia_box_id = set()

for e in self._editions:
# When do we write these to the actual edition?? This code might
# be dead.
if e.get('ia_loaded_id'):
if isinstance(e['ia_loaded_id'], str):
ia_loaded_id.add(e['ia_loaded_id'])
else:
try:
assert isinstance(e['ia_loaded_id'], list)
assert isinstance(e['ia_loaded_id'][0], str)
except AssertionError:
logger.error(
"AssertionError: ia=%s, ia_loaded_id=%s",
e.get("ia"),
e['ia_loaded_id'],
)
raise
ia_loaded_id.update(e['ia_loaded_id'])
if e.get('ia_box_id'):
if isinstance(e['ia_box_id'], str):
ia_box_id.add(e['ia_box_id'])
Expand All @@ -643,8 +625,6 @@ def build_legacy_ia_fields(self) -> dict:

doc = {}

if ia_loaded_id:
doc['ia_loaded_id'] = list(ia_loaded_id)
if ia_box_id:
doc['ia_box_id'] = list(ia_box_id)
return doc
Expand Down
Loading