ej 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/ej.gemspec +2 -2
- data/lib/ej/commands.rb +3 -3
- data/lib/ej/core.rb +2 -2
- data/lib/ej/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0063005854bb2ad94ce28e13961b24585ba9e57
|
4
|
+
data.tar.gz: 2daf05f3e58689c358bccc6d3b7eb823ff50f17a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 532189d20341f8c92157aa0918f4cdac32aad56ee51cd69e1114f35cff24c5f72cade7216cb1de5b4c8dc7343390c7cc1fa51442774fd86c15c3d20c73f3b423
|
7
|
+
data.tar.gz: c02c791cadded15a269ac2cdf59558a147215f23ba8b85efc7190c8c34208258f42814fd37b57c6cbd855773b0b2247bd123915731f472d65276c617a1d048ff
|
data/.gitignore
CHANGED
data/README.md
CHANGED
data/ej.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Ej::VERSION
|
9
9
|
spec.authors = ["toyama0919"]
|
10
10
|
spec.email = ["toyama0919@gmail.com"]
|
11
|
-
spec.summary = %q{
|
12
|
-
spec.description = %q{
|
11
|
+
spec.summary = %q{elasticsearch command line utility.}
|
12
|
+
spec.description = %q{elasticsearch command line utility. Returns all results in json.}
|
13
13
|
spec.homepage = "https://github.com/toyama0919/ej"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
data/lib/ej/commands.rb
CHANGED
@@ -32,7 +32,7 @@ module Ej
|
|
32
32
|
|
33
33
|
desc '-s [lucene query]', 'search'
|
34
34
|
option :type, type: :string, aliases: '-t', default: nil, desc: 'type'
|
35
|
-
option :size, type: :numeric, aliases: '-n', default:
|
35
|
+
option :size, type: :numeric, aliases: '-n', default: nil, desc: 'size'
|
36
36
|
option :from, type: :numeric, aliases: '--from', default: 0, desc: 'from'
|
37
37
|
option :source_only, type: :boolean, aliases: '--so', default: true, desc: 'from'
|
38
38
|
def search(query = nil)
|
@@ -132,7 +132,7 @@ module Ej
|
|
132
132
|
puts_json(@core.put_template('ej_init', hash))
|
133
133
|
end
|
134
134
|
|
135
|
-
desc 'put_routing',
|
135
|
+
desc 'put_routing', "put routing.\nexsample. ej put_routing -i someindex -t sometype --path somecolumn"
|
136
136
|
option :index, aliases: '-i', type: :string, default: nil, required: true, desc: 'index'
|
137
137
|
option :type, aliases: '-t', type: :string, default: nil, required: true, desc: 'type'
|
138
138
|
option :path, type: :string, default: nil, required: true, desc: 'path'
|
@@ -201,7 +201,7 @@ module Ej
|
|
201
201
|
private
|
202
202
|
|
203
203
|
def puts_json(object)
|
204
|
-
puts Yajl::Encoder.encode(object)
|
204
|
+
puts Yajl::Encoder.encode(object, pretty: true)
|
205
205
|
end
|
206
206
|
|
207
207
|
end
|
data/lib/ej/core.rb
CHANGED
@@ -16,7 +16,8 @@ module Ej
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def search(type, query, size, from, source_only, routing = nil)
|
19
|
-
body = {
|
19
|
+
body = { from: from }
|
20
|
+
body[:size] = size unless size.nil?
|
20
21
|
body[:query] = { query_string: { query: query } } unless query.nil?
|
21
22
|
search_option = { index: @index, type: type, body: body }
|
22
23
|
search_option[:routing] = routing unless routing.nil?
|
@@ -40,7 +41,6 @@ module Ej
|
|
40
41
|
body = { size: per, from: from }
|
41
42
|
body[:query] = { query_string: { query: query } } unless query.nil?
|
42
43
|
data = Hashie::Mash.new(source_client.search index: @index, body: body)
|
43
|
-
p data.hits.hits.size
|
44
44
|
break if data.hits.hits.empty?
|
45
45
|
bulk_message = []
|
46
46
|
data.hits.hits.each do |doc|
|
data/lib/ej/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ej
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toyama0919
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -136,7 +136,7 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
-
description:
|
139
|
+
description: elasticsearch command line utility. Returns all results in json.
|
140
140
|
email:
|
141
141
|
- toyama0919@gmail.com
|
142
142
|
executables:
|
@@ -181,6 +181,6 @@ rubyforge_project:
|
|
181
181
|
rubygems_version: 2.2.2
|
182
182
|
signing_key:
|
183
183
|
specification_version: 4
|
184
|
-
summary:
|
184
|
+
summary: elasticsearch command line utility.
|
185
185
|
test_files: []
|
186
186
|
has_rdoc:
|