rroonga 1.2.9 → 1.3.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.
- data/Gemfile +1 -0
- data/Rakefile +1 -0
- data/bin/grntest-log-analyze +123 -0
- data/bin/groonga-query-log-extract +117 -0
- data/ext/groonga/rb-grn-accessor.c +7 -5
- data/ext/groonga/rb-grn-array-cursor.c +1 -1
- data/ext/groonga/rb-grn-array.c +34 -44
- data/ext/groonga/rb-grn-column.c +74 -38
- data/ext/groonga/rb-grn-context.c +19 -15
- data/ext/groonga/rb-grn-database.c +47 -42
- data/ext/groonga/rb-grn-double-array-trie-cursor.c +40 -0
- data/ext/groonga/rb-grn-double-array-trie.c +530 -0
- data/ext/groonga/rb-grn-encoding-support.c +1 -1
- data/ext/groonga/rb-grn-encoding.c +1 -1
- data/ext/groonga/rb-grn-exception.c +1 -1
- data/ext/groonga/rb-grn-expression-builder.c +1 -1
- data/ext/groonga/rb-grn-expression.c +63 -51
- data/ext/groonga/rb-grn-fix-size-column.c +7 -7
- data/ext/groonga/rb-grn-hash-cursor.c +1 -1
- data/ext/groonga/rb-grn-hash.c +42 -39
- data/ext/groonga/rb-grn-index-column.c +35 -31
- data/ext/groonga/rb-grn-index-cursor.c +1 -1
- data/ext/groonga/rb-grn-logger.c +23 -18
- data/ext/groonga/rb-grn-object.c +40 -27
- data/ext/groonga/rb-grn-operator.c +1 -1
- data/ext/groonga/rb-grn-patricia-trie-cursor.c +1 -1
- data/ext/groonga/rb-grn-patricia-trie.c +122 -90
- data/ext/groonga/rb-grn-plugin.c +8 -7
- data/ext/groonga/rb-grn-posting.c +1 -1
- data/ext/groonga/rb-grn-procedure.c +1 -1
- data/ext/groonga/rb-grn-query.c +12 -12
- data/ext/groonga/rb-grn-record.c +1 -1
- data/ext/groonga/rb-grn-snippet.c +26 -19
- data/ext/groonga/rb-grn-table-cursor-key-support.c +1 -1
- data/ext/groonga/rb-grn-table-cursor.c +4 -3
- data/ext/groonga/rb-grn-table-key-support.c +23 -23
- data/ext/groonga/rb-grn-table.c +268 -153
- data/ext/groonga/rb-grn-type.c +11 -7
- data/ext/groonga/rb-grn-utils.c +4 -1
- data/ext/groonga/rb-grn-variable-size-column.c +1 -1
- data/ext/groonga/rb-grn-variable.c +2 -2
- data/ext/groonga/rb-grn-view-accessor.c +1 -1
- data/ext/groonga/rb-grn-view-cursor.c +1 -1
- data/ext/groonga/rb-grn-view-record.c +1 -1
- data/ext/groonga/rb-grn-view.c +43 -34
- data/ext/groonga/rb-grn.h +6 -2
- data/ext/groonga/rb-groonga.c +1 -1
- data/lib/groonga.rb +4 -2
- data/lib/groonga/context.rb +16 -41
- data/lib/groonga/dumper.rb +6 -4
- data/lib/groonga/expression-builder.rb +52 -26
- data/lib/groonga/grntest-log.rb +206 -0
- data/lib/groonga/pagination.rb +21 -19
- data/lib/groonga/patricia-trie.rb +7 -10
- data/lib/groonga/posting.rb +1 -1
- data/lib/groonga/query-log.rb +348 -0
- data/lib/groonga/record.rb +47 -143
- data/lib/groonga/schema.rb +679 -406
- data/lib/groonga/view-record.rb +4 -10
- data/rroonga-build.rb +1 -1
- data/test/test-array.rb +25 -4
- data/test/test-column.rb +8 -8
- data/test/test-database.rb +2 -3
- data/test/test-double-array-trie.rb +164 -0
- data/test/test-expression-builder.rb +2 -2
- data/test/test-expression.rb +10 -9
- data/test/test-gqtp.rb +2 -2
- data/test/test-hash.rb +32 -8
- data/test/test-patricia-trie.rb +34 -10
- data/test/test-query-log.rb +258 -0
- data/test/test-record.rb +6 -5
- data/test/test-schema-create-table.rb +8 -0
- data/test/test-schema.rb +491 -234
- data/test/test-table.rb +17 -24
- metadata +123 -100
- data/ext/groonga/Makefile +0 -233
@@ -1,4 +1,4 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
1
|
+
/* -*- coding: utf-8; c-file-style: "ruby" -*- */
|
2
2
|
/*
|
3
3
|
Copyright (C) 2009 Kouhei Sutou <kou@clear-code.com>
|
4
4
|
|
@@ -31,7 +31,7 @@ VALUE rb_cGrnIndexColumn;
|
|
31
31
|
* とにより高速な全文検索を実現できる。
|
32
32
|
*
|
33
33
|
* テーブルにGroonga::IndexColumnを定義する方法は
|
34
|
-
* Groonga::Table#define_index_columnを参照。
|
34
|
+
* {Groonga::Table#define_index_column} を参照。
|
35
35
|
*/
|
36
36
|
|
37
37
|
void
|
@@ -100,35 +100,36 @@ rb_grn_index_column_deconstruct (RbGrnIndexColumn *rb_grn_index_column,
|
|
100
100
|
* column[id] = value
|
101
101
|
* column[id] = options
|
102
102
|
*
|
103
|
-
* IDが_id_であるレコードを高速に全文検索するため転置索引を作
|
103
|
+
* IDが _id_ であるレコードを高速に全文検索するため転置索引を作
|
104
104
|
* 成する。多くの場合、Groonga::Table#define_index_columnで
|
105
|
-
* +:source
|
105
|
+
* +:source+ オプションを指定することにより、自動的に全文検索
|
106
106
|
* 用の索引は更新されるので、明示的にこのメソッドを使うこと
|
107
107
|
* は少ない。
|
108
108
|
*
|
109
|
-
* _value_には文字列を指定する。
|
109
|
+
* _value_ には文字列を指定する。
|
110
110
|
*
|
111
|
-
* _options_を指定することにより、より索引の作成を制御できる。
|
112
|
-
*
|
111
|
+
* _options_ を指定することにより、より索引の作成を制御できる。
|
112
|
+
* @param [::Hash] options The name and value
|
113
|
+
* pairs. Omitted names are initialized as the default value
|
114
|
+
* @option options :section The section
|
113
115
|
*
|
114
|
-
* [+:section+]
|
115
116
|
* 段落番号を指定する。省略した場合は1を指定したとみなされ
|
116
117
|
* る。
|
117
|
-
*
|
118
118
|
* Groonga::Table#define_index_columnで
|
119
119
|
* <tt>{:with_section => true}</tt>を指定していなければい
|
120
120
|
* けない。
|
121
121
|
*
|
122
|
-
*
|
122
|
+
* @option options :old_value The old_value
|
123
|
+
*
|
123
124
|
* 以前の値を指定する。省略した場合は現在の値が用いられる。
|
124
125
|
* 通常は指定する必要はない。
|
125
126
|
*
|
126
|
-
*
|
127
|
-
* 新しい値を指定する。_value_を指定した場合と_options_で
|
127
|
+
* @option options :value The value
|
128
|
+
* 新しい値を指定する。 _value_ を指定した場合と _options_ で
|
128
129
|
* <tt>{:value => value}</tt>を指定した場合は同じ動作とな
|
129
130
|
* る。
|
130
131
|
*
|
131
|
-
* 記事の段落毎に索引を作成する。
|
132
|
+
* @example 記事の段落毎に索引を作成する。
|
132
133
|
* articles = Groonga::Array.create(:name => "<articles>")
|
133
134
|
* articles.define_column("title", "ShortText")
|
134
135
|
* articles.define_column("content", "Text")
|
@@ -400,32 +401,35 @@ rb_grn_index_column_set_source (VALUE self, VALUE rb_source)
|
|
400
401
|
* call-seq:
|
401
402
|
* column.search(query, options={}) -> Groonga::Hash
|
402
403
|
*
|
403
|
-
* _object_から_query_に対応するオブジェクトを検索し、見つかっ
|
404
|
+
* _object_ から _query_ に対応するオブジェクトを検索し、見つかっ
|
404
405
|
* たオブジェクトのIDがキーになっているGroonga::Hashを返す。
|
405
406
|
*
|
406
407
|
* 利用可能なオプションは以下の通り。
|
407
|
-
*
|
408
|
-
*
|
408
|
+
* @param [::Hash] options The name and value
|
409
|
+
* pairs. Omitted names are initialized as the default value
|
410
|
+
* @option options [Groonga::Hash] :result The result
|
409
411
|
* 結果を格納するGroonga::Hash。指定しない場合は新しく
|
410
412
|
* Groonga::Hashを生成し、それに結果を格納して返す。
|
411
|
-
*
|
412
|
-
*
|
413
|
+
* @option options :operator The operator
|
414
|
+
*
|
415
|
+
* 以下のどれかの値を指定する。 +nil+ , <tt>"or"</tt>, <tt>"||"</tt>,
|
413
416
|
* <tt>"and"</tt>, <tt>"+"</tt>, <tt>"&&"</tt>, <tt>"but"</tt>,
|
414
417
|
* <tt>"not"</tt>, <tt>"-"</tt>, <tt>"adjust"</tt>, <tt>">"</tt>。
|
415
418
|
* それぞれ以下のようになる。(FIXME: 「以下」)
|
416
|
-
*
|
417
|
-
*
|
418
|
-
*
|
419
|
-
*
|
419
|
+
* @option options :exact The exact
|
420
|
+
*
|
421
|
+
* +true+ を指定すると完全一致で検索する
|
422
|
+
* @option options :longest_common_prefix The longest_common_prefix
|
423
|
+
* +true+ を指定すると _query_ と同じ接頭辞をもつエントリのう
|
420
424
|
* ち、もっとも長いエントリを検索する
|
421
|
-
*
|
422
|
-
* +true
|
425
|
+
* @option options :suffix The suffix
|
426
|
+
* +true+ を指定すると _query_ が後方一致するエントリを検索す
|
423
427
|
* る
|
424
|
-
*
|
425
|
-
* +true
|
428
|
+
* @option options :prefix The prefix
|
429
|
+
* +true+ を指定すると _query_ が前方一致するレコードを検索す
|
426
430
|
* る
|
427
|
-
*
|
428
|
-
* +true
|
431
|
+
* @option options :near The near
|
432
|
+
* +true+ を指定すると _query_ に指定した複数の語が近傍に含ま
|
429
433
|
* れるレコードを検索する
|
430
434
|
* [...]
|
431
435
|
* ...
|
@@ -494,7 +498,7 @@ rb_grn_index_column_search (int argc, VALUE *argv, VALUE self)
|
|
494
498
|
* call-seq:
|
495
499
|
* column.with_section? -> true/false
|
496
500
|
*
|
497
|
-
* _column_
|
501
|
+
* _column_ が段落情報も格納する場合は +true+ を返します。
|
498
502
|
*/
|
499
503
|
static VALUE
|
500
504
|
rb_grn_index_column_with_section_p (VALUE self)
|
@@ -515,7 +519,7 @@ rb_grn_index_column_with_section_p (VALUE self)
|
|
515
519
|
* call-seq:
|
516
520
|
* column.with_weight? -> true/false
|
517
521
|
*
|
518
|
-
* _column_
|
522
|
+
* _column_ がウェイト情報も格納する場合は +true+ を返します。
|
519
523
|
*/
|
520
524
|
static VALUE
|
521
525
|
rb_grn_index_column_with_weight_p (VALUE self)
|
@@ -536,7 +540,7 @@ rb_grn_index_column_with_weight_p (VALUE self)
|
|
536
540
|
* call-seq:
|
537
541
|
* column.with_position? -> true/false
|
538
542
|
*
|
539
|
-
* _column_
|
543
|
+
* _column_ が位置情報も格納する場合は +true+ を返します。
|
540
544
|
*/
|
541
545
|
static VALUE
|
542
546
|
rb_grn_index_column_with_position_p (VALUE self)
|
data/ext/groonga/rb-grn-logger.c
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
1
|
+
/* -*- coding: utf-8; c-file-style: "ruby" -*- */
|
2
2
|
/*
|
3
3
|
Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
|
4
4
|
|
@@ -256,37 +256,42 @@ rb_grn_logger_initialize (int argc, VALUE *argv, VALUE self)
|
|
256
256
|
* groongaがログを出力する度に呼び出されるブロックを登録す
|
257
257
|
* る。
|
258
258
|
*
|
259
|
-
* ブロックに渡されてくる引数は_level_,
|
260
|
-
* _message_,
|
261
|
-
* 全て文字列で渡される。その4つについては_options_
|
259
|
+
* ブロックに渡されてくる引数は _level_ , _time_ , _title_ ,
|
260
|
+
* _message_ , _location_ の5つで、 _level_ はSymbol、それ以外は
|
261
|
+
* 全て文字列で渡される。その4つについては _options_ で +false+
|
262
262
|
* を指定することでブロックに渡さないようにすることができ、
|
263
263
|
* その場合は空文字列が実際には渡される。
|
264
264
|
*
|
265
|
-
* _options_に指定可能な値は以下の通り。
|
265
|
+
* _options_ に指定可能な値は以下の通り。
|
266
|
+
* @param options [::Hash] The name and value
|
267
|
+
* pairs. Omitted names are initialized as the default value.
|
268
|
+
* @option options :level (:notice) The log level
|
266
269
|
*
|
267
|
-
*
|
268
|
-
*
|
269
|
-
* +:
|
270
|
-
* +:debug+, +:dump+のいずれかで指定する。それより重要度が
|
270
|
+
* ログのレベルを +:none+ , +:emergency+ , +:alert+ ,
|
271
|
+
* +:critical+ , +:error+ , +:warning+ , +:notice+ , +:info+ ,
|
272
|
+
* +:debug+ , +:dump+ のいずれかで指定する。それより重要度が
|
271
273
|
* 低いログはブロックに渡されなくなる。デフォルトでは
|
272
|
-
* +:notice
|
274
|
+
* +:notice+ 。
|
273
275
|
*
|
274
|
-
*
|
275
|
-
*
|
276
|
+
* @option options :time
|
277
|
+
*
|
278
|
+
* ログが出力された時間をブロックに渡したいなら +true+ を指
|
276
279
|
* 定する。デフォルトでは渡す。
|
277
280
|
*
|
278
|
-
*
|
279
|
-
*
|
281
|
+
* @option options :title The title
|
282
|
+
*
|
283
|
+
* ログのタイトルをブロックに渡したいなら +true+ を指定す
|
280
284
|
* る。デフォルトでは渡す。(FIXME: groongaで実装されてい
|
281
285
|
* ない?)
|
282
286
|
*
|
283
|
-
*
|
284
|
-
*
|
287
|
+
* @option options :message The message
|
288
|
+
* ログのメッセージをブロックに渡したいなら +true+ を指定す
|
285
289
|
* る。デフォルトでは渡す。
|
286
290
|
*
|
287
|
-
*
|
291
|
+
* @option options :location The location
|
292
|
+
*
|
288
293
|
* ログの発生元のプロセスIDとgroongaのソースコードのファイ
|
289
|
-
*
|
294
|
+
* ル名、行番号、関数名をブロックに渡したいなら +true+ を指
|
290
295
|
* 定する。デフォルトでは渡す。
|
291
296
|
*/
|
292
297
|
static VALUE
|
data/ext/groonga/rb-grn-object.c
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
1
|
+
/* -*- coding: utf-8; c-file-style: "ruby" -*- */
|
2
2
|
/*
|
3
3
|
Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
|
4
4
|
|
@@ -108,11 +108,13 @@ rb_grn_object_run_finalizer (grn_ctx *context, grn_obj *grn_object,
|
|
108
108
|
case GRN_PROC:
|
109
109
|
case GRN_CURSOR_TABLE_HASH_KEY:
|
110
110
|
case GRN_CURSOR_TABLE_PAT_KEY:
|
111
|
+
case GRN_CURSOR_TABLE_DAT_KEY:
|
111
112
|
case GRN_CURSOR_TABLE_NO_KEY:
|
112
113
|
case GRN_CURSOR_TABLE_VIEW:
|
113
114
|
break;
|
114
115
|
case GRN_TABLE_HASH_KEY:
|
115
116
|
case GRN_TABLE_PAT_KEY:
|
117
|
+
case GRN_TABLE_DAT_KEY:
|
116
118
|
rb_grn_table_key_support_finalizer(context, grn_object,
|
117
119
|
RB_GRN_TABLE_KEY_SUPPORT(rb_grn_object));
|
118
120
|
break;
|
@@ -219,6 +221,9 @@ rb_grn_object_to_ruby_class (grn_obj *object)
|
|
219
221
|
case GRN_TABLE_PAT_KEY:
|
220
222
|
klass = rb_cGrnPatriciaTrie;
|
221
223
|
break;
|
224
|
+
case GRN_TABLE_DAT_KEY:
|
225
|
+
klass = rb_cGrnDoubleArrayTrie;
|
226
|
+
break;
|
222
227
|
case GRN_TABLE_NO_KEY:
|
223
228
|
klass = rb_cGrnArray;
|
224
229
|
break;
|
@@ -255,6 +260,9 @@ rb_grn_object_to_ruby_class (grn_obj *object)
|
|
255
260
|
case GRN_CURSOR_TABLE_PAT_KEY:
|
256
261
|
klass = rb_cGrnPatriciaTrieCursor;
|
257
262
|
break;
|
263
|
+
case GRN_CURSOR_TABLE_DAT_KEY:
|
264
|
+
klass = rb_cGrnDoubleArrayTrieCursor;
|
265
|
+
break;
|
258
266
|
case GRN_CURSOR_TABLE_NO_KEY:
|
259
267
|
klass = rb_cGrnArrayCursor;
|
260
268
|
break;
|
@@ -337,7 +345,6 @@ rb_grn_object_bind_common (VALUE klass, VALUE self, VALUE rb_context,
|
|
337
345
|
}
|
338
346
|
|
339
347
|
switch (object->header.type) {
|
340
|
-
case GRN_DB:
|
341
348
|
case GRN_PROC:
|
342
349
|
case GRN_TYPE:
|
343
350
|
case GRN_ACCESSOR: /* TODO: We want to close GRN_ACCESSOR. */
|
@@ -384,6 +391,7 @@ rb_grn_object_assign (VALUE klass, VALUE self, VALUE rb_context,
|
|
384
391
|
(RVAL2CBOOL(rb_obj_is_kind_of(self, rb_cGrnType))) ||
|
385
392
|
klass == rb_cGrnHashCursor ||
|
386
393
|
klass == rb_cGrnPatriciaTrieCursor ||
|
394
|
+
klass == rb_cGrnDoubleArrayTrieCursor ||
|
387
395
|
klass == rb_cGrnArrayCursor ||
|
388
396
|
klass == rb_cGrnViewCursor ||
|
389
397
|
klass == rb_cGrnIndexCursor ||
|
@@ -527,7 +535,7 @@ rb_grn_object_deconstruct (RbGrnObject *rb_grn_object,
|
|
527
535
|
* call-seq:
|
528
536
|
* object.close
|
529
537
|
*
|
530
|
-
* _object_が使用しているリソースを開放する。これ以降_object_を
|
538
|
+
* _object_ が使用しているリソースを開放する。これ以降 _object_ を
|
531
539
|
* 使うことはできない。
|
532
540
|
*/
|
533
541
|
VALUE
|
@@ -554,7 +562,7 @@ rb_grn_object_close (VALUE self)
|
|
554
562
|
* call-seq:
|
555
563
|
* object.unlink
|
556
564
|
*
|
557
|
-
* _object_のリファレンスカウンタを1減少する。
|
565
|
+
* _object_ のリファレンスカウンタを1減少する。
|
558
566
|
*/
|
559
567
|
VALUE
|
560
568
|
rb_grn_object_unlink (VALUE self)
|
@@ -582,8 +590,8 @@ rb_grn_object_unlink (VALUE self)
|
|
582
590
|
* call-seq:
|
583
591
|
* object.closed? -> true/false
|
584
592
|
*
|
585
|
-
* _object_が開放済みの場合は+true+を返し、そうでない場合は
|
586
|
-
* +false
|
593
|
+
* _object_ が開放済みの場合は+true+を返し、そうでない場合は
|
594
|
+
* +false+ を返す。
|
587
595
|
*/
|
588
596
|
VALUE
|
589
597
|
rb_grn_object_closed_p (VALUE self)
|
@@ -781,6 +789,8 @@ rb_grn_object_inspect_content_flags_with_label (VALUE inspected,
|
|
781
789
|
rb_ary_push(inspected_flags, rb_str_new2("TABLE_HASH_KEY"));
|
782
790
|
if (flags & GRN_OBJ_TABLE_PAT_KEY)
|
783
791
|
rb_ary_push(inspected_flags, rb_str_new2("TABLE_PAT_KEY"));
|
792
|
+
if (flags & GRN_OBJ_TABLE_DAT_KEY)
|
793
|
+
rb_ary_push(inspected_flags, rb_str_new2("TABLE_DAT_KEY"));
|
784
794
|
if (flags & GRN_OBJ_TABLE_NO_KEY)
|
785
795
|
rb_ary_push(inspected_flags, rb_str_new2("TABLE_NO_KEY"));
|
786
796
|
if (flags & GRN_OBJ_TABLE_VIEW)
|
@@ -805,6 +815,7 @@ rb_grn_object_inspect_content_flags_with_label (VALUE inspected,
|
|
805
815
|
switch (object->header.type) {
|
806
816
|
case GRN_TABLE_HASH_KEY:
|
807
817
|
case GRN_TABLE_PAT_KEY:
|
818
|
+
case GRN_TABLE_DAT_KEY:
|
808
819
|
if (flags & GRN_OBJ_KEY_WITH_SIS)
|
809
820
|
rb_ary_push(inspected_flags, rb_str_new2("KEY_WITH_SIS"));
|
810
821
|
if (flags & GRN_OBJ_KEY_NORMALIZE)
|
@@ -929,7 +940,7 @@ rb_grn_object_inspect_footer (VALUE self, VALUE inspected)
|
|
929
940
|
* call-seq:
|
930
941
|
* object.inspect -> 詳細情報
|
931
942
|
*
|
932
|
-
* _object_の詳細を示した文字列を返す。デバッグ用。
|
943
|
+
* _object_ の詳細を示した文字列を返す。デバッグ用。
|
933
944
|
*/
|
934
945
|
static VALUE
|
935
946
|
rb_grn_object_inspect (VALUE self)
|
@@ -950,8 +961,8 @@ rb_grn_object_inspect (VALUE self)
|
|
950
961
|
* call-seq:
|
951
962
|
* object.id -> ID/nil
|
952
963
|
*
|
953
|
-
* _object_のIDを返す。_object_が#closed?なときやIDがない場合
|
954
|
-
*
|
964
|
+
* _object_ のIDを返す。 _object_ が#closed?なときやIDがない場合
|
965
|
+
* は +nil+ を返す。
|
955
966
|
*/
|
956
967
|
VALUE
|
957
968
|
rb_grn_object_get_id (VALUE self)
|
@@ -976,8 +987,8 @@ rb_grn_object_get_id (VALUE self)
|
|
976
987
|
* call-seq:
|
977
988
|
* object.path -> ファイルパス/nil
|
978
989
|
*
|
979
|
-
* _object_に対応するファイルパスを返す。一時_object_
|
980
|
-
*
|
990
|
+
* _object_ に対応するファイルパスを返す。一時 _object_
|
991
|
+
* なら +nil+ を返す。
|
981
992
|
*/
|
982
993
|
static VALUE
|
983
994
|
rb_grn_object_get_path (VALUE self)
|
@@ -1003,8 +1014,8 @@ rb_grn_object_get_path (VALUE self)
|
|
1003
1014
|
* call-seq:
|
1004
1015
|
* object.temporary? -> true/false
|
1005
1016
|
*
|
1006
|
-
* _object_
|
1007
|
-
*
|
1017
|
+
* _object_ が一時オブジェクトなら +true+ 、永続オブジェクトな
|
1018
|
+
* ら +false+ を返す。
|
1008
1019
|
*/
|
1009
1020
|
static VALUE
|
1010
1021
|
rb_grn_object_temporary_p (VALUE self)
|
@@ -1024,8 +1035,8 @@ rb_grn_object_temporary_p (VALUE self)
|
|
1024
1035
|
* call-seq:
|
1025
1036
|
* object.persistent? -> true/false
|
1026
1037
|
*
|
1027
|
-
* _object_
|
1028
|
-
*
|
1038
|
+
* _object_ が永続オブジェクトなら +true+ 、一時オブジェクトな
|
1039
|
+
* ら +false+ を返す。
|
1029
1040
|
*/
|
1030
1041
|
static VALUE
|
1031
1042
|
rb_grn_object_persistent_p (VALUE self)
|
@@ -1045,9 +1056,9 @@ rb_grn_object_persistent_p (VALUE self)
|
|
1045
1056
|
* call-seq:
|
1046
1057
|
* object.domain -> Groonga::Object/nil
|
1047
1058
|
*
|
1048
|
-
* _object_の属しているGroonga::Objectを返す。例えば、
|
1059
|
+
* _object_ の属しているGroonga::Objectを返す。例えば、
|
1049
1060
|
* Groonga::ColumnはGroonga::Tableを返す。属している
|
1050
|
-
* Groonga::Object
|
1061
|
+
* Groonga::Objectがない場合は +nil+ を返す。
|
1051
1062
|
*/
|
1052
1063
|
static VALUE
|
1053
1064
|
rb_grn_object_get_domain (VALUE self)
|
@@ -1083,7 +1094,7 @@ rb_grn_object_get_domain (VALUE self)
|
|
1083
1094
|
* call-seq:
|
1084
1095
|
* object.name -> 名前/nil
|
1085
1096
|
*
|
1086
|
-
* _object_
|
1097
|
+
* _object_ の名前を返す。無名オブジェクトの場合は +nil+ を返す。
|
1087
1098
|
*/
|
1088
1099
|
static VALUE
|
1089
1100
|
rb_grn_object_get_name (VALUE self)
|
@@ -1117,11 +1128,11 @@ rb_grn_object_get_name (VALUE self)
|
|
1117
1128
|
* call-seq:
|
1118
1129
|
* object.range -> Groonga::Object/nil
|
1119
1130
|
*
|
1120
|
-
* _object_の値がとりうる範囲を示したGroonga::Objectを返す。
|
1131
|
+
* _object_ の値がとりうる範囲を示したGroonga::Objectを返す。
|
1121
1132
|
* 例えば、Groonga::Columnの場合は
|
1122
1133
|
* Groonga::Table#define_columnで指定されたGroonga::Typeや
|
1123
1134
|
* Groonga::Tableを返す。
|
1124
|
-
*
|
1135
|
+
* 範囲が指定されていないオブジェクトの場合は +nil+ を返す。
|
1125
1136
|
*/
|
1126
1137
|
static VALUE
|
1127
1138
|
rb_grn_object_get_range (VALUE self)
|
@@ -1157,8 +1168,8 @@ rb_grn_object_get_range (VALUE self)
|
|
1157
1168
|
* call-seq:
|
1158
1169
|
* object == other -> true/false
|
1159
1170
|
*
|
1160
|
-
* _object_と_other_が同じgroonga
|
1161
|
-
*
|
1171
|
+
* _object_ と _other_ が同じgroongaのオブジェクトなら +true+ を返
|
1172
|
+
* し、そうでなければ +false+ を返す。
|
1162
1173
|
*/
|
1163
1174
|
static VALUE
|
1164
1175
|
rb_grn_object_equal (VALUE self, VALUE other)
|
@@ -1184,7 +1195,7 @@ rb_grn_object_equal (VALUE self, VALUE other)
|
|
1184
1195
|
* call-seq:
|
1185
1196
|
* object[id] -> 値
|
1186
1197
|
*
|
1187
|
-
* _object_の_id_に対応する値を返す。
|
1198
|
+
* _object_ の _id_ に対応する値を返す。
|
1188
1199
|
*/
|
1189
1200
|
VALUE
|
1190
1201
|
rb_grn_object_array_reference (VALUE self, VALUE rb_id)
|
@@ -1212,6 +1223,7 @@ rb_grn_object_array_reference (VALUE self, VALUE rb_id)
|
|
1212
1223
|
switch (object->header.type) {
|
1213
1224
|
case GRN_TABLE_HASH_KEY:
|
1214
1225
|
case GRN_TABLE_PAT_KEY:
|
1226
|
+
case GRN_TABLE_DAT_KEY:
|
1215
1227
|
case GRN_TABLE_NO_KEY:
|
1216
1228
|
GRN_OBJ_INIT(&value, GRN_BULK, 0, GRN_ID_NIL);
|
1217
1229
|
break;
|
@@ -1271,6 +1283,7 @@ rb_uvector_value_p (RbGrnObject *rb_grn_object, VALUE rb_value)
|
|
1271
1283
|
break;
|
1272
1284
|
case GRN_TABLE_HASH_KEY:
|
1273
1285
|
case GRN_TABLE_PAT_KEY:
|
1286
|
+
case GRN_TABLE_DAT_KEY:
|
1274
1287
|
case GRN_TABLE_NO_KEY:
|
1275
1288
|
case GRN_TABLE_VIEW:
|
1276
1289
|
first_element = rb_ary_entry(rb_value, 0);
|
@@ -1345,7 +1358,7 @@ rb_grn_object_set (VALUE self, VALUE rb_id, VALUE rb_value, int flags)
|
|
1345
1358
|
* call-seq:
|
1346
1359
|
* object[id] = value
|
1347
1360
|
*
|
1348
|
-
* _object_の_id_に対応する値を設定する。既存の値は上書きさ
|
1361
|
+
* _object_ の _id_ に対応する値を設定する。既存の値は上書きさ
|
1349
1362
|
* れる。
|
1350
1363
|
*/
|
1351
1364
|
static VALUE
|
@@ -1360,7 +1373,7 @@ rb_grn_object_array_set (VALUE self, VALUE rb_id, VALUE rb_value)
|
|
1360
1373
|
* call-seq:
|
1361
1374
|
* object.append(id, value)
|
1362
1375
|
*
|
1363
|
-
* _object_の_id_に対応する値の最後に_value_を追加する。
|
1376
|
+
* _object_ の _id_ に対応する値の最後に _value_ を追加する。
|
1364
1377
|
*/
|
1365
1378
|
static VALUE
|
1366
1379
|
rb_grn_object_append_value (VALUE self, VALUE rb_id, VALUE rb_value)
|
@@ -1374,7 +1387,7 @@ rb_grn_object_append_value (VALUE self, VALUE rb_id, VALUE rb_value)
|
|
1374
1387
|
* call-seq:
|
1375
1388
|
* object.prepend(id, value)
|
1376
1389
|
*
|
1377
|
-
* _object_の_id_に対応する値の最初に_value_を追加する。
|
1390
|
+
* _object_ の _id_ に対応する値の最初に _value_ を追加する。
|
1378
1391
|
*/
|
1379
1392
|
static VALUE
|
1380
1393
|
rb_grn_object_prepend_value (VALUE self, VALUE rb_id, VALUE rb_value)
|
@@ -1388,7 +1401,7 @@ rb_grn_object_prepend_value (VALUE self, VALUE rb_id, VALUE rb_value)
|
|
1388
1401
|
* call-seq:
|
1389
1402
|
* object.remove
|
1390
1403
|
*
|
1391
|
-
* _object_をメモリから解放し、それが永続オブジェクトであっ
|
1404
|
+
* _object_ をメモリから解放し、それが永続オブジェクトであっ
|
1392
1405
|
* た場合は、該当するファイル一式を削除する。
|
1393
1406
|
*/
|
1394
1407
|
static VALUE
|