groonga-client 0.6.0 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +47 -0
- data/groonga-client.gemspec +3 -2
- data/lib/groonga/client/command-line/groonga-client.rb +29 -2
- data/lib/groonga/client/protocol/http/synchronous.rb +45 -14
- data/lib/groonga/client/request/select.rb +1 -1
- data/lib/groonga/client/response.rb +3 -1
- data/lib/groonga/client/response/base.rb +41 -0
- data/lib/groonga/client/response/drilldownable.rb +85 -0
- data/lib/groonga/client/response/logical-range-filter.rb +52 -0
- data/lib/groonga/client/response/logical-select.rb +28 -0
- data/lib/groonga/client/response/searchable.rb +97 -0
- data/lib/groonga/client/response/select.rb +64 -125
- data/lib/groonga/client/version.rb +2 -2
- data/test/request/test-select.rb +2 -2
- data/test/response/test-select-command-version1.rb +58 -12
- data/test/response/test-select-command-version3.rb +54 -8
- data/test/response/test-select-tsv.rb +26 -4
- data/test/response/test-select-xml.rb +26 -4
- metadata +47 -30
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2013-
|
1
|
+
# Copyright (C) 2013-2020 Sutou Kouhei <kou@clear-code.com>
|
2
2
|
# Copyright (C) 2013 Kosuke Asami
|
3
3
|
# Copyright (C) 2016 Masafumi Yokoyama <yokoyama@clear-code.com>
|
4
4
|
#
|
@@ -284,6 +284,7 @@ class TestResponseSelectCommandVersion3 < Test::Unit::TestCase
|
|
284
284
|
def setup
|
285
285
|
pair_arguments = {
|
286
286
|
"slices[groonga].filter" => 'tag @ "groonga"',
|
287
|
+
"slices[groonga].drilldowns[author].keys" => "author",
|
287
288
|
}
|
288
289
|
@command = Groonga::Command::Select.new("select", pair_arguments)
|
289
290
|
@body = {
|
@@ -319,7 +320,36 @@ class TestResponseSelectCommandVersion3 < Test::Unit::TestCase
|
|
319
320
|
"records" => [
|
320
321
|
[1, "groonga"],
|
321
322
|
[3, "groonga"],
|
322
|
-
]
|
323
|
+
],
|
324
|
+
"drilldowns" => {
|
325
|
+
"author" => {
|
326
|
+
"n_hits" => 3,
|
327
|
+
"columns" => [
|
328
|
+
{
|
329
|
+
"name" => "_key",
|
330
|
+
"type" => "ShortText",
|
331
|
+
},
|
332
|
+
{
|
333
|
+
"name" => "_nsubrecs",
|
334
|
+
"type" => "Int32",
|
335
|
+
},
|
336
|
+
],
|
337
|
+
"records" => [
|
338
|
+
[
|
339
|
+
"Alice",
|
340
|
+
1,
|
341
|
+
],
|
342
|
+
[
|
343
|
+
"Bob",
|
344
|
+
1,
|
345
|
+
],
|
346
|
+
[
|
347
|
+
"Chris",
|
348
|
+
1,
|
349
|
+
],
|
350
|
+
],
|
351
|
+
},
|
352
|
+
},
|
323
353
|
}
|
324
354
|
}
|
325
355
|
}
|
@@ -327,12 +357,21 @@ class TestResponseSelectCommandVersion3 < Test::Unit::TestCase
|
|
327
357
|
|
328
358
|
def test_slices
|
329
359
|
assert_equal({
|
330
|
-
"groonga" =>
|
331
|
-
|
332
|
-
|
333
|
-
|
360
|
+
"groonga" => {
|
361
|
+
records: [
|
362
|
+
{"_id" => 1, "tag" => "groonga"},
|
363
|
+
{"_id" => 3, "tag" => "groonga"},
|
364
|
+
],
|
365
|
+
drilldowns: {
|
366
|
+
"author" => [
|
367
|
+
{"_key" => "Alice", "_nsubrecs" => 1},
|
368
|
+
{"_key" => "Bob", "_nsubrecs" => 1},
|
369
|
+
{"_key" => "Chris", "_nsubrecs" => 1},
|
370
|
+
],
|
371
|
+
},
|
372
|
+
},
|
334
373
|
},
|
335
|
-
collect_values(@body
|
374
|
+
collect_values(@body))
|
336
375
|
end
|
337
376
|
|
338
377
|
private
|
@@ -343,7 +382,14 @@ class TestResponseSelectCommandVersion3 < Test::Unit::TestCase
|
|
343
382
|
def collect_values(body)
|
344
383
|
values = {}
|
345
384
|
slices(body).each do |label, slice|
|
346
|
-
|
385
|
+
drilldowns = {}
|
386
|
+
slice.drilldowns.each do |drilldown_label, drilldown|
|
387
|
+
drilldowns[drilldown_label] = drilldown.records
|
388
|
+
end
|
389
|
+
values[label] = {
|
390
|
+
records: slice.records,
|
391
|
+
drilldowns: drilldowns,
|
392
|
+
}
|
347
393
|
end
|
348
394
|
values
|
349
395
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2018 Kouhei
|
1
|
+
# Copyright (C) 2018-2019 Sutou Kouhei <kou@clear-code.com>
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -19,8 +19,18 @@ require "response/helper"
|
|
19
19
|
class TestResponseSelectTSV < Test::Unit::TestCase
|
20
20
|
include TestResponseHelper
|
21
21
|
|
22
|
-
def drilldown(
|
23
|
-
|
22
|
+
def drilldown(label,
|
23
|
+
keys,
|
24
|
+
n_hits,
|
25
|
+
records,
|
26
|
+
raw_columns,
|
27
|
+
raw_records)
|
28
|
+
Groonga::Client::Response::Select::Drilldown.new(label,
|
29
|
+
keys,
|
30
|
+
n_hits,
|
31
|
+
records,
|
32
|
+
raw_columns,
|
33
|
+
raw_records)
|
24
34
|
end
|
25
35
|
|
26
36
|
def test_error
|
@@ -113,7 +123,19 @@ END
|
|
113
123
|
:elapsed_time => 0.0,
|
114
124
|
:records => [],
|
115
125
|
:drilldowns => [
|
116
|
-
drilldown("version",
|
126
|
+
drilldown("version",
|
127
|
+
["version"],
|
128
|
+
7,
|
129
|
+
drilldown_records,
|
130
|
+
[
|
131
|
+
["_key", "ShortText"],
|
132
|
+
["_nsubrecs", "UInt32"],
|
133
|
+
],
|
134
|
+
[
|
135
|
+
["2.2.0", "18044"],
|
136
|
+
["2.3.0", "18115"],
|
137
|
+
["2.4.0", "14594"],
|
138
|
+
]),
|
117
139
|
],
|
118
140
|
},
|
119
141
|
{
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2017 Kouhei
|
1
|
+
# Copyright (C) 2017-2019 Sutou Kouhei <kou@clear-code.com>
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -19,8 +19,18 @@ require "response/helper"
|
|
19
19
|
class TestResponseSelectXML < Test::Unit::TestCase
|
20
20
|
include TestResponseHelper
|
21
21
|
|
22
|
-
def drilldown(
|
23
|
-
|
22
|
+
def drilldown(label,
|
23
|
+
keys,
|
24
|
+
n_hits,
|
25
|
+
records,
|
26
|
+
raw_columns,
|
27
|
+
raw_records)
|
28
|
+
Groonga::Client::Response::Select::Drilldown.new(label,
|
29
|
+
keys,
|
30
|
+
n_hits,
|
31
|
+
records,
|
32
|
+
raw_columns,
|
33
|
+
raw_records)
|
24
34
|
end
|
25
35
|
|
26
36
|
def test_basic
|
@@ -91,7 +101,19 @@ class TestResponseSelectXML < Test::Unit::TestCase
|
|
91
101
|
:elapsed_time => 0.0,
|
92
102
|
:records => [],
|
93
103
|
:drilldowns => [
|
94
|
-
drilldown("version",
|
104
|
+
drilldown("version",
|
105
|
+
["version"],
|
106
|
+
7,
|
107
|
+
drilldown_records,
|
108
|
+
[
|
109
|
+
["_key", "ShortText"],
|
110
|
+
["_nsubrecs", "ShortText"],
|
111
|
+
],
|
112
|
+
[
|
113
|
+
["2.2.0", "18044"],
|
114
|
+
["2.3.0", "18115"],
|
115
|
+
["2.4.0", "14594"],
|
116
|
+
]),
|
95
117
|
],
|
96
118
|
},
|
97
119
|
{
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groonga-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Haruka Yoshihara
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-03-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: gqtp
|
@@ -32,14 +32,14 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 1.
|
35
|
+
version: 1.4.7
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 1.
|
42
|
+
version: 1.4.7
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: groonga-command-parser
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -68,6 +68,20 @@ dependencies:
|
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: rexml
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
type: :runtime
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
71
85
|
- !ruby/object:Gem::Dependency
|
72
86
|
name: bundler
|
73
87
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,6 +223,7 @@ files:
|
|
209
223
|
- lib/groonga/client/response/column-rename.rb
|
210
224
|
- lib/groonga/client/response/defrag.rb
|
211
225
|
- lib/groonga/client/response/delete.rb
|
226
|
+
- lib/groonga/client/response/drilldownable.rb
|
212
227
|
- lib/groonga/client/response/dump.rb
|
213
228
|
- lib/groonga/client/response/error.rb
|
214
229
|
- lib/groonga/client/response/load.rb
|
@@ -216,9 +231,12 @@ files:
|
|
216
231
|
- lib/groonga/client/response/log-level.rb
|
217
232
|
- lib/groonga/client/response/log-put.rb
|
218
233
|
- lib/groonga/client/response/log-reopen.rb
|
234
|
+
- lib/groonga/client/response/logical-range-filter.rb
|
235
|
+
- lib/groonga/client/response/logical-select.rb
|
219
236
|
- lib/groonga/client/response/quit.rb
|
220
237
|
- lib/groonga/client/response/register.rb
|
221
238
|
- lib/groonga/client/response/schema.rb
|
239
|
+
- lib/groonga/client/response/searchable.rb
|
222
240
|
- lib/groonga/client/response/select.rb
|
223
241
|
- lib/groonga/client/response/status.rb
|
224
242
|
- lib/groonga/client/response/table-create.rb
|
@@ -282,43 +300,42 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
300
|
- !ruby/object:Gem::Version
|
283
301
|
version: '0'
|
284
302
|
requirements: []
|
285
|
-
|
286
|
-
rubygems_version: 3.0.0.beta1
|
303
|
+
rubygems_version: 3.3.0.dev
|
287
304
|
signing_key:
|
288
305
|
specification_version: 4
|
289
306
|
summary: Groonga-client is a client for Groonga (http://groonga.org/) implemented
|
290
307
|
with pure Ruby. You can use it without Groonga.
|
291
308
|
test_files:
|
292
|
-
- test/
|
293
|
-
- test/
|
309
|
+
- test/command-line/helper.rb
|
310
|
+
- test/command-line/test-index-check.rb
|
311
|
+
- test/command-line/test-index-recreate.rb
|
294
312
|
- test/protocol/test-gqtp.rb
|
295
|
-
- test/
|
296
|
-
- test/
|
297
|
-
- test/
|
298
|
-
- test/
|
299
|
-
- test/
|
300
|
-
- test/
|
301
|
-
- test/
|
302
|
-
- test/
|
303
|
-
- test/
|
313
|
+
- test/protocol/test-http.rb
|
314
|
+
- test/request/select/test-backward-compatible-sort-keys-parameter.rb
|
315
|
+
- test/request/select/test-filter.rb
|
316
|
+
- test/request/select/test-output-columns-parameter.rb
|
317
|
+
- test/request/select/test-scorer.rb
|
318
|
+
- test/request/select/test-sort-keys-parameter.rb
|
319
|
+
- test/request/select/test-values-parameter.rb
|
320
|
+
- test/request/test-generic.rb
|
321
|
+
- test/request/test-merger.rb
|
322
|
+
- test/request/test-select.rb
|
304
323
|
- test/response/helper.rb
|
305
324
|
- test/response/test-base.rb
|
325
|
+
- test/response/test-column-list.rb
|
326
|
+
- test/response/test-error.rb
|
327
|
+
- test/response/test-load.rb
|
328
|
+
- test/response/test-schema.rb
|
306
329
|
- test/response/test-select-command-version1.rb
|
330
|
+
- test/response/test-select-command-version3.rb
|
331
|
+
- test/response/test-select-tsv.rb
|
332
|
+
- test/response/test-select-xml.rb
|
307
333
|
- test/response/test-status.rb
|
308
334
|
- test/response/test-table-create.rb
|
335
|
+
- test/response/test-table-list.rb
|
336
|
+
- test/response/test-table-remove.rb
|
309
337
|
- test/results/test-table-list.rb
|
310
|
-
- test/test-command.rb
|
311
338
|
- test/run-test.rb
|
312
|
-
- test/request/test-generic.rb
|
313
|
-
- test/request/select/test-values-parameter.rb
|
314
|
-
- test/request/select/test-output-columns-parameter.rb
|
315
|
-
- test/request/select/test-scorer.rb
|
316
|
-
- test/request/select/test-backward-compatible-sort-keys-parameter.rb
|
317
|
-
- test/request/select/test-filter.rb
|
318
|
-
- test/request/select/test-sort-keys-parameter.rb
|
319
|
-
- test/request/test-select.rb
|
320
|
-
- test/request/test-merger.rb
|
321
339
|
- test/test-client.rb
|
322
|
-
- test/
|
323
|
-
- test/
|
324
|
-
- test/command-line/test-index-check.rb
|
340
|
+
- test/test-command.rb
|
341
|
+
- test/test-script-syntax.rb
|