stretcher 1.20.0.beta3 → 1.20.0
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 +4 -4
- data/README.md +5 -4
- data/lib/stretcher/util.rb +1 -1
- data/lib/stretcher/version.rb +1 -1
- data/spec/lib/stretcher_index_spec.rb +1 -1
- data/spec/lib/stretcher_server_spec.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: 866e50cd52c34cc61b4af0a1e7b9e598bdc14a14
|
4
|
+
data.tar.gz: 3e9d14317d08c4ce1d58a8793c7bff8f3cbe337b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6365cf04ab6d1a1228fa59080e5b3d56734a829331a127d8e579e4af95e1c6b16ad199ce75dafa436f00cdd769836128fcc490ef650f4dcf450f98e41415ec7e
|
7
|
+
data.tar.gz: 07c06966381c542a6ddbffc81420f796fd8da8327b79b1ee4cb2cbaf84f3d708d2fce8ab55fd8dc2a68b6b5aa3865dce64d19512ca4cb6d4dcb3f675a60a7d9a
|
data/README.md
CHANGED
@@ -66,11 +66,12 @@ server.index(:foo).type(:tweet).get(3)
|
|
66
66
|
# => #<Hashie::Mash text="Hello 3">
|
67
67
|
# Perform a search (Returns a Stretcher::SearchResults instance)
|
68
68
|
res = server.index(:foo).search(size: 12, query: {match_all: {}})
|
69
|
-
res.class
|
70
|
-
res.total
|
69
|
+
res.class # Stretcher::SearchResults
|
70
|
+
res.total # => 30
|
71
71
|
res.documents # => [#<Hashie::Mash _id="4" text="Hello 4">, ...]
|
72
|
-
res.facets
|
73
|
-
res.raw
|
72
|
+
res.facets # => nil
|
73
|
+
res.raw # => #<Hashie::Mash ...> Raw JSON from the search
|
74
|
+
res.raw_plain # => #<Hash ...> Non-Hashie Raw JSON from the search (fastest)
|
74
75
|
# use an alias
|
75
76
|
alias = server.index(:foo).alias(:my_alias)
|
76
77
|
alias.create({ filter: { term: { user_id: 1 } } })
|
data/lib/stretcher/util.rb
CHANGED
@@ -8,7 +8,7 @@ module Stretcher
|
|
8
8
|
method = req.method.to_s.upcase
|
9
9
|
url = Util.qurl(req.path,req.params)
|
10
10
|
|
11
|
-
["curl -X#{method}", url, body, headers].compact.join(' ')
|
11
|
+
["curl -X#{method}", "'" + url + "'", body, headers].compact.join(' ')
|
12
12
|
end
|
13
13
|
|
14
14
|
# Formats a url + query opts
|
data/lib/stretcher/version.rb
CHANGED
@@ -41,7 +41,7 @@ describe Stretcher::Index do
|
|
41
41
|
options = { :mappings => { :movie => { :properties => { :category => { :type => 'string' } } } } }
|
42
42
|
|
43
43
|
server.logger.should_receive(:debug) do |&block|
|
44
|
-
block.call.should == %{curl -XPUT http://localhost:9200/foo -d '#{MultiJson.dump(options)}' '-H Accept: application/json' '-H Content-Type: application/json' '-H User-Agent: Stretcher Ruby Gem #{Stretcher::VERSION}'}
|
44
|
+
block.call.should == %{curl -XPUT 'http://localhost:9200/foo' -d '#{MultiJson.dump(options)}' '-H Accept: application/json' '-H Content-Type: application/json' '-H User-Agent: Stretcher Ruby Gem #{Stretcher::VERSION}'}
|
45
45
|
end
|
46
46
|
|
47
47
|
index.create(options)
|
@@ -87,7 +87,7 @@ describe Stretcher::Server do
|
|
87
87
|
|
88
88
|
it 'logs requests correctly' do
|
89
89
|
server.logger.should_receive(:debug) do |&block|
|
90
|
-
block.call.should == %{curl -XGET http://localhost:9200/_analyze?analyzer=snowball -d 'Candles' '-H Accept: application/json' '-H Content-Type: application/json' '-H User-Agent: Stretcher Ruby Gem #{Stretcher::VERSION}'}
|
90
|
+
block.call.should == %{curl -XGET 'http://localhost:9200/_analyze?analyzer=snowball' -d 'Candles' '-H Accept: application/json' '-H Content-Type: application/json' '-H User-Agent: Stretcher Ruby Gem #{Stretcher::VERSION}'}
|
91
91
|
end
|
92
92
|
server.analyze("Candles", :analyzer => :snowball)
|
93
93
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stretcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.20.0
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Cholakian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -213,9 +213,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
213
213
|
version: '0'
|
214
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
215
|
requirements:
|
216
|
-
- - '
|
216
|
+
- - '>='
|
217
217
|
- !ruby/object:Gem::Version
|
218
|
-
version:
|
218
|
+
version: '0'
|
219
219
|
requirements: []
|
220
220
|
rubyforge_project:
|
221
221
|
rubygems_version: 2.0.2
|