ej 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6a06d5628b4e5d30dd820cf0059142022db16af
4
- data.tar.gz: 4a1e3cbe19bd7a73f1a3a9d717a43c0b5c2d17b6
3
+ metadata.gz: b0063005854bb2ad94ce28e13961b24585ba9e57
4
+ data.tar.gz: 2daf05f3e58689c358bccc6d3b7eb823ff50f17a
5
5
  SHA512:
6
- metadata.gz: 668b2706ada7508073b8dee5e37d97991d7eb143f17dba84510d88dddfd82175342d0054a3a3d8b4206e17cc9a9b2b40a26605f6c1dce562f16c2b2dc54cbe9d
7
- data.tar.gz: 4c0b9939592bae0dd2650a5e710c6faf8f0c0c9803d235c0249ece62b1a71f506a3f9d6b6cd6b620d380a5e172f3b77cc8d91b492fd6a375a57ff07a87fe1af6
6
+ metadata.gz: 532189d20341f8c92157aa0918f4cdac32aad56ee51cd69e1114f35cff24c5f72cade7216cb1de5b4c8dc7343390c7cc1fa51442774fd86c15c3d20c73f3b423
7
+ data.tar.gz: c02c791cadded15a269ac2cdf59558a147215f23ba8b85efc7190c8c34208258f42814fd37b57c6cbd855773b0b2247bd123915731f472d65276c617a1d048ff
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ spec/reports
16
16
  test/tmp
17
17
  test/version_tmp
18
18
  tmp
19
+ .tags
data/README.md CHANGED
@@ -28,7 +28,7 @@ ej -s
28
28
 
29
29
  ### other host(default host is localhost)
30
30
  ```bash
31
- ej -s -h other_host
31
+ ej -s -h other_host:9201
32
32
  ```
33
33
 
34
34
  ### query search and index
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{Command-line Elasticsearch TO JSON processor.}
12
- spec.description = %q{Command-line Elasticsearch TO JSON processor.}
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: 10, desc: 'size'
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', '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 = { size: size, from: from }
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
@@ -1,3 +1,3 @@
1
1
  module Ej
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
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.6
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-09-03 00:00:00.000000000 Z
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: Command-line Elasticsearch TO JSON processor.
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: Command-line Elasticsearch TO JSON processor.
184
+ summary: elasticsearch command line utility.
185
185
  test_files: []
186
186
  has_rdoc: