rroonga 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +21 -2
- data/bin/grndump +3 -2
- data/ext/groonga/extconf.rb +1 -6
- data/ext/groonga/rb-grn-array.c +58 -31
- data/ext/groonga/rb-grn-column.c +220 -148
- data/ext/groonga/rb-grn-context.c +46 -32
- data/ext/groonga/rb-grn-database.c +102 -90
- data/ext/groonga/rb-grn-double-array-trie.c +205 -163
- data/ext/groonga/rb-grn-encoding-support.c +2 -3
- data/ext/groonga/rb-grn-encoding.c +13 -8
- data/ext/groonga/rb-grn-exception.c +1 -1
- data/ext/groonga/rb-grn-expression.c +110 -133
- data/ext/groonga/rb-grn-fix-size-column.c +5 -4
- data/ext/groonga/rb-grn-geo-point.c +55 -0
- data/ext/groonga/rb-grn-hash.c +120 -82
- data/ext/groonga/rb-grn-index-column.c +66 -70
- data/ext/groonga/rb-grn-index-cursor.c +3 -0
- data/ext/groonga/rb-grn-logger.c +33 -51
- data/ext/groonga/rb-grn-object.c +2 -0
- data/ext/groonga/rb-grn-operator.c +1 -1
- data/ext/groonga/rb-grn-patricia-trie.c +287 -232
- data/ext/groonga/rb-grn-plugin.c +11 -14
- data/ext/groonga/rb-grn-snippet.c +37 -54
- data/ext/groonga/rb-grn-table-cursor-key-support.c +3 -3
- data/ext/groonga/rb-grn-table-cursor.c +8 -6
- data/ext/groonga/rb-grn-table-key-support.c +22 -29
- data/ext/groonga/rb-grn-table.c +355 -279
- data/ext/groonga/rb-grn-type.c +18 -25
- data/ext/groonga/rb-grn-utils.c +77 -7
- data/ext/groonga/rb-grn-variable-size-column.c +12 -20
- data/ext/groonga/rb-grn-view.c +56 -51
- data/ext/groonga/rb-grn.h +28 -1
- data/ext/groonga/rb-groonga.c +1 -0
- data/lib/groonga.rb +2 -0
- data/lib/groonga/command.rb +3 -1
- data/lib/groonga/database.rb +27 -0
- data/lib/groonga/dumper.rb +96 -17
- data/lib/groonga/geo-point.rb +216 -0
- data/lib/groonga/schema.rb +29 -46
- data/rroonga-build.rb +1 -1
- data/rroonga.gemspec +90 -0
- data/test/groonga-test-utils.rb +168 -0
- data/test/run-test.rb +60 -0
- data/test/test-accessor.rb +36 -0
- data/test/test-array.rb +146 -0
- data/test/test-column.rb +350 -0
- data/test/test-command-select.rb +181 -0
- data/test/test-context.rb +130 -0
- data/test/test-database-dumper.rb +259 -0
- data/test/test-database.rb +173 -0
- data/test/test-double-array-trie.rb +189 -0
- data/test/test-encoding.rb +33 -0
- data/test/test-exception.rb +230 -0
- data/test/test-expression-builder.rb +602 -0
- data/test/test-expression.rb +134 -0
- data/test/test-fix-size-column.rb +77 -0
- data/test/test-geo-point.rb +190 -0
- data/test/test-gqtp.rb +70 -0
- data/test/test-hash.rb +367 -0
- data/test/test-index-column.rb +180 -0
- data/test/test-index-cursor.rb +123 -0
- data/test/test-logger.rb +37 -0
- data/test/test-pagination.rb +249 -0
- data/test/test-patricia-trie.rb +440 -0
- data/test/test-plugin.rb +35 -0
- data/test/test-procedure.rb +37 -0
- data/test/test-query-log.rb +258 -0
- data/test/test-record.rb +577 -0
- data/test/test-remote.rb +63 -0
- data/test/test-schema-create-table.rb +267 -0
- data/test/test-schema-dumper.rb +235 -0
- data/test/test-schema-type.rb +208 -0
- data/test/test-schema-view.rb +90 -0
- data/test/test-schema.rb +886 -0
- data/test/test-snippet.rb +130 -0
- data/test/test-table-dumper.rb +353 -0
- data/test/test-table-offset-and-limit.rb +100 -0
- data/test/test-table-select-mecab.rb +80 -0
- data/test/test-table-select-normalize.rb +57 -0
- data/test/test-table-select-weight.rb +123 -0
- data/test/test-table-select.rb +191 -0
- data/test/test-table-traverse.rb +304 -0
- data/test/test-table.rb +711 -0
- data/test/test-type.rb +79 -0
- data/test/test-variable-size-column.rb +147 -0
- data/test/test-variable.rb +28 -0
- data/test/test-vector-column.rb +76 -0
- data/test/test-version.rb +61 -0
- data/test/test-view.rb +72 -0
- metadata +330 -202
data/Rakefile
CHANGED
@@ -74,7 +74,7 @@ module YARD
|
|
74
74
|
module CodeObjects
|
75
75
|
class Proxy
|
76
76
|
alias_method :initialize_original, :initialize
|
77
|
-
def initialize(namespace, name)
|
77
|
+
def initialize(namespace, name, type=nil)
|
78
78
|
name = name.to_s.gsub(/\AGrn(.*)\z/) do
|
79
79
|
suffix = $1
|
80
80
|
case suffix
|
@@ -86,7 +86,7 @@ module YARD
|
|
86
86
|
"Groonga::#{suffix}"
|
87
87
|
end
|
88
88
|
end
|
89
|
-
initialize_original(namespace, name)
|
89
|
+
initialize_original(namespace, name, type)
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
@@ -163,6 +163,23 @@ Rake::ExtensionTask.new("groonga", spec) do |ext|
|
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
166
|
+
file "Makefile" => ["extconf.rb", "ext/groonga/extconf.rb"] do
|
167
|
+
ruby("extconf.rb")
|
168
|
+
end
|
169
|
+
|
170
|
+
desc "Configure"
|
171
|
+
task :configure => "Makefile"
|
172
|
+
|
173
|
+
desc "Build"
|
174
|
+
task :build => :configure do
|
175
|
+
sh("make")
|
176
|
+
end
|
177
|
+
|
178
|
+
desc "Run test"
|
179
|
+
task :test => :configure do
|
180
|
+
ruby("-rubygems", "test/run-test.rb")
|
181
|
+
end
|
182
|
+
|
166
183
|
namespace :test do
|
167
184
|
task :install do
|
168
185
|
gemspec_helper = Rake.application.jeweler.gemspec_helper
|
@@ -174,3 +191,5 @@ namespace :test do
|
|
174
191
|
ruby("-rubygems", "#{installed_path}/test/run-test.rb")
|
175
192
|
end
|
176
193
|
end
|
194
|
+
|
195
|
+
task :default => :test
|
data/bin/grndump
CHANGED
@@ -69,7 +69,7 @@ option_parser = OptionParser.new do |parser|
|
|
69
69
|
parser.on("--order-by=TYPE", types,
|
70
70
|
"sort output recoreds by TYPE.",
|
71
71
|
"available TYPEs: #{types.join(', ')}",
|
72
|
-
"(#{options.
|
72
|
+
"(#{options.order_by})") do |type|
|
73
73
|
options.order_by = type
|
74
74
|
end
|
75
75
|
end
|
@@ -84,7 +84,8 @@ db_path = args[0]
|
|
84
84
|
database = Groonga::Database.open(db_path)
|
85
85
|
dumper_options = {
|
86
86
|
:database => database,
|
87
|
-
:output =>
|
87
|
+
:output => $stdout,
|
88
|
+
:error_output => $stderr,
|
88
89
|
:dump_schema => options.dump_schema,
|
89
90
|
:dump_tables => options.dump_tables,
|
90
91
|
:tables => options.tables,
|
data/ext/groonga/extconf.rb
CHANGED
@@ -183,12 +183,7 @@ def build_groonga(major, minor, micro)
|
|
183
183
|
end
|
184
184
|
|
185
185
|
message("installing...")
|
186
|
-
if
|
187
|
-
make_install_args = " MKDIR_P='mkdir -p --'"
|
188
|
-
else
|
189
|
-
make_install_args = ""
|
190
|
-
end
|
191
|
-
if xsystem("make install#{make_install_args}")
|
186
|
+
if xsystem("make install")
|
192
187
|
message(" done\n")
|
193
188
|
else
|
194
189
|
message(" failed\n")
|
data/ext/groonga/rb-grn-array.c
CHANGED
@@ -30,10 +30,6 @@ VALUE rb_cGrnArray;
|
|
30
30
|
*/
|
31
31
|
|
32
32
|
/*
|
33
|
-
* call-seq:
|
34
|
-
* Groonga::Array.create(options={}) -> Groonga::Array
|
35
|
-
* Groonga::Array.create(options={}) {|table| ... }
|
36
|
-
*
|
37
33
|
* キーのないテーブルを生成する。ブロックを指定すると、そのブ
|
38
34
|
* ロックに生成したテーブルが渡され、ブロックを抜けると自動的
|
39
35
|
* にテーブルが破棄される。
|
@@ -52,33 +48,64 @@ VALUE rb_cGrnArray;
|
|
52
48
|
* #それぞれのレコードに512バイトの値を格納できる無名一時テーブルを生成する。
|
53
49
|
* Groonga::Array.create(:value => 512)
|
54
50
|
*
|
55
|
-
* @
|
56
|
-
*
|
57
|
-
*
|
58
|
-
*
|
59
|
-
*
|
60
|
-
*
|
61
|
-
*
|
62
|
-
*
|
63
|
-
*
|
64
|
-
*
|
65
|
-
*
|
66
|
-
*
|
67
|
-
*
|
68
|
-
*
|
69
|
-
*
|
70
|
-
*
|
71
|
-
*
|
72
|
-
*
|
73
|
-
*
|
74
|
-
*
|
75
|
-
*
|
76
|
-
*
|
77
|
-
*
|
78
|
-
*
|
79
|
-
*
|
80
|
-
* Groonga::Record#n_sub_records
|
81
|
-
*
|
51
|
+
* @overload create(options={})
|
52
|
+
* @return [Groonga::Array]
|
53
|
+
* @param [::Hash] options The name and value
|
54
|
+
* pairs. Omitted names are initialized as the default value.
|
55
|
+
* @option options [Groonga::Context] :context (Groonga::Context.default)
|
56
|
+
* テーブルが利用するGroonga::Context
|
57
|
+
* @option options :name The name
|
58
|
+
* テーブルの名前。名前をつけると、Groonga::Context#[]に名
|
59
|
+
* 前を指定してテーブルを取得することができる。省略すると
|
60
|
+
* 無名テーブルになり、テーブルIDでのみ取得できる。
|
61
|
+
* @option options :path
|
62
|
+
* テーブルを保存するパス。パスを指定すると永続テーブルとな
|
63
|
+
* り、プロセス終了後もレコードは保持される。次回起動時に
|
64
|
+
* Groonga::Context#[]で保存されたレコードを利用することが
|
65
|
+
* できる。省略すると一時テーブルになり、プロセスが終了する
|
66
|
+
* とレコードは破棄される。
|
67
|
+
* @option options :persistent
|
68
|
+
* +true+ を指定すると永続テーブルとなる。 +path+ を省略した
|
69
|
+
* 場合は自動的にパスが付加される。 +:context+ で指定した
|
70
|
+
* Groonga::Contextに結びついているデータベースが一時デー
|
71
|
+
* タベースの場合は例外が発生する。
|
72
|
+
* @option options :value_type (nil)
|
73
|
+
* 値の型を指定する。省略すると値のための領域を確保しない。
|
74
|
+
* 値を保存したい場合は必ず指定すること。
|
75
|
+
* 参考: Groonga::Type.new
|
76
|
+
* @option options [Groonga::Record#n_sub_records] :sub_records
|
77
|
+
* +true+ を指定すると#groupでグループ化したときに、
|
78
|
+
* Groonga::Record#n_sub_recordsでグループに含まれるレコー
|
79
|
+
* ドの件数を取得できる。
|
80
|
+
* @overload create(options={})
|
81
|
+
* @yield [table] 生成されたテーブル。ブロックを抜けると破棄される。
|
82
|
+
* @param [::Hash] options The name and value
|
83
|
+
* pairs. Omitted names are initialized as the default value.
|
84
|
+
* @option options [Groonga::Context] :context (Groonga::Context.default)
|
85
|
+
* テーブルが利用するGroonga::Context
|
86
|
+
* @option options :name
|
87
|
+
* テーブルの名前。名前をつけると、Groonga::Context#[]に名
|
88
|
+
* 前を指定してテーブルを取得することができる。省略すると
|
89
|
+
* 無名テーブルになり、テーブルIDでのみ取得できる。
|
90
|
+
* @option options :path
|
91
|
+
* テーブルを保存するパス。パスを指定すると永続テーブルとな
|
92
|
+
* り、プロセス終了後もレコードは保持される。次回起動時に
|
93
|
+
* Groonga::Context#[]で保存されたレコードを利用することが
|
94
|
+
* できる。省略すると一時テーブルになり、プロセスが終了する
|
95
|
+
* とレコードは破棄される。
|
96
|
+
* @option options :persistent
|
97
|
+
* +true+ を指定すると永続テーブルとなる。 +path+ を省略した
|
98
|
+
* 場合は自動的にパスが付加される。 +:context+ で指定した
|
99
|
+
* Groonga::Contextに結びついているデータベースが一時デー
|
100
|
+
* タベースの場合は例外が発生する。
|
101
|
+
* @option options :value_type (nil)
|
102
|
+
* 値の型を指定する。省略すると値のための領域を確保しない。
|
103
|
+
* 値を保存したい場合は必ず指定すること。
|
104
|
+
* 参考: Groonga::Type.new
|
105
|
+
* @option options [Groonga::Record#n_sub_records] :sub_records
|
106
|
+
* +true+ を指定すると#groupでグループ化したときに、
|
107
|
+
* Groonga::Record#n_sub_recordsでグループに含まれるレコー
|
108
|
+
* ドの件数を取得できる。
|
82
109
|
*/
|
83
110
|
static VALUE
|
84
111
|
rb_grn_array_s_create (int argc, VALUE *argv, VALUE klass)
|
data/ext/groonga/rb-grn-column.c
CHANGED
@@ -167,12 +167,7 @@ rb_grn_column_get_local_name (VALUE self)
|
|
167
167
|
return rb_name;
|
168
168
|
}
|
169
169
|
|
170
|
-
/*
|
171
|
-
* call-seq:
|
172
|
-
* column.select(options) {|record| ...} -> Groonga::Hash
|
173
|
-
* column.select(query, options) -> Groonga::Hash
|
174
|
-
* column.select(expression, options) -> Groonga::Hash
|
175
|
-
*
|
170
|
+
/*
|
176
171
|
* カラムが所属するテーブルからブロックまたは文字列で指定し
|
177
172
|
* た条件にマッチするレコードを返す。返されたテーブルには
|
178
173
|
* +expression+ という特異メソッドがあり、指定した条件を表し
|
@@ -181,99 +176,200 @@ rb_grn_column_get_local_name (VALUE self)
|
|
181
176
|
* 用のスニペットを簡単に生成できる。
|
182
177
|
*
|
183
178
|
* bc. !!!ruby
|
184
|
-
*
|
185
|
-
*
|
186
|
-
*
|
187
|
-
*
|
188
|
-
*
|
189
|
-
*
|
190
|
-
*
|
191
|
-
*
|
192
|
-
*
|
193
|
-
*
|
179
|
+
* results = description_column.select do |column|
|
180
|
+
* column =~ "groonga"
|
181
|
+
* end
|
182
|
+
* snippet = results.expression.snippet([["<em>", "</em>"]])
|
183
|
+
* results.each do |record|
|
184
|
+
* puts "#{record['name']}の説明文の中で「groonga」が含まれる部分"
|
185
|
+
* snippet.execute(record["description"]).each do |snippet|
|
186
|
+
* puts "---"
|
187
|
+
* puts "#{snippet}..."
|
188
|
+
* puts "---"
|
189
|
+
* end
|
194
190
|
* end
|
195
|
-
* end
|
196
191
|
*
|
197
192
|
* 出力例
|
193
|
+
* <pre>
|
194
|
+
* rroongaの説明文の中で「groonga」が含まれる部分
|
195
|
+
* ---
|
196
|
+
* rroongaは<em>groonga</em>のいわゆるDB-APIの層の...
|
197
|
+
* ---
|
198
|
+
*
|
199
|
+
* @return [Groonga::Hash] 検索結果
|
200
|
+
* @overload select(options)
|
201
|
+
* @yieldparam [Groonga::Record] record
|
202
|
+
* @param [::Hash] options The name and value
|
203
|
+
* pairs. Omitted names are initialized as the default value.
|
204
|
+
* @option options :operator (Groonga::Operator::OR)
|
205
|
+
* マッチしたレコードをどのように扱うか。指定可能な値は以
|
206
|
+
* 下の通り。
|
207
|
+
*
|
208
|
+
* [Groonga::Operator::OR]
|
209
|
+
* マッチしたレコードを追加。すでにレコードが追加され
|
210
|
+
* ている場合は何もしない。
|
211
|
+
* [Groonga::Operator::AND]
|
212
|
+
* マッチしたレコードのスコアを増加。マッチしなかった
|
213
|
+
* レコードを削除。
|
214
|
+
* [Groonga::Operator::BUT]
|
215
|
+
* マッチしたレコードを削除。
|
216
|
+
* [Groonga::Operator::ADJUST]
|
217
|
+
* マッチしたレコードのスコアを増加。
|
218
|
+
*
|
219
|
+
* @option options :result
|
220
|
+
* 検索結果を格納するテーブル。マッチしたレコードが追加さ
|
221
|
+
* れていく。省略した場合は新しくテーブルを作成して返す。
|
222
|
+
*
|
223
|
+
* @option options :name
|
224
|
+
* 条件の名前。省略した場合は名前を付けない。
|
225
|
+
*
|
226
|
+
* @option options :syntax (:query)
|
227
|
+
* _query_ の構文。
|
228
|
+
*
|
229
|
+
* 参考: Groonga::Expression#parse.
|
230
|
+
*
|
231
|
+
* @option options :allow_pragma
|
232
|
+
* query構文時にプラグマを利用するかどうか。省略した場合は
|
233
|
+
* 利用する。
|
234
|
+
*
|
235
|
+
* 参考: Groonga::Expression#parse.
|
236
|
+
*
|
237
|
+
* @option options :allow_column The allow_column
|
238
|
+
* query構文時にカラム指定を利用するかどうか。省略した場合
|
239
|
+
* は利用する。
|
240
|
+
*
|
241
|
+
* 参考: Groonga::Expression#parse.
|
242
|
+
*
|
243
|
+
* @option options :allow_update
|
244
|
+
* script構文時に更新操作を利用するかどうか。省略した場合
|
245
|
+
* は利用する。
|
246
|
+
*
|
247
|
+
* 参考: Groonga::Expression#parse.
|
248
|
+
*
|
249
|
+
* @overload select(query, options)
|
250
|
+
* @param [String] query 条件の指定
|
251
|
+
* _query_ には「[カラム名]:[演算子][値]」という書式で条件を
|
252
|
+
* 指定する。演算子は以下の通り。
|
253
|
+
*
|
254
|
+
* - なし := [カラム値] == [値]
|
255
|
+
* - @!@ := [カラム値] != [値]
|
256
|
+
* - @<@ := [カラム値] < [値]
|
257
|
+
* - @>@ := [カラム値] > [値]
|
258
|
+
* - @<=@ := [カラム値] <= [値]
|
259
|
+
* - @>=@ := [カラム値] >= [値]
|
260
|
+
* - @@@ := [カラム値]が[値]を含んでいるかどうか
|
261
|
+
*
|
262
|
+
* 例:
|
263
|
+
*
|
264
|
+
* - @"groonga"@ := _column_ カラムの値が @"groonga"@ のレコードにマッチ
|
265
|
+
* - @"name:daijiro"@ :=
|
266
|
+
* _column_ カラムが属しているテーブルの @"name"@ カラムの値が
|
267
|
+
* @"daijiro"@ のレコードにマッチ =:
|
268
|
+
* - @"description:@@@groonga"@ :=
|
269
|
+
* _column_ カラムが属しているテーブルの @"description"@ カラムが
|
270
|
+
* @"groonga"@ を含んでいるレコードにマッチ =:
|
271
|
+
*
|
272
|
+
* @param [::Hash] options The name and value
|
273
|
+
* pairs. Omitted names are initialized as the default value.
|
274
|
+
* @option options :operator (Groonga::Operator::OR)
|
275
|
+
* マッチしたレコードをどのように扱うか。指定可能な値は以
|
276
|
+
* 下の通り。
|
277
|
+
*
|
278
|
+
* [Groonga::Operator::OR]
|
279
|
+
* マッチしたレコードを追加。すでにレコードが追加され
|
280
|
+
* ている場合は何もしない。
|
281
|
+
* [Groonga::Operator::AND]
|
282
|
+
* マッチしたレコードのスコアを増加。マッチしなかった
|
283
|
+
* レコードを削除。
|
284
|
+
* [Groonga::Operator::BUT]
|
285
|
+
* マッチしたレコードを削除。
|
286
|
+
* [Groonga::Operator::ADJUST]
|
287
|
+
* マッチしたレコードのスコアを増加。
|
288
|
+
*
|
289
|
+
* @option options :result
|
290
|
+
* 検索結果を格納するテーブル。マッチしたレコードが追加さ
|
291
|
+
* れていく。省略した場合は新しくテーブルを作成して返す。
|
292
|
+
*
|
293
|
+
* @option options :name
|
294
|
+
* 条件の名前。省略した場合は名前を付けない。
|
295
|
+
*
|
296
|
+
* @option options :syntax (:query)
|
297
|
+
* _query_ の構文。
|
298
|
+
*
|
299
|
+
* 参考: Groonga::Expression#parse.
|
300
|
+
*
|
301
|
+
* @option options :allow_pragma
|
302
|
+
* query構文時にプラグマを利用するかどうか。省略した場合は
|
303
|
+
* 利用する。
|
198
304
|
*
|
199
|
-
*
|
200
|
-
*
|
201
|
-
*
|
202
|
-
*
|
203
|
-
*
|
204
|
-
*
|
205
|
-
*
|
206
|
-
*
|
207
|
-
*
|
208
|
-
*
|
209
|
-
*
|
210
|
-
*
|
211
|
-
*
|
212
|
-
*
|
213
|
-
*
|
214
|
-
*
|
215
|
-
*
|
216
|
-
*
|
217
|
-
*
|
218
|
-
*
|
219
|
-
*
|
220
|
-
* @
|
221
|
-
*
|
222
|
-
*
|
223
|
-
*
|
224
|
-
*
|
225
|
-
*
|
226
|
-
*
|
227
|
-
* ブロックで条件を指定する場合は
|
228
|
-
* {Groonga::ColumnExpressionBuilder} を参照。
|
229
|
-
*
|
230
|
-
* _options_ に指定可能な値は以下の通り。
|
231
|
-
* @param [::Hash] options The name and value
|
232
|
-
* pairs. Omitted names are initialized as the default value.
|
233
|
-
* @option options :operator (Groonga::Operator::OR) The operator
|
234
|
-
* マッチしたレコードをどのように扱うか。指定可能な値は以
|
235
|
-
* 下の通り。
|
236
|
-
*
|
237
|
-
* [Groonga::Operator::OR]
|
305
|
+
* 参考: Groonga::Expression#parse.
|
306
|
+
*
|
307
|
+
* @option options :allow_column The allow_column
|
308
|
+
* query構文時にカラム指定を利用するかどうか。省略した場合
|
309
|
+
* は利用する。
|
310
|
+
*
|
311
|
+
* 参考: Groonga::Expression#parse.
|
312
|
+
*
|
313
|
+
* @option options :allow_update
|
314
|
+
* script構文時に更新操作を利用するかどうか。省略した場合
|
315
|
+
* は利用する。
|
316
|
+
*
|
317
|
+
* 参考: Groonga::Expression#parse.
|
318
|
+
*
|
319
|
+
* @overload select(expression, options)
|
320
|
+
* @param [Groonga::Expression] expression 条件を表すオブジェクト
|
321
|
+
* _expression_ には既に作成済みのGroonga::Expressionを渡す
|
322
|
+
*
|
323
|
+
* ブロックで条件を指定する場合は
|
324
|
+
* {Groonga::ColumnExpressionBuilder} を参照。
|
325
|
+
*
|
326
|
+
* @param [::Hash] options The name and value
|
327
|
+
* pairs. Omitted names are initialized as the default value.
|
328
|
+
* @option options :operator (Groonga::Operator::OR)
|
329
|
+
* マッチしたレコードをどのように扱うか。指定可能な値は以
|
330
|
+
* 下の通り。
|
331
|
+
*
|
332
|
+
* [Groonga::Operator::OR]
|
238
333
|
* マッチしたレコードを追加。すでにレコードが追加され
|
239
334
|
* ている場合は何もしない。
|
240
|
-
*
|
335
|
+
* [Groonga::Operator::AND]
|
241
336
|
* マッチしたレコードのスコアを増加。マッチしなかった
|
242
337
|
* レコードを削除。
|
243
|
-
*
|
338
|
+
* [Groonga::Operator::BUT]
|
244
339
|
* マッチしたレコードを削除。
|
245
|
-
*
|
340
|
+
* [Groonga::Operator::ADJUST]
|
246
341
|
* マッチしたレコードのスコアを増加。
|
247
342
|
*
|
248
|
-
*
|
249
|
-
*
|
250
|
-
*
|
343
|
+
* @option options :result
|
344
|
+
* 検索結果を格納するテーブル。マッチしたレコードが追加さ
|
345
|
+
* れていく。省略した場合は新しくテーブルを作成して返す。
|
251
346
|
*
|
252
|
-
*
|
253
|
-
*
|
347
|
+
* @option options :name
|
348
|
+
* 条件の名前。省略した場合は名前を付けない。
|
254
349
|
*
|
255
|
-
*
|
256
|
-
*
|
350
|
+
* @option options :syntax (:query)
|
351
|
+
* _query_ の構文。
|
257
352
|
*
|
258
|
-
*
|
353
|
+
* 参考: Groonga::Expression#parse.
|
259
354
|
*
|
260
|
-
*
|
261
|
-
*
|
262
|
-
*
|
355
|
+
* @option options :allow_pragma
|
356
|
+
* query構文時にプラグマを利用するかどうか。省略した場合は
|
357
|
+
* 利用する。
|
263
358
|
*
|
264
|
-
*
|
359
|
+
* 参考: Groonga::Expression#parse.
|
265
360
|
*
|
266
|
-
*
|
267
|
-
*
|
268
|
-
*
|
361
|
+
* @option options :allow_column The allow_column
|
362
|
+
* query構文時にカラム指定を利用するかどうか。省略した場合
|
363
|
+
* は利用する。
|
269
364
|
*
|
270
|
-
*
|
365
|
+
* 参考: Groonga::Expression#parse.
|
271
366
|
*
|
272
|
-
*
|
273
|
-
*
|
274
|
-
*
|
367
|
+
* @option options :allow_update
|
368
|
+
* script構文時に更新操作を利用するかどうか。省略した場合
|
369
|
+
* は利用する。
|
370
|
+
*
|
371
|
+
* 参考: Groonga::Expression#parse.
|
275
372
|
*
|
276
|
-
* 参考: Groonga::Expression#parse.
|
277
373
|
*/
|
278
374
|
static VALUE
|
279
375
|
rb_grn_column_select (int argc, VALUE *argv, VALUE self)
|
@@ -359,18 +455,12 @@ rb_grn_column_select (int argc, VALUE *argv, VALUE self)
|
|
359
455
|
}
|
360
456
|
|
361
457
|
/*
|
362
|
-
* Document-method: unlock
|
363
|
-
*
|
364
|
-
* call-seq:
|
365
|
-
* column.unlock(options={})
|
366
|
-
*
|
367
458
|
* _column_ のロックを解除する。
|
368
|
-
*
|
369
|
-
* 利用可能なオプションは以下の通り。
|
370
|
-
*
|
371
|
-
*
|
372
|
-
*
|
373
|
-
* (注: groonga側が未実装のため、現在は無視される)
|
459
|
+
* @overload unlock(options={})
|
460
|
+
* @param [::Hash] options 利用可能なオプションは以下の通り。
|
461
|
+
* @option options :id
|
462
|
+
* _:id_ で指定したレコードのロックを解除する。
|
463
|
+
* (注: groonga側が未実装のため、現在は無視される)
|
374
464
|
*/
|
375
465
|
static VALUE
|
376
466
|
rb_grn_column_unlock (int argc, VALUE *argv, VALUE self)
|
@@ -408,26 +498,28 @@ rb_grn_column_unlock_ensure (VALUE self)
|
|
408
498
|
}
|
409
499
|
|
410
500
|
/*
|
411
|
-
* Document-method: lock
|
412
|
-
*
|
413
|
-
* call-seq:
|
414
|
-
* column.lock(options={})
|
415
|
-
* column.lock(options={}) {...}
|
416
|
-
*
|
417
501
|
* _column_ をロックする。ロックに失敗した場合は
|
418
502
|
* Groonga::ResourceDeadlockAvoided例外が発生する。
|
419
503
|
*
|
420
|
-
*
|
421
|
-
*
|
422
|
-
*
|
423
|
-
*
|
424
|
-
*
|
425
|
-
*
|
426
|
-
*
|
427
|
-
*
|
428
|
-
*
|
429
|
-
*
|
430
|
-
*
|
504
|
+
* @overload lock(options={})
|
505
|
+
* @param [::Hash] options 利用可能なオプションは以下の通り。
|
506
|
+
* @option options :timeout
|
507
|
+
* ロックを獲得できなかった場合は _:timeout_ 秒間ロックの獲
|
508
|
+
* 得を試みる。 _:timeout_ 秒以内にロックを獲得できなかった
|
509
|
+
* 場合は例外が発生する。
|
510
|
+
* @option options :id
|
511
|
+
* _:id_で指定したレコードをロックする。(注: groonga側が
|
512
|
+
* 未実装のため、現在は無視される)
|
513
|
+
* @overload lock(options={})
|
514
|
+
* @yield ブロックを指定した場合はブロックを抜けたときにunlockする。
|
515
|
+
* @param [::Hash] options 利用可能なオプションは以下の通り。
|
516
|
+
* @option options :timeout
|
517
|
+
* ロックを獲得できなかった場合は _:timeout_秒間ロックの獲
|
518
|
+
* 得を試みる。 _:timeout_秒以内にロックを獲得できなかった
|
519
|
+
* 場合は例外が発生する。
|
520
|
+
* @option options :id
|
521
|
+
* _:id_で指定したレコードをロックする。(注: groonga側が
|
522
|
+
* 未実装のため、現在は無視される)
|
431
523
|
*/
|
432
524
|
static VALUE
|
433
525
|
rb_grn_column_lock (int argc, VALUE *argv, VALUE self)
|
@@ -468,20 +560,14 @@ rb_grn_column_lock (int argc, VALUE *argv, VALUE self)
|
|
468
560
|
}
|
469
561
|
|
470
562
|
/*
|
471
|
-
*
|
472
|
-
*
|
473
|
-
*
|
474
|
-
*
|
475
|
-
*
|
476
|
-
*
|
477
|
-
*
|
478
|
-
*
|
479
|
-
*
|
480
|
-
* [_:id_]
|
481
|
-
* _:id_で指定したレコードのロックを強制的に解除する。
|
482
|
-
* (注: groonga側が未実装のため、現在は無視される。実装さ
|
483
|
-
* れるのではないかと思っているが、実装されないかもしれな
|
484
|
-
* い。)
|
563
|
+
* _column_ のロックを強制的に解除する。
|
564
|
+
* @overload clear_lock(options={})
|
565
|
+
* @param [::Hash] options 利用可能なオプションは以下の通り。
|
566
|
+
* @option options :id
|
567
|
+
* _:id_で指定したレコードのロックを強制的に解除する。
|
568
|
+
* (注: groonga側が未実装のため、現在は無視される。実装さ
|
569
|
+
* れるのではないかと思っているが、実装されないかもしれな
|
570
|
+
* い。)
|
485
571
|
*/
|
486
572
|
static VALUE
|
487
573
|
rb_grn_column_clear_lock (int argc, VALUE *argv, VALUE self)
|
@@ -510,20 +596,14 @@ rb_grn_column_clear_lock (int argc, VALUE *argv, VALUE self)
|
|
510
596
|
}
|
511
597
|
|
512
598
|
/*
|
513
|
-
* Document-method: locked?
|
514
|
-
*
|
515
|
-
* call-seq:
|
516
|
-
* column.locked?(options={})
|
517
|
-
*
|
518
599
|
* _column_ がロックされていれば +true+ を返す。
|
519
|
-
*
|
520
|
-
* 利用可能なオプションは以下の通り。
|
521
|
-
*
|
522
|
-
*
|
523
|
-
*
|
524
|
-
*
|
525
|
-
*
|
526
|
-
* い。)
|
600
|
+
* @overload locked?(options={})
|
601
|
+
* @param [::Hash] options 利用可能なオプションは以下の通り。
|
602
|
+
* @option options :id
|
603
|
+
* _:id_で指定したレコードがロックされていれば +true+ を返す。
|
604
|
+
* (注: groonga側が未実装のため、現在は無視される。実装さ
|
605
|
+
* れるのではないかと思っているが、実装されないかもしれな
|
606
|
+
* い。)
|
527
607
|
*/
|
528
608
|
static VALUE
|
529
609
|
rb_grn_column_is_locked (int argc, VALUE *argv, VALUE self)
|
@@ -682,14 +762,11 @@ rb_grn_column_scalar_p (VALUE self)
|
|
682
762
|
}
|
683
763
|
|
684
764
|
/*
|
685
|
-
*
|
686
|
-
*
|
687
|
-
* call-seq:
|
688
|
-
* column.indexes(operator=Groonga::Operator::MATCH) -> [index_column, ...]
|
689
|
-
*
|
690
|
-
* _operation_ を実行できる _column_ のインデックスを返す。
|
691
|
-
*
|
765
|
+
* _operator_ を実行できる _column_ のインデックスを返す。
|
692
766
|
* @since 1.0.9
|
767
|
+
* @return [Array<index_column>] _operator_ を実行できる _column_ のインデックス
|
768
|
+
* @overload indexes(operator=Groonga::Operator::MATCH)
|
769
|
+
* @param [Groonga::Operator::XXX] operator
|
693
770
|
*/
|
694
771
|
static VALUE
|
695
772
|
rb_grn_column_get_indexes (int argc, VALUE *argv, VALUE self)
|
@@ -731,15 +808,10 @@ rb_grn_column_get_indexes (int argc, VALUE *argv, VALUE self)
|
|
731
808
|
}
|
732
809
|
|
733
810
|
/*
|
734
|
-
* Document-method: rename
|
735
|
-
*
|
736
|
-
* call-seq:
|
737
|
-
* table.rename(name)
|
738
|
-
*
|
739
811
|
* Renames the table to name.
|
740
|
-
*
|
741
|
-
* @param name [String] the new name
|
742
812
|
* @since 1.3.0
|
813
|
+
* @overload rename(name)
|
814
|
+
* @param name [String] the new name
|
743
815
|
*/
|
744
816
|
static VALUE
|
745
817
|
rb_grn_column_rename (VALUE self, VALUE rb_name)
|