Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find existing records more often, leading to better round tripping experiance #853

Merged
merged 2 commits into from
Aug 25, 2023
Merged
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions app/factories/bulkrax/object_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def update
end

def find
return find_by_id if attributes[:id].present?
found = find_by_id if attributes[:id].present?
return found if found.present?
return search_by_identifier if attributes[work_identifier].present?
end

Expand All @@ -102,7 +103,8 @@ def find_or_create
end

def search_by_identifier
query = { work_identifier =>
work_index = ::ActiveFedora.index_field_mapper.solr_name(work_identifier, :facetable)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Will work_identifier always be :facetable? Is there a chance this will different project-to-project, and thus fail sometimes?
  2. Is there a simple way to achieve this without calling ActiveFedora directly? With Valkyrization on the horizon, using ActiveFedora directly is going the way of the dinosaur. If the answer is "no" that's fine, I don't think it should block this PR; this ticket will rework this line later

Copy link
Member Author

@orangewolf orangewolf Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the answer with both is to add a new config variable to bulkrax with a default that just is "#{work_identifier}_ssim" and this should be a new ticket for later work

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm reverting this change because it's breaking my ability to import FileSet's using the row.

ref: #867

query = { work_index =>
source_identifier_value }
# Query can return partial matches (something6 matches both something6 and something68)
# so we need to weed out any that are not the correct full match. But other items might be
Expand Down