blob: 9d80289472c1217ff41d55800d496247d3dbdb8d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# frozen_string_literal: true
task search_clear: :environment do
# BONSAI.clear
client = ElasticClient.instance
if client.indices.exists? index: ELASTIC_SEARCH_INDEX
client.indices.delete index: ELASTIC_SEARCH_INDEX
end
client.indices.create index: ELASTIC_SEARCH_INDEX
end
task search_index: :environment do
version = Version.latest_version
puts version.name
version.doc_versions.each do |docv|
p docv.index
end
end
task search_index_book: :environment do
book = Book.where(code: "en", edition: 2).first
book.sections.each(&:index)
end
|