-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a null indexer by default for Valkyrie
As long as Hyrax applications are using Wings, the index will be the one provided by ActiveFedora. Using a null index by default allows us to start "writing" data to the Valkyrie indexer throughout the codebase without the overhead of running a separate index we'll never read from (see: `Hyrax::Configuration#query_index_from_valkyrie`).
- Loading branch information
Tom Johnson
committed
Dec 26, 2019
1 parent
aa0bc7c
commit 985fe6b
Showing
5 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
module Valkyrie | ||
module Indexing | ||
# A Valkyrie indexer that does nothing for all index requests. This is | ||
# useful for applications using alternate/legacy (e.g. ActiveFedora) | ||
# indexing strategies that don't want the overhead of running separate | ||
# index requests. | ||
class NullIndexingAdapter | ||
def save(resource:) | ||
:noop | ||
end | ||
|
||
def save_all(resources:) | ||
:noop | ||
end | ||
|
||
def delete(resource:) | ||
:noop | ||
end | ||
|
||
def wipe! | ||
:noop | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# frozen_string_literal: true | ||
RSpec.configure do |config| | ||
config.before(:each, clean_index: true) do | ||
client = Hyrax.index_adapter.connection | ||
client = Valkyrie::IndexingAdapter.find(:solr_index).connection | ||
client.delete_by_query("*:*", params: { softCommit: true }) | ||
end | ||
end |