rroonga 1.0.1-x86-mingw32 → 1.1.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS.ja.rdoc +146 -0
- data/NEWS.rdoc +146 -0
- data/README.ja.rdoc +7 -5
- data/README.rdoc +6 -5
- data/Rakefile +170 -18
- data/benchmark/create-wikipedia-database.rb +212 -0
- data/benchmark/read-write-many-small-items.rb +0 -0
- data/benchmark/repeat-load.rb +213 -0
- data/benchmark/select.rb +1052 -0
- data/benchmark/write-many-small-items.rb +0 -0
- data/example/bookmark.rb +94 -91
- data/example/index-html.rb +0 -0
- data/ext/groonga/extconf.rb +6 -6
- data/ext/groonga/rb-grn-accessor.c +1 -1
- data/ext/groonga/rb-grn-array.c +1 -1
- data/ext/groonga/rb-grn-column.c +201 -10
- data/ext/groonga/rb-grn-context.c +119 -20
- data/ext/groonga/rb-grn-database.c +27 -4
- data/ext/groonga/rb-grn-exception.c +15 -0
- data/ext/groonga/rb-grn-expression.c +14 -10
- data/ext/groonga/rb-grn-hash.c +4 -4
- data/ext/groonga/rb-grn-index-column.c +10 -6
- data/ext/groonga/rb-grn-logger.c +2 -2
- data/ext/groonga/rb-grn-object.c +33 -29
- data/ext/groonga/{rb-grn-operation.c → rb-grn-operator.c} +89 -87
- data/ext/groonga/rb-grn-patricia-trie.c +12 -12
- data/ext/groonga/rb-grn-plugin.c +134 -0
- data/ext/groonga/rb-grn-procedure.c +1 -1
- data/ext/groonga/rb-grn-query.c +7 -7
- data/ext/groonga/rb-grn-snippet.c +4 -3
- data/ext/groonga/rb-grn-table-cursor.c +1 -1
- data/ext/groonga/rb-grn-table-key-support.c +27 -24
- data/ext/groonga/rb-grn-table.c +119 -58
- data/ext/groonga/rb-grn-type.c +1 -1
- data/ext/groonga/rb-grn-utils.c +20 -19
- data/ext/groonga/rb-grn-variable.c +1 -1
- data/ext/groonga/rb-grn-view-accessor.c +1 -1
- data/ext/groonga/rb-grn-view.c +1 -1
- data/ext/groonga/rb-grn.h +26 -20
- data/ext/groonga/rb-groonga.c +6 -4
- data/extconf.rb +10 -4
- data/html/developer.html +8 -2
- data/html/favicon.ico +0 -0
- data/html/favicon.svg +591 -0
- data/html/index.html +78 -12
- data/html/logo.svg +612 -0
- data/html/ranguba.css +92 -7
- data/html/readme.svg +256 -0
- data/lib/groonga.so +0 -0
- data/lib/groonga/context.rb +52 -1
- data/lib/groonga/expression-builder.rb +42 -6
- data/lib/groonga/record.rb +84 -15
- data/lib/groonga/schema.rb +524 -122
- data/pkg/rroonga-1.1.0-x86-mingw32/NEWS.ja.rdoc +326 -0
- data/pkg/rroonga-1.1.0-x86-mingw32/NEWS.rdoc +328 -0
- data/pkg/rroonga-1.1.0-x86-mingw32/README.ja.rdoc +68 -0
- data/pkg/rroonga-1.1.0-x86-mingw32/README.rdoc +68 -0
- data/pkg/rroonga-1.1.0-x86-mingw32/text/expression.rdoc +285 -0
- data/{text/TUTORIAL.ja.rdoc → pkg/rroonga-1.1.0-x86-mingw32/text/tutorial.ja.rdoc} +165 -126
- data/pkg/rroonga-1.1.0/NEWS.ja.rdoc +326 -0
- data/pkg/rroonga-1.1.0/NEWS.rdoc +328 -0
- data/pkg/rroonga-1.1.0/README.ja.rdoc +68 -0
- data/pkg/rroonga-1.1.0/README.rdoc +68 -0
- data/pkg/rroonga-1.1.0/text/expression.rdoc +285 -0
- data/pkg/rroonga-1.1.0/text/tutorial.ja.rdoc +433 -0
- data/rroonga-build.rb +3 -3
- data/test/run-test.rb +1 -1
- data/test/test-array.rb +4 -0
- data/test/test-column.rb +31 -1
- data/test/test-context-select.rb +45 -14
- data/test/test-context.rb +44 -0
- data/test/test-database.rb +21 -1
- data/test/test-expression-builder.rb +46 -5
- data/test/test-fix-size-column.rb +12 -0
- data/test/test-hash.rb +10 -4
- data/test/test-index-column.rb +33 -0
- data/test/test-patricia-trie.rb +6 -0
- data/test/test-plugin.rb +29 -0
- data/test/test-record.rb +84 -1
- data/test/test-remote.rb +3 -2
- data/test/test-schema-create-table.rb +32 -2
- data/test/test-schema-type.rb +167 -0
- data/test/test-schema.rb +159 -12
- data/test/test-table-select-weight.rb +20 -1
- data/test/test-table-select.rb +12 -0
- data/test/test-table.rb +65 -0
- data/test/test-variable-size-column.rb +12 -0
- data/text/tutorial.ja.rdoc +433 -0
- data/vendor/local/bin/grntest.exe +0 -0
- data/vendor/local/bin/groonga.exe +0 -0
- data/vendor/local/bin/libgroonga-0.dll +0 -0
- data/vendor/local/etc/groonga/init.d/redhat/groonga +1 -9
- data/vendor/local/include/groonga/groonga.h +156 -6
- data/vendor/local/include/groonga/groonga/plugin.h +44 -0
- data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
- data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
- data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
- data/vendor/local/lib/groonga/{modules → plugins}/suggest/suggest.la +2 -2
- data/vendor/local/lib/libgroonga.a +0 -0
- data/vendor/local/lib/libgroonga.dll.a +0 -0
- data/vendor/local/lib/libgroonga.la +1 -1
- data/vendor/local/lib/pkgconfig/groonga.pc +3 -2
- data/vendor/local/share/groonga/examples/dictionary/edict/edict_import.sh +14 -3
- data/vendor/local/share/groonga/examples/dictionary/eijiro/eijiro_import.sh +3 -1
- data/vendor/local/share/groonga/examples/dictionary/gene95/gene_import.sh +19 -3
- data/vendor/local/share/groonga/munin/plugins/groonga_cpu_load +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_cpu_time +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_disk +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_memory +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_n_records +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_query_performance +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_status +0 -0
- metadata +91 -341
- data/html/favicon.xcf +0 -0
- data/html/logo.xcf +0 -0
- data/lib/1.8/groonga.so +0 -0
- data/lib/1.9/groonga.so +0 -0
- data/license/GPL +0 -340
- data/license/RUBY +0 -59
- data/vendor/local/lib/groonga/modules/suggest/suggest.a +0 -0
- data/vendor/local/lib/groonga/modules/suggest/suggest.dll +0 -0
- data/vendor/local/lib/groonga/modules/suggest/suggest.dll.a +0 -0
- data/vendor/local/share/groonga/doc/ja/html/.buildinfo +0 -4
- data/vendor/local/share/groonga/doc/ja/html/_sources/characteristic.txt +0 -56
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/cache_limit.txt +0 -52
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/check.txt +0 -164
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/clearlock.txt +0 -61
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_create.txt +0 -93
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_list.txt +0 -97
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_remove.txt +0 -58
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/define_selector.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/defrag.txt +0 -57
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/delete.txt +0 -68
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/dump.txt +0 -62
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/load.txt +0 -98
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_level.txt +0 -65
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_put.txt +0 -69
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_reopen.txt +0 -66
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/quit.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/select.txt +0 -247
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/shutdown.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/status.txt +0 -59
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/suggest.txt +0 -79
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_create.txt +0 -111
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_list.txt +0 -87
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_remove.txt +0 -50
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/view_add.txt +0 -53
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/add.txt +0 -102
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/get.txt +0 -78
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/set.txt +0 -103
- data/vendor/local/share/groonga/doc/ja/html/_sources/developer.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/html/_sources/developer/com.txt +0 -18
- data/vendor/local/share/groonga/doc/ja/html/_sources/developer/document.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/html/_sources/developer/query.txt +0 -212
- data/vendor/local/share/groonga/doc/ja/html/_sources/developer/test.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/html/_sources/execfile.txt +0 -226
- data/vendor/local/share/groonga/doc/ja/html/_sources/expr.txt +0 -43
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/edit_distance.txt +0 -48
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_distance.txt +0 -51
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_in_circle.txt +0 -54
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_in_rectangle.txt +0 -55
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/now.txt +0 -34
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/rand.txt +0 -41
- data/vendor/local/share/groonga/doc/ja/html/_sources/grnslap.txt +0 -64
- data/vendor/local/share/groonga/doc/ja/html/_sources/grntest.txt +0 -259
- data/vendor/local/share/groonga/doc/ja/html/_sources/http.txt +0 -52
- data/vendor/local/share/groonga/doc/ja/html/_sources/index.txt +0 -21
- data/vendor/local/share/groonga/doc/ja/html/_sources/install.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/html/_sources/news.txt +0 -199
- data/vendor/local/share/groonga/doc/ja/html/_sources/process.txt +0 -12
- data/vendor/local/share/groonga/doc/ja/html/_sources/pseudo_column.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/html/_sources/reference.txt +0 -14
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial01.txt +0 -293
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial02.txt +0 -100
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial03.txt +0 -72
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial04.txt +0 -111
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial05.txt +0 -65
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial06.txt +0 -91
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial07.txt +0 -92
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial08.txt +0 -53
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial09.txt +0 -9
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial10.txt +0 -486
- data/vendor/local/share/groonga/doc/ja/html/_sources/type.txt +0 -118
- data/vendor/local/share/groonga/doc/ja/html/_static/basic.css +0 -509
- data/vendor/local/share/groonga/doc/ja/html/_static/default.css +0 -277
- data/vendor/local/share/groonga/doc/ja/html/_static/doctools.js +0 -247
- data/vendor/local/share/groonga/doc/ja/html/_static/file.png +0 -0
- data/vendor/local/share/groonga/doc/ja/html/_static/jquery.js +0 -6240
- data/vendor/local/share/groonga/doc/ja/html/_static/minus.png +0 -0
- data/vendor/local/share/groonga/doc/ja/html/_static/plus.png +0 -0
- data/vendor/local/share/groonga/doc/ja/html/_static/pygments.css +0 -61
- data/vendor/local/share/groonga/doc/ja/html/_static/searchtools.js +0 -518
- data/vendor/local/share/groonga/doc/ja/html/_static/sidebar.js +0 -147
- data/vendor/local/share/groonga/doc/ja/html/_static/underscore.js +0 -16
- data/vendor/local/share/groonga/doc/ja/html/characteristic.html +0 -162
- data/vendor/local/share/groonga/doc/ja/html/commands.html +0 -139
- data/vendor/local/share/groonga/doc/ja/html/commands/cache_limit.html +0 -173
- data/vendor/local/share/groonga/doc/ja/html/commands/check.html +0 -285
- data/vendor/local/share/groonga/doc/ja/html/commands/clearlock.html +0 -180
- data/vendor/local/share/groonga/doc/ja/html/commands/column_create.html +0 -210
- data/vendor/local/share/groonga/doc/ja/html/commands/column_list.html +0 -220
- data/vendor/local/share/groonga/doc/ja/html/commands/column_remove.html +0 -183
- data/vendor/local/share/groonga/doc/ja/html/commands/define_selector.html +0 -221
- data/vendor/local/share/groonga/doc/ja/html/commands/defrag.html +0 -177
- data/vendor/local/share/groonga/doc/ja/html/commands/delete.html +0 -182
- data/vendor/local/share/groonga/doc/ja/html/commands/dump.html +0 -177
- data/vendor/local/share/groonga/doc/ja/html/commands/load.html +0 -208
- data/vendor/local/share/groonga/doc/ja/html/commands/log_level.html +0 -187
- data/vendor/local/share/groonga/doc/ja/html/commands/log_put.html +0 -190
- data/vendor/local/share/groonga/doc/ja/html/commands/log_reopen.html +0 -188
- data/vendor/local/share/groonga/doc/ja/html/commands/quit.html +0 -156
- data/vendor/local/share/groonga/doc/ja/html/commands/select.html +0 -331
- data/vendor/local/share/groonga/doc/ja/html/commands/shutdown.html +0 -156
- data/vendor/local/share/groonga/doc/ja/html/commands/status.html +0 -179
- data/vendor/local/share/groonga/doc/ja/html/commands/suggest.html +0 -191
- data/vendor/local/share/groonga/doc/ja/html/commands/table_create.html +0 -222
- data/vendor/local/share/groonga/doc/ja/html/commands/table_list.html +0 -202
- data/vendor/local/share/groonga/doc/ja/html/commands/table_remove.html +0 -173
- data/vendor/local/share/groonga/doc/ja/html/commands/view_add.html +0 -175
- data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/add.html +0 -180
- data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/get.html +0 -161
- data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/set.html +0 -182
- data/vendor/local/share/groonga/doc/ja/html/developer.html +0 -118
- data/vendor/local/share/groonga/doc/ja/html/developer/com.html +0 -136
- data/vendor/local/share/groonga/doc/ja/html/developer/document.html +0 -159
- data/vendor/local/share/groonga/doc/ja/html/developer/query.html +0 -336
- data/vendor/local/share/groonga/doc/ja/html/developer/test.html +0 -220
- data/vendor/local/share/groonga/doc/ja/html/execfile.html +0 -370
- data/vendor/local/share/groonga/doc/ja/html/expr.html +0 -157
- data/vendor/local/share/groonga/doc/ja/html/functions.html +0 -122
- data/vendor/local/share/groonga/doc/ja/html/functions/edit_distance.html +0 -162
- data/vendor/local/share/groonga/doc/ja/html/functions/geo_distance.html +0 -170
- data/vendor/local/share/groonga/doc/ja/html/functions/geo_in_circle.html +0 -173
- data/vendor/local/share/groonga/doc/ja/html/functions/geo_in_rectangle.html +0 -172
- data/vendor/local/share/groonga/doc/ja/html/functions/now.html +0 -152
- data/vendor/local/share/groonga/doc/ja/html/functions/rand.html +0 -159
- data/vendor/local/share/groonga/doc/ja/html/genindex.html +0 -227
- data/vendor/local/share/groonga/doc/ja/html/grnslap.html +0 -183
- data/vendor/local/share/groonga/doc/ja/html/grntest.html +0 -368
- data/vendor/local/share/groonga/doc/ja/html/http.html +0 -163
- data/vendor/local/share/groonga/doc/ja/html/index.html +0 -291
- data/vendor/local/share/groonga/doc/ja/html/install.html +0 -228
- data/vendor/local/share/groonga/doc/ja/html/news.html +0 -310
- data/vendor/local/share/groonga/doc/ja/html/objects.inv +0 -0
- data/vendor/local/share/groonga/doc/ja/html/process.html +0 -120
- data/vendor/local/share/groonga/doc/ja/html/pseudo_column.html +0 -147
- data/vendor/local/share/groonga/doc/ja/html/reference.html +0 -174
- data/vendor/local/share/groonga/doc/ja/html/search.html +0 -96
- data/vendor/local/share/groonga/doc/ja/html/searchindex.js +0 -1
- data/vendor/local/share/groonga/doc/ja/html/tutorial.html +0 -172
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial01.html +0 -388
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial02.html +0 -214
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial03.html +0 -183
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial04.html +0 -212
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial05.html +0 -169
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial06.html +0 -209
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial07.html +0 -212
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial08.html +0 -139
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial09.html +0 -114
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial10.html +0 -458
- data/vendor/local/share/groonga/doc/ja/html/type.html +0 -217
- data/vendor/local/share/groonga/doc/ja/source/__init__.py +0 -0
- data/vendor/local/share/groonga/doc/ja/source/characteristic.txt +0 -56
- data/vendor/local/share/groonga/doc/ja/source/commands.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/source/commands/cache_limit.txt +0 -52
- data/vendor/local/share/groonga/doc/ja/source/commands/check.txt +0 -164
- data/vendor/local/share/groonga/doc/ja/source/commands/clearlock.txt +0 -61
- data/vendor/local/share/groonga/doc/ja/source/commands/column_create.txt +0 -93
- data/vendor/local/share/groonga/doc/ja/source/commands/column_list.txt +0 -97
- data/vendor/local/share/groonga/doc/ja/source/commands/column_remove.txt +0 -58
- data/vendor/local/share/groonga/doc/ja/source/commands/define_selector.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/source/commands/defrag.txt +0 -57
- data/vendor/local/share/groonga/doc/ja/source/commands/delete.txt +0 -68
- data/vendor/local/share/groonga/doc/ja/source/commands/dump.txt +0 -62
- data/vendor/local/share/groonga/doc/ja/source/commands/load.txt +0 -98
- data/vendor/local/share/groonga/doc/ja/source/commands/log_level.txt +0 -65
- data/vendor/local/share/groonga/doc/ja/source/commands/log_put.txt +0 -69
- data/vendor/local/share/groonga/doc/ja/source/commands/log_reopen.txt +0 -66
- data/vendor/local/share/groonga/doc/ja/source/commands/quit.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/source/commands/select.txt +0 -247
- data/vendor/local/share/groonga/doc/ja/source/commands/shutdown.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/source/commands/status.txt +0 -59
- data/vendor/local/share/groonga/doc/ja/source/commands/table_create.txt +0 -111
- data/vendor/local/share/groonga/doc/ja/source/commands/table_list.txt +0 -87
- data/vendor/local/share/groonga/doc/ja/source/commands/table_remove.txt +0 -50
- data/vendor/local/share/groonga/doc/ja/source/commands/view_add.txt +0 -53
- data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/add.txt +0 -102
- data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/get.txt +0 -78
- data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/set.txt +0 -103
- data/vendor/local/share/groonga/doc/ja/source/conf.py +0 -265
- data/vendor/local/share/groonga/doc/ja/source/developer.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/source/developer/com.txt +0 -18
- data/vendor/local/share/groonga/doc/ja/source/developer/document.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/source/developer/query.txt +0 -212
- data/vendor/local/share/groonga/doc/ja/source/developer/test.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-1.log +0 -6
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-10.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-11.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-12.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-13.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-14.log +0 -9
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-15.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-16.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-17.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-2.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-3.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-4.log +0 -7
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-5.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-6.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-7.log +0 -16
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-8.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-9.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-1.log +0 -8
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-2.log +0 -6
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-3.log +0 -12
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-1.log +0 -18
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-2.log +0 -10
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-3.log +0 -10
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-1.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-2.log +0 -7
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-3.log +0 -7
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-4.log +0 -13
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-5.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-6.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-7.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-1.log +0 -24
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-2.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-3.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-4.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-5.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-6.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-1.log +0 -25
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-2.log +0 -9
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-3.log +0 -21
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-4.log +0 -7
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-5.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-1.log +0 -22
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-2.log +0 -9
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-3.log +0 -20
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-4.log +0 -9
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial08-1.log +0 -14
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-1.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-10.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-2.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-3.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-4.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-5.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-6.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-7.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-8.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-9.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/execfile.txt +0 -226
- data/vendor/local/share/groonga/doc/ja/source/expr.txt +0 -43
- data/vendor/local/share/groonga/doc/ja/source/functions.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/source/functions/edit_distance.txt +0 -48
- data/vendor/local/share/groonga/doc/ja/source/functions/geo_distance.txt +0 -51
- data/vendor/local/share/groonga/doc/ja/source/functions/geo_in_circle.txt +0 -54
- data/vendor/local/share/groonga/doc/ja/source/functions/geo_in_rectangle.txt +0 -55
- data/vendor/local/share/groonga/doc/ja/source/functions/now.txt +0 -34
- data/vendor/local/share/groonga/doc/ja/source/functions/rand.txt +0 -41
- data/vendor/local/share/groonga/doc/ja/source/grnslap.txt +0 -64
- data/vendor/local/share/groonga/doc/ja/source/grntest.txt +0 -259
- data/vendor/local/share/groonga/doc/ja/source/http.txt +0 -52
- data/vendor/local/share/groonga/doc/ja/source/index.txt +0 -21
- data/vendor/local/share/groonga/doc/ja/source/install.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/source/news.txt +0 -199
- data/vendor/local/share/groonga/doc/ja/source/process.txt +0 -12
- data/vendor/local/share/groonga/doc/ja/source/pseudo_column.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/source/rdoc.py +0 -762
- data/vendor/local/share/groonga/doc/ja/source/reference.txt +0 -14
- data/vendor/local/share/groonga/doc/ja/source/tutorial.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial01.txt +0 -293
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial02.txt +0 -100
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial03.txt +0 -72
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial04.txt +0 -111
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial05.txt +0 -65
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial06.txt +0 -91
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial07.txt +0 -92
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial08.txt +0 -53
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial09.txt +0 -9
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial10.txt +0 -486
- data/vendor/local/share/groonga/doc/ja/source/type.txt +0 -118
- data/vendor/local/share/groonga/doc/ja/source/update_execution_example.py +0 -113
- data/vendor/local/share/man/man1/groonga.1 +0 -5498
File without changes
|
data/example/bookmark.rb
CHANGED
@@ -27,7 +27,7 @@ path = ARGV[0]
|
|
27
27
|
if path.nil?
|
28
28
|
require 'tmpdir'
|
29
29
|
require 'fileutils'
|
30
|
-
temporary_directory = File.join(Dir.tmpdir, "
|
30
|
+
temporary_directory = File.join(Dir.tmpdir, "rroonga")
|
31
31
|
FileUtils.mkdir_p(temporary_directory)
|
32
32
|
at_exit {FileUtils.rm_rf(temporary_directory)}
|
33
33
|
path = File.join(temporary_directory, "db")
|
@@ -36,126 +36,129 @@ persistent = true
|
|
36
36
|
|
37
37
|
p Groonga::Database.create(:path => path)
|
38
38
|
|
39
|
-
p
|
40
|
-
|
41
|
-
|
39
|
+
p Groonga::Schema.create_table("Items", :type => :hash)
|
40
|
+
p(items = Groonga["Items"])
|
41
|
+
|
42
|
+
p items.size
|
42
43
|
|
43
44
|
p items.add("http://ja.wikipedia.org/wiki/Ruby")
|
44
|
-
p items.add("http://www.ruby-lang.org/")
|
45
|
+
p items.add("http://www.ruby-lang.org/ja/")
|
46
|
+
|
47
|
+
p items.size
|
48
|
+
|
49
|
+
p items["http://ja.wikipedia.org/wiki/Ruby"]
|
45
50
|
|
46
|
-
p
|
51
|
+
p(Groonga::Schema.change_table("Items") do |table|
|
52
|
+
table.text("title")
|
53
|
+
end)
|
54
|
+
p(title_column = Groonga["Items.title"])
|
47
55
|
|
48
|
-
p(
|
49
|
-
:
|
50
|
-
:
|
56
|
+
p(Groonga::Schema.create_table("Terms",
|
57
|
+
:type => :patricia_trie,
|
58
|
+
:key_normalize => true,
|
51
59
|
:default_tokenizer => "TokenBigram"))
|
52
|
-
p
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
p items.
|
60
|
-
p
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
p
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
p
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
p
|
89
|
-
:title => "[翻訳]JavaScript: 世界で最も誤解されたプログラミング言語")
|
90
|
-
|
91
|
-
p comments.add(:item => "http://d.hatena.ne.jp/brazil/20050829/1125321936",
|
60
|
+
p(Groonga::Schema.change_table("Terms") do |table|
|
61
|
+
table.index("Items.title")
|
62
|
+
end)
|
63
|
+
|
64
|
+
p(items["http://ja.wikipedia.org/wiki/Ruby"].title = "Ruby")
|
65
|
+
p(items["http://www.ruby-lang.org/ja/"].title = "オブジェクトスクリプト言語Ruby")
|
66
|
+
|
67
|
+
p(ruby_items = items.select {|record| record.title =~ "Ruby"})
|
68
|
+
p(ruby_items.collect {|record| record.key.key})
|
69
|
+
p(ruby_items.collect {|record| record["_key"]})
|
70
|
+
|
71
|
+
p(Groonga::Schema.create_table("Users", :type => :hash) do |table|
|
72
|
+
table.text("name")
|
73
|
+
end)
|
74
|
+
p(Groonga::Schema.create_table("Comments") do |table|
|
75
|
+
table.reference("item")
|
76
|
+
table.reference("author", "Users")
|
77
|
+
table.text("content")
|
78
|
+
table.time("issued")
|
79
|
+
end)
|
80
|
+
|
81
|
+
p(Groonga::Schema.change_table("Terms") do |table|
|
82
|
+
table.index("Comments.content")
|
83
|
+
end)
|
84
|
+
|
85
|
+
p(users = Groonga["Users"])
|
86
|
+
p(users.add("moritan", :name => "モリタン"))
|
87
|
+
p(users.add("taporobo", :name => "タポロボ"))
|
88
|
+
|
89
|
+
p(items.has_key?("http://www.rubyist.net/~matz/"))
|
90
|
+
p(items.add("http://www.rubyist.net/~matz/",
|
91
|
+
:title => "Matzにっき"))
|
92
|
+
|
93
|
+
require "time"
|
94
|
+
|
95
|
+
p(comments = Groonga["Comments"])
|
96
|
+
p(comments.add(:item => "http://www.rubyist.net/~matz/",
|
92
97
|
:author => "moritan",
|
93
|
-
:content => "
|
94
|
-
:issued =>
|
98
|
+
:content => "Ruby Matz",
|
99
|
+
:issued => Time.parse("2010-11-20T18:01:22+09:00")))
|
95
100
|
|
96
|
-
@items = items
|
97
|
-
@comments = comments
|
101
|
+
p(@items = items)
|
102
|
+
p(@comments = comments)
|
98
103
|
def add_bookmark(url, title, author, content, issued)
|
99
|
-
item = @items
|
104
|
+
item = @items[url] || @items.add(url, :title => title)
|
100
105
|
@comments.add(:item => item,
|
101
106
|
:author => author,
|
102
107
|
:content => content,
|
103
108
|
:issued => issued)
|
104
109
|
end
|
105
110
|
|
106
|
-
p
|
107
|
-
"
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
"
|
112
|
-
|
113
|
-
p
|
114
|
-
"
|
115
|
-
Time.
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
"ラングバ", "moritan", "Ruby groonga",
|
121
|
-
Time.parse("2009-07-19"))
|
122
|
-
|
123
|
-
|
124
|
-
records = comments.select do |record|
|
125
|
-
record["content"] =~ "LISP"
|
126
|
-
end
|
111
|
+
p(add_bookmark("http://jp.rubyist.net/magazine/",
|
112
|
+
"Rubyist Magazine - るびま", "moritan", "Ruby 記事",
|
113
|
+
Time.parse("2010-10-07T14:18:28+09:00")))
|
114
|
+
p(add_bookmark("http://groonga.rubyforge.org/",
|
115
|
+
"Rubyでgroonga使って全文検索 - ラングバ", "taporobo",
|
116
|
+
"Ruby groonga 全文検索",
|
117
|
+
Time.parse("2010-11-11T12:39:59+09:00")))
|
118
|
+
p(add_bookmark("http://www.rubyist.net/~matz/",
|
119
|
+
"Matz日記", "taporobo", "Ruby 日記",
|
120
|
+
Time.parse("2010-07-28T20:46:23+09:00")))
|
121
|
+
|
122
|
+
p(records = comments.select do |record|
|
123
|
+
record["content"] =~ "Ruby"
|
124
|
+
end)
|
127
125
|
|
128
126
|
records.each do |record|
|
129
127
|
record = record.key
|
130
128
|
p [record.id,
|
131
|
-
record
|
132
|
-
record
|
133
|
-
record
|
134
|
-
record
|
129
|
+
record.issued,
|
130
|
+
record.item.title,
|
131
|
+
record.author.name,
|
132
|
+
record.content]
|
135
133
|
end
|
136
134
|
|
137
135
|
p records
|
138
136
|
|
139
|
-
records.sort([{:key => "
|
137
|
+
records.sort([{:key => "issued", :order => "descending"}]).each do |record|
|
140
138
|
record = record.key
|
141
139
|
p [record.id,
|
142
|
-
record
|
143
|
-
record
|
144
|
-
record
|
145
|
-
record
|
140
|
+
record.issued,
|
141
|
+
record.item.title,
|
142
|
+
record.author.name,
|
143
|
+
record.content]
|
146
144
|
end
|
147
145
|
|
148
146
|
records.group("item").each do |record|
|
149
147
|
item = record.key
|
150
148
|
p [record.n_sub_records,
|
151
149
|
item.key,
|
152
|
-
item
|
150
|
+
item.title]
|
153
151
|
end
|
154
152
|
|
155
|
-
p
|
156
|
-
p
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
153
|
+
p(ruby_comments = @comments.select {|record| record.content =~ "Ruby"})
|
154
|
+
p(ruby_items = @items.select do |record|
|
155
|
+
target = record.match_target do |match_record|
|
156
|
+
match_record.title * 10
|
157
|
+
end
|
158
|
+
target =~ "Ruby"
|
159
|
+
end)
|
160
|
+
|
161
|
+
p(ruby_items = ruby_comments.group("item").union!(ruby_items))
|
162
|
+
ruby_items.sort([{:key => "_score", :order => "descending"}]).each do |record|
|
163
|
+
p [record.score, record.title]
|
161
164
|
end
|
data/example/index-html.rb
CHANGED
File without changes
|
data/ext/groonga/extconf.rb
CHANGED
@@ -15,14 +15,9 @@
|
|
15
15
|
# License along with this library; if not, write to the Free Software
|
16
16
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
17
17
|
|
18
|
-
require 'pathname'
|
19
|
-
|
20
|
-
base_dir = Pathname(__FILE__).dirname.parent.parent
|
21
|
-
$LOAD_PATH.unshift(base_dir.to_s)
|
22
|
-
|
23
18
|
require 'English'
|
19
|
+
require 'pathname'
|
24
20
|
require 'mkmf'
|
25
|
-
require 'rroonga-build'
|
26
21
|
|
27
22
|
begin
|
28
23
|
require 'pkg-config'
|
@@ -31,6 +26,11 @@ rescue LoadError
|
|
31
26
|
require 'pkg-config'
|
32
27
|
end
|
33
28
|
|
29
|
+
base_dir = Pathname(__FILE__).dirname.parent.parent
|
30
|
+
$LOAD_PATH.unshift(base_dir.to_s)
|
31
|
+
|
32
|
+
require 'rroonga-build'
|
33
|
+
|
34
34
|
include RroongaBuild
|
35
35
|
|
36
36
|
package_name = "groonga"
|
data/ext/groonga/rb-grn-array.c
CHANGED
@@ -139,7 +139,7 @@ rb_grn_array_s_create (int argc, VALUE *argv, VALUE klass)
|
|
139
139
|
flags, NULL, value_type);
|
140
140
|
if (!table)
|
141
141
|
rb_grn_context_check(context, rb_ary_new4(argc, argv));
|
142
|
-
rb_table = GRNOBJECT2RVAL(klass, context, table,
|
142
|
+
rb_table = GRNOBJECT2RVAL(klass, context, table, GRN_TRUE);
|
143
143
|
rb_grn_context_check(context, rb_table);
|
144
144
|
rb_iv_set(rb_table, "@context", rb_context);
|
145
145
|
|
data/ext/groonga/rb-grn-column.c
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/* -*- c-file-style: "ruby" -*- */
|
2
2
|
/* vim: set sts=4 sw=4 ts=8 noet: */
|
3
3
|
/*
|
4
|
-
Copyright (C) 2009-
|
4
|
+
Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
|
5
5
|
|
6
6
|
This library is free software; you can redistribute it and/or
|
7
7
|
modify it under the terms of the GNU Lesser General Public
|
@@ -60,7 +60,7 @@ rb_grn_column_from_ruby_object (VALUE object, grn_ctx **context)
|
|
60
60
|
|
61
61
|
VALUE
|
62
62
|
rb_grn_column_to_ruby_object (VALUE klass, grn_ctx *context, grn_obj *column,
|
63
|
-
|
63
|
+
grn_bool owner)
|
64
64
|
{
|
65
65
|
return GRNOBJECT2RVAL(klass, context, column, owner);
|
66
66
|
}
|
@@ -128,7 +128,7 @@ rb_grn_column_get_table (VALUE self)
|
|
128
128
|
table = grn_column_table(context, column);
|
129
129
|
rb_grn_context_check(context, self);
|
130
130
|
|
131
|
-
return GRNOBJECT2RVAL(Qnil, context, table,
|
131
|
+
return GRNOBJECT2RVAL(Qnil, context, table, GRN_FALSE);
|
132
132
|
}
|
133
133
|
|
134
134
|
/*
|
@@ -235,17 +235,17 @@ rb_grn_column_get_local_name (VALUE self)
|
|
235
235
|
*
|
236
236
|
* [+:operator+]
|
237
237
|
* マッチしたレコードをどのように扱うか。指定可能な値は以
|
238
|
-
* 下の通り。省略した場合はGroonga::
|
238
|
+
* 下の通り。省略した場合はGroonga::Operator::OR。
|
239
239
|
*
|
240
|
-
* [Groonga::
|
240
|
+
* [Groonga::Operator::OR]
|
241
241
|
* マッチしたレコードを追加。すでにレコードが追加され
|
242
242
|
* ている場合は何もしない。
|
243
|
-
* [Groonga::
|
243
|
+
* [Groonga::Operator::AND]
|
244
244
|
* マッチしたレコードのスコアを増加。マッチしなかった
|
245
245
|
* レコードを削除。
|
246
|
-
* [Groonga::
|
246
|
+
* [Groonga::Operator::BUT]
|
247
247
|
* マッチしたレコードを削除。
|
248
|
-
* [Groonga::
|
248
|
+
* [Groonga::Operator::ADJUST]
|
249
249
|
* マッチしたレコードのスコアを増加。
|
250
250
|
*
|
251
251
|
* [+:result+]
|
@@ -333,7 +333,7 @@ rb_grn_column_select (int argc, VALUE *argv, VALUE self)
|
|
333
333
|
GRN_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
|
334
334
|
table,
|
335
335
|
0);
|
336
|
-
rb_result = GRNTABLE2RVAL(context, result,
|
336
|
+
rb_result = GRNTABLE2RVAL(context, result, GRN_TRUE);
|
337
337
|
} else {
|
338
338
|
result = RVAL2GRNTABLE(rb_result, &context);
|
339
339
|
}
|
@@ -355,7 +355,7 @@ rb_grn_column_select (int argc, VALUE *argv, VALUE self)
|
|
355
355
|
|
356
356
|
rb_attr(rb_singleton_class(rb_result),
|
357
357
|
rb_intern("expression"),
|
358
|
-
|
358
|
+
GRN_TRUE, GRN_FALSE, GRN_FALSE);
|
359
359
|
rb_iv_set(rb_result, "@expression", rb_expression);
|
360
360
|
|
361
361
|
return rb_result;
|
@@ -552,6 +552,187 @@ rb_grn_column_is_locked (int argc, VALUE *argv, VALUE self)
|
|
552
552
|
return CBOOL2RVAL(grn_obj_is_locked(context, column));
|
553
553
|
}
|
554
554
|
|
555
|
+
/*
|
556
|
+
* Document-method: reference?
|
557
|
+
*
|
558
|
+
* call-seq:
|
559
|
+
* column.reference? -> true/false
|
560
|
+
*
|
561
|
+
* _column_の値がテーブルのレコードとなる場合は+true+を返し、
|
562
|
+
* そうでない場合は+false+を返す。
|
563
|
+
*
|
564
|
+
* @since: 1.0.5
|
565
|
+
*/
|
566
|
+
static VALUE
|
567
|
+
rb_grn_column_reference_p (VALUE self)
|
568
|
+
{
|
569
|
+
grn_ctx *context;
|
570
|
+
grn_obj *column;
|
571
|
+
grn_id range_id;
|
572
|
+
grn_obj *range;
|
573
|
+
unsigned short int type;
|
574
|
+
|
575
|
+
rb_grn_column_deconstruct(SELF(self), &column, &context,
|
576
|
+
NULL, NULL,
|
577
|
+
NULL, NULL, NULL);
|
578
|
+
|
579
|
+
range_id = grn_obj_get_range(context, column);
|
580
|
+
range = grn_ctx_at(context, range_id);
|
581
|
+
type = range->header.type;
|
582
|
+
grn_obj_unlink(context, range);
|
583
|
+
switch (type) {
|
584
|
+
case GRN_TABLE_HASH_KEY:
|
585
|
+
case GRN_TABLE_PAT_KEY:
|
586
|
+
case GRN_TABLE_NO_KEY:
|
587
|
+
return Qtrue;
|
588
|
+
default:
|
589
|
+
return Qfalse;
|
590
|
+
}
|
591
|
+
}
|
592
|
+
|
593
|
+
/*
|
594
|
+
* Document-method: index?
|
595
|
+
*
|
596
|
+
* call-seq:
|
597
|
+
* column.index? -> true/false
|
598
|
+
*
|
599
|
+
* _column_がGroonga::IndexColumnの場合は+true+を返し、
|
600
|
+
* そうでない場合は+false+を返す。
|
601
|
+
*
|
602
|
+
* @since: 1.0.5
|
603
|
+
*/
|
604
|
+
static VALUE
|
605
|
+
rb_grn_column_index_p (VALUE self)
|
606
|
+
{
|
607
|
+
grn_ctx *context;
|
608
|
+
grn_obj *column;
|
609
|
+
|
610
|
+
rb_grn_column_deconstruct(SELF(self), &column, &context,
|
611
|
+
NULL, NULL,
|
612
|
+
NULL, NULL, NULL);
|
613
|
+
|
614
|
+
if (column->header.type == GRN_COLUMN_INDEX) {
|
615
|
+
return Qtrue;
|
616
|
+
} else {
|
617
|
+
return Qfalse;
|
618
|
+
}
|
619
|
+
}
|
620
|
+
|
621
|
+
/*
|
622
|
+
* Document-method: vector?
|
623
|
+
*
|
624
|
+
* call-seq:
|
625
|
+
* column.vector? -> true/false
|
626
|
+
*
|
627
|
+
* _column_がベクターカラムの場合は+true+を返し、
|
628
|
+
* そうでない場合は+false+を返す。
|
629
|
+
*
|
630
|
+
* @since: 1.0.5
|
631
|
+
*/
|
632
|
+
static VALUE
|
633
|
+
rb_grn_column_vector_p (VALUE self)
|
634
|
+
{
|
635
|
+
grn_ctx *context;
|
636
|
+
grn_obj *column;
|
637
|
+
|
638
|
+
rb_grn_column_deconstruct(SELF(self), &column, &context,
|
639
|
+
NULL, NULL,
|
640
|
+
NULL, NULL, NULL);
|
641
|
+
|
642
|
+
if (column->header.type == GRN_COLUMN_VAR_SIZE &&
|
643
|
+
((column->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) ==
|
644
|
+
GRN_OBJ_COLUMN_VECTOR)) {
|
645
|
+
return Qtrue;
|
646
|
+
} else {
|
647
|
+
return Qfalse;
|
648
|
+
}
|
649
|
+
}
|
650
|
+
|
651
|
+
/*
|
652
|
+
* Document-method: scalar?
|
653
|
+
*
|
654
|
+
* call-seq:
|
655
|
+
* column.scalar? -> true/false
|
656
|
+
*
|
657
|
+
* _column_がスカラーカラムの場合は+true+を返し、
|
658
|
+
* そうでない場合は+false+を返す。
|
659
|
+
*
|
660
|
+
* @since: 1.0.5
|
661
|
+
*/
|
662
|
+
static VALUE
|
663
|
+
rb_grn_column_scalar_p (VALUE self)
|
664
|
+
{
|
665
|
+
grn_ctx *context;
|
666
|
+
grn_obj *column;
|
667
|
+
|
668
|
+
rb_grn_column_deconstruct(SELF(self), &column, &context,
|
669
|
+
NULL, NULL,
|
670
|
+
NULL, NULL, NULL);
|
671
|
+
|
672
|
+
switch (column->header.type) {
|
673
|
+
case GRN_COLUMN_FIX_SIZE:
|
674
|
+
return Qtrue;
|
675
|
+
case GRN_COLUMN_VAR_SIZE:
|
676
|
+
if ((column->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) ==
|
677
|
+
GRN_OBJ_COLUMN_SCALAR) {
|
678
|
+
return Qtrue;
|
679
|
+
} else {
|
680
|
+
return Qfalse;
|
681
|
+
}
|
682
|
+
default:
|
683
|
+
return Qfalse;
|
684
|
+
}
|
685
|
+
}
|
686
|
+
|
687
|
+
/*
|
688
|
+
* Document-method: indexes
|
689
|
+
*
|
690
|
+
* call-seq:
|
691
|
+
* column.indexes(operator=Groonga::Operator::MATCH) -> [index_column, ...]
|
692
|
+
*
|
693
|
+
* _operation_を実行できる_column_のインデックスを返す。
|
694
|
+
*
|
695
|
+
* @since: 1.0.9
|
696
|
+
*/
|
697
|
+
static VALUE
|
698
|
+
rb_grn_column_get_indexes (int argc, VALUE *argv, VALUE self)
|
699
|
+
{
|
700
|
+
grn_ctx *context;
|
701
|
+
grn_obj *column;
|
702
|
+
grn_obj **indexes = NULL;
|
703
|
+
int i, n_indexes;
|
704
|
+
grn_operator operator = GRN_OP_MATCH;
|
705
|
+
VALUE rb_operator, rb_indexes;
|
706
|
+
|
707
|
+
rb_scan_args(argc, argv, "01", &rb_operator);
|
708
|
+
|
709
|
+
rb_grn_column_deconstruct(SELF(self), &column, &context,
|
710
|
+
NULL, NULL,
|
711
|
+
NULL, NULL, NULL);
|
712
|
+
|
713
|
+
if (!NIL_P(rb_operator)) {
|
714
|
+
operator = RVAL2GRNOPERATOR(rb_operator);
|
715
|
+
}
|
716
|
+
|
717
|
+
rb_indexes = rb_ary_new();
|
718
|
+
n_indexes = grn_column_index(context, column, operator,
|
719
|
+
NULL, 0, NULL);
|
720
|
+
if (n_indexes == 0)
|
721
|
+
return rb_indexes;
|
722
|
+
|
723
|
+
indexes = xmalloc(sizeof(grn_obj *) * n_indexes);
|
724
|
+
n_indexes = grn_column_index(context, column, operator,
|
725
|
+
indexes, n_indexes, NULL);
|
726
|
+
for (i = 0; i < n_indexes; i++) {
|
727
|
+
VALUE rb_index;
|
728
|
+
rb_index = GRNOBJECT2RVAL(Qnil, context, indexes[i], GRN_FALSE);
|
729
|
+
rb_ary_push(rb_indexes, rb_index);
|
730
|
+
grn_obj_unlink(context, indexes[i]);
|
731
|
+
}
|
732
|
+
xfree(indexes);
|
733
|
+
return rb_indexes;
|
734
|
+
}
|
735
|
+
|
555
736
|
void
|
556
737
|
rb_grn_init_column (VALUE mGrn)
|
557
738
|
{
|
@@ -566,6 +747,16 @@ rb_grn_init_column (VALUE mGrn)
|
|
566
747
|
rb_define_method(rb_cGrnColumn, "unlock", rb_grn_column_unlock, -1);
|
567
748
|
rb_define_method(rb_cGrnColumn, "clear_lock", rb_grn_column_clear_lock, -1);
|
568
749
|
rb_define_method(rb_cGrnColumn, "locked?", rb_grn_column_is_locked, -1);
|
750
|
+
rb_define_method(rb_cGrnColumn, "reference?", rb_grn_column_reference_p, 0);
|
751
|
+
/* deprecated: backward compatibility */
|
752
|
+
rb_define_alias(rb_cGrnColumn, "reference_column?", "reference?");
|
753
|
+
rb_define_method(rb_cGrnColumn, "index?", rb_grn_column_index_p, 0);
|
754
|
+
/* deprecated: backward compatibility */
|
755
|
+
rb_define_alias(rb_cGrnColumn, "index_column?", "index?");
|
756
|
+
rb_define_method(rb_cGrnColumn, "vector?", rb_grn_column_vector_p, 0);
|
757
|
+
rb_define_method(rb_cGrnColumn, "scalar?", rb_grn_column_scalar_p, 0);
|
758
|
+
|
759
|
+
rb_define_method(rb_cGrnColumn, "indexes", rb_grn_column_get_indexes, -1);
|
569
760
|
|
570
761
|
rb_grn_init_fix_size_column(mGrn);
|
571
762
|
rb_grn_init_variable_size_column(mGrn);
|