7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/esse/async_indexing/actions/index_document.rb', line 7
def self.call(index_class_name, repo_name, document_id, options = {})
index_class, repo_class = CoerceIndexRepository.call(index_class_name, repo_name)
bulk_opts = Esse::HashUtils.deep_transform_keys(options, &:to_sym)
bulk_opts.delete_if { |k, _| DOC_ARGS.include?(k) }
find_opts = options.slice(*DOC_ARGS)
doc = repo_class.documents(**find_opts, id: document_id).first
return :not_found unless doc
index_class.index(doc, **bulk_opts)
:indexed
end
|