This refactors the code for page indexing to setup work for the EEBO import.
Previously there were separate methods for Gale and HathiTrust page index data, with substantial overlap in common logic. This refactor implements source-specific page data generators, which are then consumed and updated with the common logic (like excerpt handling) and fields needed for all page records.
Also adds an efficiency improvement: when indexing pages for an excerpt, we don't need to keep iterating once we've got the data for the range we care about.
I also updated one test that has caused problems before, where we had some hard-coded solr page index data. Now it takes advantage of the common page field logic, so if page indexing logic or fields change it will automatically get those updates.
This refactors the code for page indexing to setup work for the EEBO import.
Previously there were separate methods for Gale and HathiTrust page index data, with substantial overlap in common logic. This refactor implements source-specific page data generators, which are then consumed and updated with the common logic (like excerpt handling) and fields needed for all page records.
Also adds an efficiency improvement: when indexing pages for an excerpt, we don't need to keep iterating once we've got the data for the range we care about.
I also updated one test that has caused problems before, where we had some hard-coded solr page index data. Now it takes advantage of the common page field logic, so if page indexing logic or fields change it will automatically get those updates.