SolrJsonWriter, guard marc-specific in record_id_from_context fixes #92 #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For now I think this is all we need for #92. Although it really needs a test, since I'm not sure how to use Indexer with non-MARC at all at present, I'm not sure how to write one!
Long-term, I think the right design choice is capability to specify in configuration either a Traject::Indexer sub-class and/or one or more mix-in modules to the Traject::Indexer. The primary use case for that would be different source record types -- which would over-ride methods like
record_id_from_context
in source-type-specific ways but also likely add other macro methods (eg not including notextract_marc
but including other source-type-specific useful macros -- I tried to name all the marc-specific macros with "marc" in them for this reason.Once we went down this path, there'd be a generic Indexer base class that did not have any marc specific stuff (including not mixing in the MARC-specific macros) -- but I'd still want the marc-specific one to be default probably, but that could be debated at the time.
I think it's too early for that now, before we have cowpaths to pave, and I think this very simple change should make it possible for erikhatcher to do the experimentation he wants? @erikhatcher?