elastic-esql 0.4.0 → 0.5.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/lib/elastic/esql.rb +13 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d816aedd477416a9edcf948d7e19c89212aeca77b79e78cbc20eaf9ccbfc8f07
|
|
4
|
+
data.tar.gz: 7a59bd4340bc1aaac08b12cc54e2da359f67a0604331c29896096452b021086c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c7e3459562b9a4a8d27144b65d63ddd93455b20556f34763381a1a85f776857b4cefa03eb6102276451b71d256ec1221eba6f3265a0ba8bd5ebd018a6bb8225
|
|
7
|
+
data.tar.gz: 0a7073741cc71c28183a9afa9c3ab311bd034bc8c762d58bf530d1ac86f3e0763d0294bdd54e9f93b28eb6817f1115d357892ef88b3eb6bcf9fd8c8789a47b0d
|
data/lib/elastic/esql.rb
CHANGED
|
@@ -29,9 +29,12 @@ require_relative 'grok'
|
|
|
29
29
|
require_relative 'keep'
|
|
30
30
|
require_relative 'lookup_join'
|
|
31
31
|
require_relative 'metadata'
|
|
32
|
+
require_relative 'mv_expand'
|
|
32
33
|
require_relative 'queryable'
|
|
33
34
|
require_relative 'rename'
|
|
35
|
+
require_relative 'rerank'
|
|
34
36
|
require_relative 'row'
|
|
37
|
+
require_relative 'sample'
|
|
35
38
|
require_relative 'show'
|
|
36
39
|
require_relative 'stats'
|
|
37
40
|
require_relative 'ts'
|
|
@@ -44,7 +47,7 @@ module Elastic
|
|
|
44
47
|
class ESQL
|
|
45
48
|
[
|
|
46
49
|
ChangePoint, Custom, Dissect, Drop, Eval, Fork, Fuse, Grok, Keep, LookupJoin, Metadata,
|
|
47
|
-
Queryable, Rename, Row, Show, Stats, TS, Util
|
|
50
|
+
MvExpand, Queryable, Rename, Row, Sample, Show, Stats, TS, Util
|
|
48
51
|
].each { |m| include m }
|
|
49
52
|
|
|
50
53
|
SOURCE_COMMANDS = [:from, :row, :show, :ts].freeze
|
|
@@ -62,6 +65,7 @@ module Elastic
|
|
|
62
65
|
raise ArgumentError, 'No source command found' unless source_command_present?
|
|
63
66
|
|
|
64
67
|
@query[:enrich] = @enriches.map(&:to_query).join('| ') if @enriches
|
|
68
|
+
@query[:rerank] = @rerank.to_query if @rerank
|
|
65
69
|
string_query = build_string_query
|
|
66
70
|
string_query.concat(" #{@custom.join(' ')}") unless @custom.empty?
|
|
67
71
|
string_query
|
|
@@ -77,6 +81,14 @@ module Elastic
|
|
|
77
81
|
enrich
|
|
78
82
|
end
|
|
79
83
|
|
|
84
|
+
# Creates a new Rerank object to chain with +on+ and +with+. If other method is chained to the
|
|
85
|
+
# Rerank object, it calls it upon the ESQL object that instantiated it, and returns it.
|
|
86
|
+
# @return [Elastic::Rerank]
|
|
87
|
+
def rerank(column: nil, query: '')
|
|
88
|
+
@rerank = Rerank.new(self, column: column, query: query)
|
|
89
|
+
@rerank
|
|
90
|
+
end
|
|
91
|
+
|
|
80
92
|
# Class method to allow static instantiation.
|
|
81
93
|
# @param [String] index_pattern A list of indices, data streams or aliases. Supports wildcards and date math.
|
|
82
94
|
# @example
|