elasticsearch-explain-response 0.0.3 → 0.0.4
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f25f7c2844dcc655da1aba48907e8bf5d195202f
|
|
4
|
+
data.tar.gz: 8cae38ace76385a9d0a22e93b561b0938f952b86
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c18a63a09bfec6a3e1603d06f6af49bb9d69086d8ac1b6f2ad9f90c611568007644980a96cbdde9ced14aa56a0f7efba9b6985b4aa811adc705873c54b7bcd0c
|
|
7
|
+
data.tar.gz: 2029b5396d5a7f62ca6f2bc4bb6791012e2440b2487b473c1d1d6c94a5e2e31c8755c7be6e6e3105113d3464a03ca7b28be2514d32d72971e4b5623a78124bd2
|
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "elasticsearch-explain-response"
|
|
7
|
-
spec.version = "0.0.
|
|
7
|
+
spec.version = "0.0.4"
|
|
8
8
|
spec.authors = ["Tomoya Hirano"]
|
|
9
9
|
spec.email = ["hiranotomoya@gmail.com"]
|
|
10
10
|
spec.summary = %q{Parser for Elasticserach Explain response}
|
|
@@ -45,7 +45,7 @@ module Elasticsearch
|
|
|
45
45
|
type = "score"
|
|
46
46
|
operation = "score"
|
|
47
47
|
operator = "x"
|
|
48
|
-
when /\Amatch filter\: (?:cache\()?(?:(?<op
|
|
48
|
+
when /\Amatch filter\: (?:cache\()?(?:(?<op>[\w]+)\()*(?<f>.+)\:(?<v>[^\)]+)\)*\z/
|
|
49
49
|
type = "match"
|
|
50
50
|
operation = "match"
|
|
51
51
|
operation += ".#{$~[:op]}" if $~[:op] && !%w[QueryWrapperFilter].include?($~[:op])
|
|
@@ -45,7 +45,7 @@ describe Elasticsearch::API::Response::ExplainResponse do
|
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
it "returns summary of explain in line" do
|
|
48
|
-
expect(subject).to eq("887.19 = ((10.0(match(name:hawaii)) x 10.0(match(name:guam)) x 3.0(match(with_beach:T)) x 0.99(func(updated_at)) x 3.0(match(region_id:[3 TO 3]))) min 3.4e+38) x 1.0(queryBoost)")
|
|
48
|
+
expect(subject).to eq("887.19 = ((10.0(match(name:hawaii)) x 10.0(match(name:guam)) x 0.7(match(name:\"new caledonia\" (+(name:new name:nueva) +name:caledonia)) x 3.0(match(with_beach:T)) x 0.99(func(updated_at)) x 3.0(match(region_id:[3 TO 3]))) min 3.4e+38) x 1.0(queryBoost)")
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
end
|
data/spec/fixtures/response2.yml
CHANGED
|
@@ -33,6 +33,16 @@ explanation:
|
|
|
33
33
|
details:
|
|
34
34
|
- value: 10.0
|
|
35
35
|
description: "boostFactor"
|
|
36
|
+
- value: 1.0
|
|
37
|
+
description: "function score, product of:"
|
|
38
|
+
details:
|
|
39
|
+
- value: 1.0
|
|
40
|
+
description: "match filter: QueryWrapperFilter(name:\"new caledonia\" (+(name:new name:nueva) +name:caledonia))"
|
|
41
|
+
- value: 0.7
|
|
42
|
+
description: "static boost factor"
|
|
43
|
+
details:
|
|
44
|
+
- value: 0.7
|
|
45
|
+
description: "boostFactor"
|
|
36
46
|
- value: 3.0
|
|
37
47
|
description: "function score, product of:"
|
|
38
48
|
details:
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: elasticsearch-explain-response
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tomoya Hirano
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-06-
|
|
11
|
+
date: 2015-06-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|