SolrMarc

Configurable match rules for MarcCombiningReader

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.1 bug fixes
  • Component/s: None
  • Description:
    Hide
    Presently, the MarcCombiningReader class only combines records when currentRecord.getControlNumber().equals(nextRecord.getControlNumber()). However, in some cases, you may want to combine based on different matching fields (i.e. in Voyager dumps with holdings, the bib 001 matches the holdings 004). A marc.combine_records.match_rule property should be created to allow configuration of matching; if omitted, we should default to the current control number behavior.
    Show
    Presently, the MarcCombiningReader class only combines records when currentRecord.getControlNumber().equals(nextRecord.getControlNumber()). However, in some cases, you may want to combine based on different matching fields (i.e. in Voyager dumps with holdings, the bib 001 matches the holdings 004). A marc.combine_records.match_rule property should be created to allow configuration of matching; if omitted, we should default to the current control number behavior.
  1. configurable_matching.patch
    (7 kB)
    Demian Katz
    03/Sep/10 10:49 AM

Activity

Hide
Demian Katz added a comment - 03/Sep/10 10:49 AM - edited
This patch adds support for two new configuration properties that affect the MarcCombiningReader:

marc.combine_records.left_field - tag of a control field to use for matching on the left side of a comparison (current record)

marc.combine_records.right_field - tag of a control field to use for matching on the right side of a comparison (next record)

If either of these fields is omitted, it will default to 001 (the current behavior).

A few notes/comments --

1.) The findControlField() method seems like overkill. Is there an easier way to achieve this effect? The marc4j documentation mentioned a getControlField(String) method, but I couldn't get it to work.

2.) I'm not sure if "left" and "right" are the best way to convey the values at work here -- if somebody wants to suggest better language, I'll be happy to change this.

3.) I would like to put together some tests for this new feature, but I'm not sure of the best approach. Suggestions are welcome.

4.) Only ControlFields are supported -- I'm not sure if it's necessary to support other field types, but I didn't need it for my purposes, so I didn't bother.
Show
Demian Katz added a comment - 03/Sep/10 10:49 AM - edited This patch adds support for two new configuration properties that affect the MarcCombiningReader: marc.combine_records.left_field - tag of a control field to use for matching on the left side of a comparison (current record) marc.combine_records.right_field - tag of a control field to use for matching on the right side of a comparison (next record) If either of these fields is omitted, it will default to 001 (the current behavior). A few notes/comments -- 1.) The findControlField() method seems like overkill. Is there an easier way to achieve this effect? The marc4j documentation mentioned a getControlField(String) method, but I couldn't get it to work. 2.) I'm not sure if "left" and "right" are the best way to convey the values at work here -- if somebody wants to suggest better language, I'll be happy to change this. 3.) I would like to put together some tests for this new feature, but I'm not sure of the best approach. Suggestions are welcome. 4.) Only ControlFields are supported -- I'm not sure if it's necessary to support other field types, but I didn't need it for my purposes, so I didn't bother.
Hide
Demian Katz added a comment - 08/Sep/10 2:21 PM
This was included in the 2.1.2 release.
Show
Demian Katz added a comment - 08/Sep/10 2:21 PM This was included in the 2.1.2 release.

People

Dates

  • Created:
    02/Sep/10 11:48 AM
    Updated:
    08/Sep/10 2:21 PM
    Resolved:
    08/Sep/10 2:21 PM