groonga-command 1.4.2 → 1.4.3
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/doc/text/news.md +10 -0
- data/lib/groonga/command/base.rb +13 -6
- data/lib/groonga/command/dump.rb +3 -1
- data/lib/groonga/command/load.rb +3 -1
- data/lib/groonga/command/logical-range-filter.rb +29 -1
- data/lib/groonga/command/object-remove.rb +3 -1
- data/lib/groonga/command/version.rb +1 -1
- data/test/command/test-logical-range-filter.rb +69 -22
- metadata +46 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b4f9e1034bd01512b802d2bb3e40cb35365b51379d5ce8d88c121b388d64ca0
|
4
|
+
data.tar.gz: 91d75b6923d074a9e469524301c5dd970a0aa1068beedd351ae64e6a5591a715
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f384098ada70451a767d8c0b662b6906b5c4fce5bd90073275b3330d7d2a1118f9fb8e05da959855920fc7b1a960b25349548f655f80408e581b6240b741e6f6
|
7
|
+
data.tar.gz: d9bb4dd1c5ab2a842ead8f94a29142222164e8f8d4b9aedd8f3985658482b435b26b6bfcc47b9373b2ddba9a459c1d8d28a0dcf015de47012a583f20fbe188c6
|
data/doc/text/news.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 1.4.3: 2019-09-02
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* {Groonga::Command::LogicalRangeFilter#use_range_index}: Added.
|
8
|
+
|
9
|
+
* {Groonga::Command::LogicalRangeFilter#post_filter}: Added.
|
10
|
+
|
11
|
+
* {Groonga::Command::LogicalRangeFilter#sort_keys}: Added.
|
12
|
+
|
3
13
|
## 1.4.2: 2019-08-21
|
4
14
|
|
5
15
|
### Improvements
|
data/lib/groonga/command/base.rb
CHANGED
@@ -232,15 +232,22 @@ module Groonga
|
|
232
232
|
value.strip.split(/\s*[| ]\s*/)
|
233
233
|
end
|
234
234
|
|
235
|
-
def boolean_value(name,
|
236
|
-
parse_boolean_value(self[name],
|
235
|
+
def boolean_value(name, **keyword_args)
|
236
|
+
parse_boolean_value(self[name], **keyword_args)
|
237
237
|
end
|
238
238
|
|
239
|
-
def parse_boolean_value(value,
|
240
|
-
return
|
239
|
+
def parse_boolean_value(value, default:, invalid:)
|
240
|
+
return default if value.nil?
|
241
241
|
value = value.strip
|
242
|
-
return
|
243
|
-
value
|
242
|
+
return default if value.empty?
|
243
|
+
case value
|
244
|
+
when "yes"
|
245
|
+
true
|
246
|
+
when "no"
|
247
|
+
false
|
248
|
+
else
|
249
|
+
invalid
|
250
|
+
end
|
244
251
|
end
|
245
252
|
end
|
246
253
|
end
|
data/lib/groonga/command/dump.rb
CHANGED
data/lib/groonga/command/load.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Copyright (C) 2015 Hiroshi Hatake <hatake@clear-code.com>
|
2
|
-
# Copyright (C) 2018 Kouhei Sutou <kou@clear-code.com>
|
2
|
+
# Copyright (C) 2018-2019 Kouhei Sutou <kou@clear-code.com>
|
3
|
+
# Copyright (C) 2019 Yasuhiro Horimoto <horimoto@clear-code.com>
|
3
4
|
#
|
4
5
|
# This library is free software; you can redistribute it and/or
|
5
6
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -44,6 +45,9 @@ module Groonga
|
|
44
45
|
:limit,
|
45
46
|
:filter,
|
46
47
|
:output_columns,
|
48
|
+
:use_range_index,
|
49
|
+
:post_filter,
|
50
|
+
:sort_keys,
|
47
51
|
]
|
48
52
|
end
|
49
53
|
end
|
@@ -130,6 +134,30 @@ module Groonga
|
|
130
134
|
def output_columns
|
131
135
|
self[:output_columns]
|
132
136
|
end
|
137
|
+
|
138
|
+
# @return [Boolean, nil] Whether force to use or not use range index.
|
139
|
+
# `nil` means that decided whether use range index automatically.
|
140
|
+
#
|
141
|
+
# @since 1.4.3
|
142
|
+
def use_range_index
|
143
|
+
boolean_value(:use_range_index,
|
144
|
+
default: nil,
|
145
|
+
invalid: nil)
|
146
|
+
end
|
147
|
+
|
148
|
+
# @return [String] `post_filter` parameter value.
|
149
|
+
#
|
150
|
+
# @since 1.4.3
|
151
|
+
def post_filter
|
152
|
+
self[:post_filter]
|
153
|
+
end
|
154
|
+
|
155
|
+
# @return [::Array<String>] The sort keys.
|
156
|
+
#
|
157
|
+
# @since 1.4.3
|
158
|
+
def sort_keys
|
159
|
+
parse_array_value(self[:sort_keys] || "")
|
160
|
+
end
|
133
161
|
end
|
134
162
|
end
|
135
163
|
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
# Copyright (C) 2015 Hiroshi Hatake <hatake@clear-code.com>
|
2
|
+
# Copyright (C) 2019 Yasuhiro Horimoto <horimoto@clear-code.com>
|
3
|
+
# Copyright (C) 2019 Sutou Kouhei <kou@clear-code.com>
|
2
4
|
#
|
3
5
|
# This library is free software; you can redistribute it and/or
|
4
6
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -23,17 +25,20 @@ class LogicalRangeFilterCommandTest < Test::Unit::TestCase
|
|
23
25
|
|
24
26
|
class ConstructorTest < self
|
25
27
|
def test_ordered_arguments
|
26
|
-
logical_table
|
27
|
-
shard_key
|
28
|
-
min
|
29
|
-
min_border
|
30
|
-
max
|
31
|
-
max_border
|
32
|
-
order
|
33
|
-
offset
|
34
|
-
limit
|
35
|
-
filter
|
36
|
-
output_columns
|
28
|
+
logical_table = "Logs"
|
29
|
+
shard_key = "timestamp",
|
30
|
+
min = "2015-02-12 00:00:00"
|
31
|
+
min_border = "include"
|
32
|
+
max = "2015-02-13 00:00:00"
|
33
|
+
max_border = "exclude"
|
34
|
+
order = "ascending"
|
35
|
+
offset = "10"
|
36
|
+
limit = "20"
|
37
|
+
filter = "value == 10"
|
38
|
+
output_columns = "_key, timestamp"
|
39
|
+
use_range_index = "yes"
|
40
|
+
post_filter = "_score > 10"
|
41
|
+
sort_keys = "timestamp, -_score"
|
37
42
|
|
38
43
|
ordered_arguments = [
|
39
44
|
logical_table,
|
@@ -47,20 +52,26 @@ class LogicalRangeFilterCommandTest < Test::Unit::TestCase
|
|
47
52
|
limit,
|
48
53
|
filter,
|
49
54
|
output_columns,
|
55
|
+
use_range_index,
|
56
|
+
post_filter,
|
57
|
+
sort_keys,
|
50
58
|
]
|
51
59
|
command = logical_range_filter_command({}, ordered_arguments)
|
52
60
|
assert_equal({
|
53
|
-
:logical_table
|
54
|
-
:shard_key
|
55
|
-
:min
|
56
|
-
:min_border
|
57
|
-
:max
|
58
|
-
:max_border
|
59
|
-
:order
|
60
|
-
:offset
|
61
|
-
:limit
|
62
|
-
:filter
|
63
|
-
:output_columns
|
61
|
+
:logical_table => logical_table,
|
62
|
+
:shard_key => shard_key,
|
63
|
+
:min => min,
|
64
|
+
:min_border => min_border,
|
65
|
+
:max => max,
|
66
|
+
:max_border => max_border,
|
67
|
+
:order => order,
|
68
|
+
:offset => offset,
|
69
|
+
:limit => limit,
|
70
|
+
:filter => filter,
|
71
|
+
:output_columns => output_columns,
|
72
|
+
:use_range_index => use_range_index,
|
73
|
+
:post_filter => post_filter,
|
74
|
+
:sort_keys => sort_keys,
|
64
75
|
},
|
65
76
|
command.arguments)
|
66
77
|
end
|
@@ -135,4 +146,40 @@ class LogicalRangeFilterCommandTest < Test::Unit::TestCase
|
|
135
146
|
assert_equal("_key, timestamp", command.output_columns)
|
136
147
|
end
|
137
148
|
end
|
149
|
+
|
150
|
+
class UseRangeIndexTest < self
|
151
|
+
def test_yes
|
152
|
+
command = logical_range_filter_command(:use_range_index => "yes")
|
153
|
+
assert_true(command.use_range_index)
|
154
|
+
end
|
155
|
+
|
156
|
+
def test_no
|
157
|
+
command = logical_range_filter_command(:use_range_index => "no")
|
158
|
+
assert_false(command.use_range_index)
|
159
|
+
end
|
160
|
+
|
161
|
+
def test_default
|
162
|
+
command = logical_range_filter_command
|
163
|
+
assert_nil(command.use_range_index)
|
164
|
+
end
|
165
|
+
|
166
|
+
def test_invalid
|
167
|
+
command = logical_range_filter_command(:use_range_index => "invalid")
|
168
|
+
assert_nil(command.use_range_index)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
class PostFilterTest < self
|
173
|
+
def test_reader
|
174
|
+
command = logical_range_filter_command(:post_filter => "_score > 10")
|
175
|
+
assert_equal("_score > 10", command.post_filter)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
class SortKeysTest < self
|
180
|
+
def test_reader
|
181
|
+
command = logical_range_filter_command(:sort_keys => "timestamp, -_score")
|
182
|
+
assert_equal(["timestamp", "-_score"], command.sort_keys)
|
183
|
+
end
|
184
|
+
end
|
138
185
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groonga-command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -271,65 +271,66 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
271
|
- !ruby/object:Gem::Version
|
272
272
|
version: '0'
|
273
273
|
requirements: []
|
274
|
-
|
274
|
+
rubyforge_project:
|
275
|
+
rubygems_version: 2.7.6.2
|
275
276
|
signing_key:
|
276
277
|
specification_version: 4
|
277
278
|
summary: Groonga-command is a library that represents [Groonga](http://groonga.org/)'s
|
278
279
|
command. You can write a program that handle Groonga's command by using groonga-command.
|
279
280
|
test_files:
|
280
281
|
- test/run-test.rb
|
281
|
-
- test/command/test-
|
282
|
-
- test/command/test-reindex.rb
|
282
|
+
- test/command/test-range-filter.rb
|
283
283
|
- test/command/test-column-rename.rb
|
284
|
-
- test/command/test-
|
285
|
-
- test/command/test-
|
286
|
-
- test/command/test-
|
284
|
+
- test/command/test-object-exist.rb
|
285
|
+
- test/command/test-config-get.rb
|
286
|
+
- test/command/test-table-create.rb
|
287
|
+
- test/command/test-plugin-register.rb
|
288
|
+
- test/command/test-query-log-flags-remove.rb
|
289
|
+
- test/command/format/test-command.rb
|
290
|
+
- test/command/test-table-rename.rb
|
291
|
+
- test/command/test-truncate.rb
|
292
|
+
- test/command/test-log-put.rb
|
287
293
|
- test/command/test-query-log-flags-get.rb
|
288
|
-
- test/command/test-
|
289
|
-
- test/command/test-log-level.rb
|
290
|
-
- test/command/test-table-tokenize.rb
|
291
|
-
- test/command/test-logical-select.rb
|
292
|
-
- test/command/test-column-list.rb
|
293
|
-
- test/command/test-status.rb
|
294
|
-
- test/command/test-load.rb
|
295
|
-
- test/command/test-table-remove.rb
|
296
|
-
- test/command/test-index-column-diff.rb
|
297
|
-
- test/command/test-suggest.rb
|
298
|
-
- test/command/test-delete.rb
|
294
|
+
- test/command/test-query-log-flags-set.rb
|
299
295
|
- test/command/test-logical-range-filter.rb
|
300
|
-
- test/command/test-column-
|
301
|
-
- test/command/test-
|
302
|
-
- test/command/test-table-create.rb
|
303
|
-
- test/command/test-table-list.rb
|
304
|
-
- test/command/test-select.rb
|
296
|
+
- test/command/test-column-list.rb
|
297
|
+
- test/command/test-ruby-load.rb
|
305
298
|
- test/command/test-query-log-flags-add.rb
|
299
|
+
- test/command/test-table-copy.rb
|
306
300
|
- test/command/test-config-delete.rb
|
301
|
+
- test/command/test-logical-select.rb
|
302
|
+
- test/command/test-tokenize.rb
|
303
|
+
- test/command/test-table-tokenize.rb
|
304
|
+
- test/command/test-request-cancel.rb
|
305
|
+
- test/command/test-column-copy.rb
|
306
|
+
- test/command/test-suggest.rb
|
307
|
+
- test/command/test-column-remove.rb
|
308
|
+
- test/command/test-object-remove.rb
|
309
|
+
- test/command/test-logical-shard-list.rb
|
310
|
+
- test/command/test-column-create.rb
|
307
311
|
- test/command/test-get.rb
|
308
|
-
- test/command/test-
|
309
|
-
- test/command/test-
|
310
|
-
- test/command/
|
311
|
-
- test/command/test-shutdown.rb
|
312
|
+
- test/command/test-load.rb
|
313
|
+
- test/command/test-reindex.rb
|
314
|
+
- test/command/test-plugin-unregister.rb
|
312
315
|
- test/command/test-io-flush.rb
|
316
|
+
- test/command/test-logical-table-remove.rb
|
317
|
+
- test/command/test-index-column-diff.rb
|
318
|
+
- test/command/test-register.rb
|
319
|
+
- test/command/test-object-inspect.rb
|
320
|
+
- test/command/test-delete.rb
|
313
321
|
- test/command/test-query-expand.rb
|
314
|
-
- test/command/test-
|
315
|
-
- test/command/test-
|
316
|
-
- test/command/test-query-log-flags-remove.rb
|
317
|
-
- test/command/test-object-remove.rb
|
318
|
-
- test/command/test-logical-count.rb
|
322
|
+
- test/command/test-table-list.rb
|
323
|
+
- test/command/test-status.rb
|
319
324
|
- test/command/test-thread-limit.rb
|
320
|
-
- test/command/test-column-remove.rb
|
321
|
-
- test/command/test-table-copy.rb
|
322
|
-
- test/command/test-ruby-load.rb
|
323
|
-
- test/command/test-object-inspect.rb
|
324
|
-
- test/command/test-plugin-unregister.rb
|
325
|
-
- test/command/test-table-rename.rb
|
326
|
-
- test/command/test-truncate.rb
|
327
|
-
- test/command/test-tokenize.rb
|
328
325
|
- test/command/test-config-set.rb
|
329
|
-
- test/command/test-
|
326
|
+
- test/command/test-log-level.rb
|
327
|
+
- test/command/test-shutdown.rb
|
330
328
|
- test/command/test-ruby-eval.rb
|
331
|
-
- test/command/test-register.rb
|
332
|
-
- test/command/test-dump.rb
|
333
|
-
- test/command/test-column-create.rb
|
334
329
|
- test/command/test-schema.rb
|
330
|
+
- test/command/test-normalize.rb
|
331
|
+
- test/command/test-dump.rb
|
332
|
+
- test/command/test-base.rb
|
333
|
+
- test/command/test-logical-count.rb
|
334
|
+
- test/command/test-table-remove.rb
|
335
|
+
- test/command/test-select.rb
|
335
336
|
- test/groonga-command-test-utils.rb
|