elasticsearch-dsl 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 214d122f8284a2f16c8a4f7b25f79c66cc00709a
4
- data.tar.gz: 0078e5c6780db602dd4a3f62440936b62c4e5be1
3
+ metadata.gz: 055ca5865485c8f28e21edaab8e8cdf51d3f066b
4
+ data.tar.gz: 12b1be97400b1f7b4f0bca1ddb8b77731a7c6ef4
5
5
  SHA512:
6
- metadata.gz: 4bbab1d893ef8f3c87124ffff05eabbd4b753cea14c873f32fa9f0be6c6915a3cceb2420a7f3f0f077ffbb07a9d49861265ad27f70b7666ddbf763ad261ab00a
7
- data.tar.gz: cb83c0175650f244c779d31e387596eb5b193f267aaff125c4579082495c0bb4e61d597c2661141ae1bd3c245bc1da58ae96a40786db8d56587df714769d95e0
6
+ metadata.gz: 091cda1600fb6848d0f1ebfc7be9fde2220f2600d073b896b37a091887527212f2506860f7dc9b1a6bf02e0271479dc46ab4cb8df9e8e7db9e806aa006cc2c36
7
+ data.tar.gz: f6afafb234bbad0efbd2f82a7da7d02766206d8b757e824f8dd17de2c1438db2e8d146c15ea424dc73fdf4609a59bab927720b6d6a3619baf4536f9cad1f1e04
@@ -38,7 +38,7 @@ module Elasticsearch
38
38
  attr_reader :aggregations
39
39
 
40
40
  def initialize(*args, &block)
41
- @options = Options.new
41
+ @options = Options.new *args
42
42
  instance_eval(&block) if block
43
43
  end
44
44
 
@@ -31,6 +31,7 @@ module Elasticsearch
31
31
  option_method :lt
32
32
  option_method :boost
33
33
  option_method :time_zone
34
+ option_method :format
34
35
  end
35
36
 
36
37
  end
@@ -26,6 +26,7 @@ module Elasticsearch
26
26
  option_method :operator
27
27
  option_method :type
28
28
  option_method :boost
29
+ option_method :fuzziness
29
30
  end
30
31
 
31
32
  end
@@ -39,6 +39,7 @@ module Elasticsearch
39
39
  option_method :lt
40
40
  option_method :boost
41
41
  option_method :time_zone
42
+ option_method :format
42
43
  end
43
44
 
44
45
  end
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module DSL
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -19,8 +19,9 @@ module Elasticsearch
19
19
  subject.gte 'bar'
20
20
  subject.lte 'bar'
21
21
  subject.time_zone 'bar'
22
+ subject.format 'bar'
22
23
 
23
- assert_equal %w[ gte lte time_zone ],
24
+ assert_equal %w[ format gte lte time_zone ],
24
25
  subject.to_hash[:range][:foo].keys.map(&:to_s).sort
25
26
 
26
27
  assert_equal 'bar', subject.to_hash[:range][:foo][:gte]
@@ -39,13 +39,14 @@ module Elasticsearch
39
39
 
40
40
  should "take a block" do
41
41
  subject = Match.new :message do
42
- query 'test'
43
- operator 'and'
44
- type 'phrase_prefix'
45
- boost 2
42
+ query 'test'
43
+ operator 'and'
44
+ type 'phrase_prefix'
45
+ boost 2
46
+ fuzziness 'AUTO'
46
47
  end
47
48
 
48
- assert_equal({match: {message: {query: "test", operator: "and", type: 'phrase_prefix', boost: 2}}},
49
+ assert_equal({match: {message: {query: "test", operator: "and", type: 'phrase_prefix', boost: 2, fuzziness: 'AUTO'}}},
49
50
  subject.to_hash)
50
51
  end
51
52
 
@@ -19,17 +19,19 @@ module Elasticsearch
19
19
  gte 10
20
20
  lte 20
21
21
  boost 2
22
+ format 'mm/dd/yyyy'
22
23
  end
23
24
 
24
- assert_equal({:range=>{:age=>{:gte=>10, :lte=>20, :boost=>2}}}, @subject.to_hash)
25
+ assert_equal({:range=>{:age=>{:gte=>10, :lte=>20, :boost=>2, :format=>'mm/dd/yyyy'}}}, @subject.to_hash)
25
26
  end
26
27
 
27
28
  should "take a method call" do
28
29
  @subject = Range.new :age
29
30
  @subject.gte 10
30
31
  @subject.lte 20
32
+ @subject.format 'mm/dd/yyyy'
31
33
 
32
- assert_equal({:range=>{:age=>{:gte=>10, :lte=>20}}}, @subject.to_hash)
34
+ assert_equal({:range=>{:age=>{:gte=>10, :lte=>20, :format=>'mm/dd/yyyy'}}}, @subject.to_hash)
33
35
  end
34
36
 
35
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2015-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler