es-grep 0.0.1 → 0.0.2

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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/bin/esgrep +15 -7
  3. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/bin/esgrep CHANGED
@@ -16,6 +16,10 @@ Main {
16
16
  arity -2
17
17
  }
18
18
 
19
+ option('raw', 'r'){
20
+ description 'Send a raw ElasticSearch REST query.'
21
+ }
22
+
19
23
  option('limit', 'l'){
20
24
  description 'The maximum number of results to return.'
21
25
  argument :optional
@@ -115,14 +119,18 @@ Main {
115
119
  end
116
120
 
117
121
  def query_string(query)
118
- {
119
- "from" => 0, "size" => params[:limit].value,
120
- "query" => {
121
- "query_string" => {
122
- "query" => query
122
+ if params[:raw].given?
123
+ query.to_json
124
+ else
125
+ {
126
+ "from" => 0, "size" => params[:limit].value,
127
+ "query" => {
128
+ "query_string" => {
129
+ "query" => query
130
+ }
123
131
  }
124
- }
125
- }.to_json
132
+ }.to_json
133
+ end
126
134
  end
127
135
 
128
136
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: es-grep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: