Class: ProxES::Request::Bulk
Constant Summary
collapse
- REGEX =
/"(index|delete|create|update)".*"_index"\s*:\s*"(.*?)"/
ID_ENDPOINTS, WRITE_METHODS
Instance Attribute Summary collapse
Instance Method Summary
collapse
from_env, #initialize, path_endpoint
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
9
10
11
|
# File 'lib/proxes/request/bulk.rb', line 9
def index
@index
end
|
#type ⇒ Object
Returns the value of attribute type.
9
10
11
|
# File 'lib/proxes/request/bulk.rb', line 9
def type
@type
end
|
Instance Method Details
#bulk_actions ⇒ Object
13
14
|
# File 'lib/proxes/request/bulk.rb', line 13
def bulk_actions
end
|
#bulk_indices ⇒ Object
16
17
18
19
20
|
# File 'lib/proxes/request/bulk.rb', line 16
def bulk_indices
@bulk_indices ||= begin
body.read.scan REGEX
end.map { |e| e[1] }.uniq
end
|
#endpoint ⇒ Object
29
30
31
|
# File 'lib/proxes/request/bulk.rb', line 29
def endpoint
'_bulk'
end
|
#indices? ⇒ Boolean
38
39
40
|
# File 'lib/proxes/request/bulk.rb', line 38
def indices?
!@index.nil?
end
|
#parse ⇒ Object
33
34
35
36
|
# File 'lib/proxes/request/bulk.rb', line 33
def parse
@index ||= check_part(path_parts[0]) unless path_parts[0] == endpoint
@type ||= check_part(path_parts[1]) unless path_parts[1] == endpoint
end
|