rroonga 9.0.2 → 10.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/Rakefile +9 -142
- data/doc/text/news.md +73 -1
- data/doc/text/tutorial.md +1 -1
- data/ext/groonga/extconf.rb +9 -74
- data/ext/groonga/rb-grn-context.c +27 -0
- data/ext/groonga/rb-grn-expression-builder.c +3 -3
- data/ext/groonga/rb-grn-flushable.c +7 -0
- data/ext/groonga/rb-grn-index-column.c +28 -0
- data/ext/groonga/rb-grn-index-cursor.c +19 -0
- data/ext/groonga/rb-grn-logger.c +17 -3
- data/ext/groonga/rb-grn-object.c +236 -22
- data/ext/groonga/rb-grn-table-key-support.c +26 -7
- data/ext/groonga/rb-grn-table.c +119 -87
- data/ext/groonga/rb-grn-type.c +5 -1
- data/ext/groonga/rb-grn-utils.c +17 -1
- data/ext/groonga/rb-grn.h +7 -13
- data/ext/groonga/rb-groonga.c +2 -2
- data/lib/groonga.rb +3 -7
- data/lib/groonga/dumper.rb +3 -0
- data/lib/groonga/record.rb +2 -2
- data/rroonga.gemspec +4 -5
- data/test/groonga-test-utils.rb +34 -5
- data/test/run-test.rb +1 -3
- data/test/test-accessor.rb +63 -7
- data/test/test-column.rb +12 -1
- data/test/test-context.rb +25 -0
- data/test/test-exception.rb +5 -0
- data/test/test-flushable.rb +51 -6
- data/test/test-index-column.rb +67 -6
- data/test/test-index-cursor.rb +26 -0
- data/test/test-logger.rb +56 -11
- data/test/test-plugin.rb +1 -0
- data/test/test-query-logger.rb +4 -3
- data/test/test-record.rb +2 -1
- data/test/test-remote.rb +56 -10
- data/test/test-schema-dumper.rb +13 -0
- data/test/test-schema.rb +9 -1
- data/test/test-table-arrow.rb +1 -1
- data/test/test-table.rb +21 -1
- data/test/test-variable.rb +23 -7
- metadata +65 -106
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2
2
|
/*
|
3
|
-
Copyright (C) 2009-
|
3
|
+
Copyright (C) 2009-2020 Sutou Kouhei <kou@clear-code.com>
|
4
4
|
Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
|
5
5
|
|
6
6
|
This library is free software; you can redistribute it and/or
|
@@ -481,8 +481,10 @@ typedef struct _SetValueData
|
|
481
481
|
} SetValueData;
|
482
482
|
|
483
483
|
static VALUE
|
484
|
-
set_value (
|
484
|
+
set_value (RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg))
|
485
485
|
{
|
486
|
+
VALUE args = yielded_arg;
|
487
|
+
SetValueData *data = (SetValueData *)callback_arg;
|
486
488
|
VALUE rb_name, rb_value, rb_column;
|
487
489
|
RbGrnObject *rb_grn_object;
|
488
490
|
|
@@ -911,7 +913,9 @@ rb_grn_table_key_support_get_normalizer (VALUE self)
|
|
911
913
|
* # Specifies normalizer object.
|
912
914
|
* table.normalizer = Groonga::Context["NormalizerNFKC51"]
|
913
915
|
* # Uses auto normalizer that is a normalizer for backward compatibility.
|
914
|
-
* table.normalizer = "
|
916
|
+
* table.normalizer = "NormalizerAuto"
|
917
|
+
* # Uses a normalizer with options.
|
918
|
+
* table.normalizer = "NormalizerNFKC121('unify_kana', true)"
|
915
919
|
*
|
916
920
|
* @overload normalizer=(name)
|
917
921
|
* @param [String] name Set a nomalizer named @name@.
|
@@ -927,7 +931,6 @@ rb_grn_table_key_support_set_normalizer (VALUE self, VALUE rb_normalizer)
|
|
927
931
|
{
|
928
932
|
grn_ctx *context;
|
929
933
|
grn_obj *table;
|
930
|
-
grn_obj *normalizer;
|
931
934
|
grn_rc rc;
|
932
935
|
|
933
936
|
rb_grn_table_key_support_deconstruct(SELF(self), &table, &context,
|
@@ -935,9 +938,25 @@ rb_grn_table_key_support_set_normalizer (VALUE self, VALUE rb_normalizer)
|
|
935
938
|
NULL, NULL, NULL,
|
936
939
|
NULL);
|
937
940
|
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
+
if (RB_TYPE_P(rb_normalizer, RUBY_T_STRING)) {
|
942
|
+
grn_obj normalizer;
|
943
|
+
VALUE exception;
|
944
|
+
GRN_TEXT_INIT(&normalizer, GRN_OBJ_DO_SHALLOW_COPY);
|
945
|
+
GRN_TEXT_SET(context,
|
946
|
+
&normalizer,
|
947
|
+
RSTRING_PTR(rb_normalizer),
|
948
|
+
RSTRING_LEN(rb_normalizer));
|
949
|
+
rc = grn_obj_set_info(context, table, GRN_INFO_NORMALIZER, &normalizer);
|
950
|
+
exception = rb_grn_context_to_exception(context, self);
|
951
|
+
GRN_OBJ_FIN(context, &normalizer);
|
952
|
+
if (!NIL_P(exception)) {
|
953
|
+
rb_exc_raise(exception);
|
954
|
+
}
|
955
|
+
} else {
|
956
|
+
grn_obj *normalizer = RVAL2GRNOBJECT(rb_normalizer, &context);
|
957
|
+
rc = grn_obj_set_info(context, table, GRN_INFO_NORMALIZER, normalizer);
|
958
|
+
rb_grn_context_check(context, self);
|
959
|
+
}
|
941
960
|
rb_grn_rc_check(rc, self);
|
942
961
|
|
943
962
|
return Qnil;
|
data/ext/groonga/rb-grn-table.c
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
/*
|
3
3
|
Copyright (C) 2009-2017 Kouhei Sutou <kou@clear-code.com>
|
4
4
|
Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
|
5
|
+
Copyright (C) 2019 Horimoto Yasuhiro <horimoto@clear-code.com>
|
5
6
|
|
6
7
|
This library is free software; you can redistribute it and/or
|
7
8
|
modify it under the terms of the GNU Lesser General Public
|
@@ -29,9 +30,9 @@ static ID id_array_set;
|
|
29
30
|
/*
|
30
31
|
* Document-class: Groonga::Table < Groonga::Object
|
31
32
|
*
|
32
|
-
* Rroonga
|
33
|
-
*
|
34
|
-
*
|
33
|
+
* This class is base class which represents Rroonga's table.
|
34
|
+
* {Groonga::Array} , {Groonga::Hash} , {Groonga::PatriciaTrie}
|
35
|
+
* are extended from this class.
|
35
36
|
*/
|
36
37
|
|
37
38
|
grn_obj *
|
@@ -183,7 +184,8 @@ rb_grn_table_inspect_content (VALUE self, VALUE inspected)
|
|
183
184
|
}
|
184
185
|
|
185
186
|
/*
|
186
|
-
*
|
187
|
+
* This function return contents of a table as a string.
|
188
|
+
* It's easy to understand for human.
|
187
189
|
*
|
188
190
|
* @overload inspect
|
189
191
|
* @return [String]
|
@@ -203,31 +205,33 @@ rb_grn_table_inspect (VALUE self)
|
|
203
205
|
}
|
204
206
|
|
205
207
|
/*
|
206
|
-
*
|
207
|
-
*
|
208
|
+
* Defines a column that name is `name` and type is `value_type`. It
|
209
|
+
* returns the newly defined column.
|
208
210
|
*
|
209
211
|
* @overload define_column(name, value_type, options={})
|
210
212
|
* @param options [::Hash] The name and value
|
211
213
|
* pairs. Omitted names are initialized as the default value.
|
212
|
-
* @option options :path
|
213
|
-
*
|
214
|
-
*
|
215
|
-
*
|
216
|
-
*
|
217
|
-
*
|
214
|
+
* @option options :path [String, nil] (nil)
|
215
|
+
* The path to store the content of the column.
|
216
|
+
* If this is omitted, path is generated automatically.
|
217
|
+
* @option options :persistent [Boolean] (true)
|
218
|
+
* Whether the column is a persistent column or not.
|
219
|
+
* If this is `true` and `:path` is omitted, path is generated
|
220
|
+
* automatically.
|
218
221
|
* @option options :type (:scalar)
|
219
|
-
*
|
220
|
-
* +:scalar+
|
222
|
+
* This option specifies how to store a value of a column.
|
223
|
+
* If this option is omitted, +:scalar+ is used.
|
221
224
|
*
|
222
|
-
* - +:scalar+ :=
|
223
|
-
* - +:vector+ :=
|
225
|
+
* - +:scalar+ := Store scalar value.
|
226
|
+
* - +:vector+ := Store array value.
|
224
227
|
* @option options [Boolean] :with_weight (false)
|
225
228
|
* It specifies whether making the column weight vector column or not.
|
226
229
|
* Weight vector column can store weight for each element.
|
227
230
|
*
|
228
231
|
* You can't use this option for scalar column.
|
229
232
|
* @option options :compress
|
230
|
-
*
|
233
|
+
* This option specifies how to compress values.
|
234
|
+
* If we omit this option, values are not compressed.
|
231
235
|
*
|
232
236
|
* * `:zlib`: Compressed by zlib.
|
233
237
|
* * `:lz4`: Compressed by LZ4.
|
@@ -345,32 +349,37 @@ rb_grn_table_define_column (int argc, VALUE *argv, VALUE self)
|
|
345
349
|
}
|
346
350
|
|
347
351
|
/*
|
348
|
-
*
|
349
|
-
*
|
352
|
+
* Defines an index column that name is `name` and type is
|
353
|
+
* `value_type`. It returns the newly defined index column.
|
350
354
|
*
|
351
355
|
* @overload define_index_column(name, value_type, options={})
|
352
356
|
* @param options [::Hash] The name and value
|
353
357
|
* pairs. Omitted names are initialized as the default value.
|
354
|
-
* @option options :path
|
355
|
-
*
|
356
|
-
*
|
357
|
-
*
|
358
|
-
*
|
359
|
-
*
|
360
|
-
*
|
361
|
-
*
|
362
|
-
*
|
363
|
-
*
|
364
|
-
*
|
365
|
-
*
|
366
|
-
*
|
367
|
-
*
|
368
|
-
*
|
369
|
-
*
|
370
|
-
*
|
371
|
-
*
|
372
|
-
*
|
373
|
-
*
|
358
|
+
* @option options :path [String, nil] (nil)
|
359
|
+
* The path to store the content of the index column.
|
360
|
+
* If this is omitted, path is generated automatically.
|
361
|
+
* @option options :persistent [Boolean] (true)
|
362
|
+
* Whether the index column is a persistent indent column or not.
|
363
|
+
* If this is `true` and `:path` is omitted, path is generated
|
364
|
+
* automatically.
|
365
|
+
* @option options :with_section [Boolean] (false)
|
366
|
+
* Whether section information is stored to the index column or not.
|
367
|
+
* @option options :with_weight [Boolean] (false)
|
368
|
+
* Whether weight information is stored to the index column or not.
|
369
|
+
* @option options :with_position [Boolean] (false)
|
370
|
+
* Whether position information is stored to the index column or not.
|
371
|
+
* @option options :size [Symbol, nil] (nil)
|
372
|
+
* The size of index column. It must be `nil`, `:small`,
|
373
|
+
* `:medium` or `:large`. `nil` means the default size.
|
374
|
+
* `:small` means small size. `:medium` means medium size. Medium size
|
375
|
+
* is smaller than the default size. `:large` means large size.
|
376
|
+
* Large size is larger than the default size.
|
377
|
+
* @option options :source [Groonga::Column, nil] (nil)
|
378
|
+
* Specifies the source column of the index column.
|
379
|
+
* This option can't be used with `:sources`.
|
380
|
+
* @option options :sources [::Array<Groonga::Column>, nil] (nil)
|
381
|
+
* Specifies the source columns of the index column.
|
382
|
+
* This option can't be used with `:source`.
|
374
383
|
*
|
375
384
|
* @return [Groonga::IndexColumn]
|
376
385
|
*/
|
@@ -461,9 +470,11 @@ rb_grn_table_define_index_column (int argc, VALUE *argv, VALUE self)
|
|
461
470
|
flags |= GRN_OBJ_INDEX_SMALL;
|
462
471
|
} else if (rb_grn_equal_option(rb_size, "medium")) {
|
463
472
|
flags |= GRN_OBJ_INDEX_MEDIUM;
|
473
|
+
} else if (rb_grn_equal_option(rb_size, "large")) {
|
474
|
+
flags |= GRN_OBJ_INDEX_LARGE;
|
464
475
|
} else {
|
465
476
|
rb_raise(rb_eArgError,
|
466
|
-
":size must be nil, :small or :
|
477
|
+
":size must be nil, :small, :medium or :large: <%" PRIsVALUE ">",
|
467
478
|
rb_size);
|
468
479
|
}
|
469
480
|
|
@@ -514,8 +525,8 @@ ruby_object_to_column_name (VALUE rb_name,
|
|
514
525
|
}
|
515
526
|
|
516
527
|
/*
|
517
|
-
*
|
518
|
-
*
|
528
|
+
* It returns the column has the specified name.
|
529
|
+
* If the specified column does not exist, it returns `nil`.
|
519
530
|
*
|
520
531
|
* @overload column(name)
|
521
532
|
* @return [Groonga::Column, nil]
|
@@ -595,11 +606,15 @@ rb_grn_table_get_column_surely (VALUE self, VALUE rb_name)
|
|
595
606
|
}
|
596
607
|
|
597
608
|
/*
|
598
|
-
*
|
599
|
-
*
|
609
|
+
* @overload columns(prefix=nil)
|
610
|
+
* It returns the specified columns in the table.
|
600
611
|
*
|
601
|
-
*
|
602
|
-
*
|
612
|
+
* @param prefix [String, nil]
|
613
|
+
* If this is `nil`, it returns the all columns in table.
|
614
|
+
*
|
615
|
+
* Otherwise it returns columns which have name starts with `prefix`.
|
616
|
+
*
|
617
|
+
* @return [::Array<Groonga::Column>]
|
603
618
|
*/
|
604
619
|
static VALUE
|
605
620
|
rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
|
@@ -611,9 +626,9 @@ rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
|
|
611
626
|
grn_rc rc;
|
612
627
|
int n;
|
613
628
|
grn_table_cursor *cursor;
|
614
|
-
VALUE
|
615
|
-
char *
|
616
|
-
unsigned
|
629
|
+
VALUE rb_prefix, rb_columns;
|
630
|
+
char *prefix = NULL;
|
631
|
+
unsigned prefix_size = 0;
|
617
632
|
VALUE exception;
|
618
633
|
|
619
634
|
rb_grn_table_deconstruct(SELF(self), &table, &context,
|
@@ -621,18 +636,18 @@ rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
|
|
621
636
|
NULL, NULL, NULL,
|
622
637
|
NULL);
|
623
638
|
|
624
|
-
rb_scan_args(argc, argv, "01", &
|
639
|
+
rb_scan_args(argc, argv, "01", &rb_prefix);
|
625
640
|
|
626
|
-
if (!NIL_P(
|
627
|
-
|
628
|
-
|
641
|
+
if (!NIL_P(rb_prefix)) {
|
642
|
+
prefix = StringValuePtr(rb_prefix);
|
643
|
+
prefix_size = RSTRING_LEN(rb_prefix);
|
629
644
|
}
|
630
645
|
|
631
646
|
key_type = grn_ctx_at(context, GRN_DB_SHORT_TEXT);
|
632
647
|
columns = grn_table_create(context, NULL, 0, NULL, GRN_TABLE_HASH_KEY,
|
633
648
|
key_type, 0);
|
634
649
|
rb_grn_context_check(context, self);
|
635
|
-
n = grn_table_columns(context, table,
|
650
|
+
n = grn_table_columns(context, table, prefix, prefix_size, columns);
|
636
651
|
rb_grn_context_check(context, self);
|
637
652
|
|
638
653
|
rb_columns = rb_ary_new2(n);
|
@@ -690,9 +705,10 @@ rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
|
|
690
705
|
}
|
691
706
|
|
692
707
|
/*
|
693
|
-
*
|
708
|
+
* Checks whether the table has a specified column or not.
|
694
709
|
*
|
695
710
|
* @overload have_column?(name)
|
711
|
+
* @return [Boolean] `true` if the table has a `name` column, `false` otherwise.
|
696
712
|
*/
|
697
713
|
static VALUE
|
698
714
|
rb_grn_table_have_column (VALUE self, VALUE rb_name)
|
@@ -873,11 +889,10 @@ rb_grn_table_open_cursor (int argc, VALUE *argv, VALUE self)
|
|
873
889
|
}
|
874
890
|
|
875
891
|
/*
|
876
|
-
* テーブルに登録されている全てのレコードが入っている配列を
|
877
|
-
* 返す。
|
878
|
-
*
|
879
892
|
* @overload records
|
880
|
-
*
|
893
|
+
* It returns all records in the table.
|
894
|
+
*
|
895
|
+
* @return [::Array<Groonga::Record>]
|
881
896
|
*/
|
882
897
|
static VALUE
|
883
898
|
rb_grn_table_get_records (int argc, VALUE *argv, VALUE self)
|
@@ -898,9 +913,9 @@ rb_grn_table_get_records (int argc, VALUE *argv, VALUE self)
|
|
898
913
|
}
|
899
914
|
|
900
915
|
/*
|
901
|
-
* テーブルに登録されているレコード数を返す。
|
902
|
-
*
|
903
916
|
* @overload size
|
917
|
+
* It returns the number of records in the table.
|
918
|
+
*
|
904
919
|
* @return [Integer]
|
905
920
|
*/
|
906
921
|
static VALUE
|
@@ -919,9 +934,10 @@ rb_grn_table_get_size (VALUE self)
|
|
919
934
|
}
|
920
935
|
|
921
936
|
/*
|
922
|
-
* テーブルにレコードが登録されていなければ +true+ を返す。
|
923
|
-
*
|
924
937
|
* @overload empty?
|
938
|
+
*
|
939
|
+
* @return [Boolean] `true` if the table has no records,
|
940
|
+
* `false` otherwise.
|
925
941
|
*/
|
926
942
|
static VALUE
|
927
943
|
rb_grn_table_empty_p (VALUE self)
|
@@ -939,9 +955,11 @@ rb_grn_table_empty_p (VALUE self)
|
|
939
955
|
}
|
940
956
|
|
941
957
|
/*
|
942
|
-
*
|
958
|
+
* Deletes all records in the table at once.
|
943
959
|
*
|
944
960
|
* @overload truncate
|
961
|
+
*
|
962
|
+
* @return [void]
|
945
963
|
*/
|
946
964
|
static VALUE
|
947
965
|
rb_grn_table_truncate (VALUE self)
|
@@ -1112,7 +1130,7 @@ rb_grn_table_delete_by_expression (VALUE self)
|
|
1112
1130
|
*
|
1113
1131
|
* @param id [Integer] The ID of delete target record.
|
1114
1132
|
*
|
1115
|
-
* @return void
|
1133
|
+
* @return [void]
|
1116
1134
|
*
|
1117
1135
|
* @overload delete
|
1118
1136
|
* Delete records that are matched with the given condition
|
@@ -1130,7 +1148,7 @@ rb_grn_table_delete_by_expression (VALUE self)
|
|
1130
1148
|
* @yieldreturn [Groonga::ExpressionBuilder]
|
1131
1149
|
* TODO: See #select.
|
1132
1150
|
*
|
1133
|
-
* @return void
|
1151
|
+
* @return [void]
|
1134
1152
|
*/
|
1135
1153
|
static VALUE
|
1136
1154
|
rb_grn_table_delete (int argc, VALUE *argv, VALUE self)
|
@@ -1613,9 +1631,10 @@ rb_grn_table_each_sub_record (VALUE self, VALUE rb_id)
|
|
1613
1631
|
}
|
1614
1632
|
|
1615
1633
|
/*
|
1616
|
-
*
|
1634
|
+
* It returns the {Groonga::Record} for the `id` in the `table`.
|
1617
1635
|
*
|
1618
|
-
*
|
1636
|
+
* The return value has been changed to {Groonga::Record} from `id`
|
1637
|
+
* itself since 0.9.0.
|
1619
1638
|
*
|
1620
1639
|
* @overload [](id)
|
1621
1640
|
* @return [Groonga::Record]
|
@@ -1653,16 +1672,16 @@ rb_grn_table_get_value (VALUE self, VALUE rb_id)
|
|
1653
1672
|
}
|
1654
1673
|
|
1655
1674
|
/*
|
1656
|
-
*
|
1675
|
+
* It returns the value for the `id` in the `table`.
|
1657
1676
|
*
|
1658
|
-
*
|
1659
|
-
* {Groonga::Array}
|
1660
|
-
*
|
1677
|
+
* You can specify `id: true` for the convenience. `id: true` works
|
1678
|
+
* with {Groonga::Array} like for {Groonga::Hash},
|
1679
|
+
* {Groonga::PatriciaTrie} and so on.
|
1661
1680
|
*
|
1662
1681
|
* @overload value(id)
|
1663
|
-
* @return [
|
1664
|
-
* @overload value(id, :
|
1665
|
-
* @return [
|
1682
|
+
* @return [value]
|
1683
|
+
* @overload value(id, id: true)
|
1684
|
+
* @return [value]
|
1666
1685
|
*/
|
1667
1686
|
static VALUE
|
1668
1687
|
rb_grn_table_get_value_convenience (int argc, VALUE *argv, VALUE self)
|
@@ -2482,8 +2501,8 @@ rb_grn_table_support_key_p (VALUE self)
|
|
2482
2501
|
/*
|
2483
2502
|
* @overload support_value?
|
2484
2503
|
*
|
2485
|
-
* @return
|
2486
|
-
*
|
2504
|
+
* @return [Boolean] `true` if the table is created with value type,
|
2505
|
+
* `false` otherwise.
|
2487
2506
|
*/
|
2488
2507
|
static VALUE
|
2489
2508
|
rb_grn_table_support_value_p (VALUE self)
|
@@ -2498,11 +2517,11 @@ rb_grn_table_support_value_p (VALUE self)
|
|
2498
2517
|
}
|
2499
2518
|
|
2500
2519
|
/*
|
2501
|
-
* グループ化したとき、テーブルにグループに含まれるレコード
|
2502
|
-
* 数を格納できる場合は +true+ 、格納できない場合は +false+ を返
|
2503
|
-
* す。
|
2504
|
-
*
|
2505
2520
|
* @overload support_sub_records?
|
2521
|
+
*
|
2522
|
+
* @return [Boolean] `true` if the table can store the number of
|
2523
|
+
* records for each group when the table is grouped, `false`
|
2524
|
+
* otherwise.
|
2506
2525
|
*/
|
2507
2526
|
static VALUE
|
2508
2527
|
rb_grn_table_support_sub_records_p (VALUE self)
|
@@ -2517,6 +2536,19 @@ rb_grn_table_support_sub_records_p (VALUE self)
|
|
2517
2536
|
return CBOOL2RVAL(grn_table_is_grouped(context, table));
|
2518
2537
|
}
|
2519
2538
|
|
2539
|
+
/*
|
2540
|
+
* @overload support_score?
|
2541
|
+
*
|
2542
|
+
* @return [Boolean] `true` if the table has `_score` column,
|
2543
|
+
* `false` otherwise.
|
2544
|
+
*/
|
2545
|
+
static VALUE
|
2546
|
+
rb_grn_table_support_score_p (VALUE self)
|
2547
|
+
{
|
2548
|
+
return CBOOL2RVAL(rb_grn_table_have_column(self,
|
2549
|
+
rb_str_new_literal("_score")));
|
2550
|
+
}
|
2551
|
+
|
2520
2552
|
/*
|
2521
2553
|
* {Groonga::Table#group} returns a table that contains grouped
|
2522
2554
|
* records. If grouped table has a space to store the number of
|
@@ -2554,13 +2586,11 @@ rb_grn_table_have_n_sub_records_space_p (VALUE self)
|
|
2554
2586
|
}
|
2555
2587
|
|
2556
2588
|
/*
|
2557
|
-
* _table_ に _id_ で指定したIDのレコードが存在する場合は +true+ 、
|
2558
|
-
* 存在しない場合は +false+ を返す。
|
2559
|
-
*
|
2560
|
-
* 注意: 実行には相応のコストがかかるのであまり頻繁に呼ばな
|
2561
|
-
* いようにして下さい。
|
2562
|
-
*
|
2563
2589
|
* @overload exist?(id)
|
2590
|
+
* @return [Boolean] `true` if the table has a record specified ID
|
2591
|
+
* by `id`, `false` otherwise.
|
2592
|
+
*
|
2593
|
+
* @note This method is heavy. You should not call this as much as possible.
|
2564
2594
|
*/
|
2565
2595
|
static VALUE
|
2566
2596
|
rb_grn_table_exist_p (VALUE self, VALUE id)
|
@@ -2890,6 +2920,8 @@ rb_grn_init_table (VALUE mGrn)
|
|
2890
2920
|
rb_grn_table_support_value_p, 0);
|
2891
2921
|
rb_define_method(rb_cGrnTable, "support_sub_records?",
|
2892
2922
|
rb_grn_table_support_sub_records_p, 0);
|
2923
|
+
rb_define_method(rb_cGrnTable, "support_score?",
|
2924
|
+
rb_grn_table_support_score_p, 0);
|
2893
2925
|
rb_define_method(rb_cGrnTable, "have_n_sub_records_space?",
|
2894
2926
|
rb_grn_table_have_n_sub_records_space_p, 0);
|
2895
2927
|
|