rroonga 4.0.4-x86-mingw32 → 4.0.5-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +73 -0
- data/Rakefile +13 -0
- data/doc/text/news.textile +26 -2
- data/ext/groonga/extconf.rb +3 -1
- data/ext/groonga/rb-grn-context.c +1 -1
- data/ext/groonga/rb-grn-double-array-trie.c +160 -4
- data/ext/groonga/rb-grn-object.c +10 -1
- data/ext/groonga/rb-grn-posting.c +4 -4
- data/ext/groonga/rb-grn-table-key-support.c +9 -4
- data/ext/groonga/rb-grn-table.c +1 -1
- data/ext/groonga/rb-grn-utils.c +2 -6
- data/ext/groonga/rb-grn-variable-size-column.c +2 -2
- data/ext/groonga/rb-grn.h +27 -2
- data/lib/1.9/groonga.so +0 -0
- data/lib/2.0/groonga.so +0 -0
- data/lib/2.1/groonga.so +0 -0
- data/lib/groonga/record.rb +19 -2
- data/lib/groonga/schema.rb +2 -2
- data/rroonga-build.rb +1 -1
- data/rroonga.gemspec +5 -5
- data/test/test-column.rb +6 -6
- data/test/test-database.rb +6 -2
- data/test/test-double-array-trie.rb +18 -0
- data/test/test-expression-builder.rb +3 -2
- data/test/test-hash.rb +13 -1
- data/test/test-plugin.rb +3 -1
- data/test/test-record.rb +10 -0
- data/test/test-variable-size-column.rb +4 -4
- data/vendor/local/bin/groonga-benchmark.exe +0 -0
- data/vendor/local/bin/groonga.exe +0 -0
- data/vendor/local/bin/libgroonga-0.dll +0 -0
- data/vendor/local/bin/libmecab-1.dll +0 -0
- data/vendor/local/bin/libmsgpack-3.dll +0 -0
- data/vendor/local/bin/libmsgpackc-2.dll +0 -0
- data/vendor/local/bin/libonig-5.dll +0 -0
- data/vendor/local/bin/libwinpthread-1.dll +0 -0
- data/vendor/local/bin/mecab.exe +0 -0
- data/vendor/local/bin/onig-config +78 -0
- data/vendor/local/include/oniggnu.h +85 -0
- data/vendor/local/include/onigposix.h +169 -0
- data/vendor/local/include/oniguruma.h +870 -0
- data/vendor/local/lib/groonga/plugins/query_expanders/tsv.a +0 -0
- data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll +0 -0
- data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/eval.a +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/eval.dll +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/eval.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/eval.la +41 -0
- data/vendor/local/lib/groonga/plugins/ruby/load.a +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/load.dll +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/load.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/ruby/load.la +41 -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/plugins/table/table.a +0 -0
- data/vendor/local/lib/groonga/plugins/table/table.dll +0 -0
- data/vendor/local/lib/groonga/plugins/table/table.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/tokenizers/mecab.a +0 -0
- data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll +0 -0
- data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll.a +0 -0
- data/vendor/local/lib/groonga/scripts/ruby/backtrace_entry.rb +20 -0
- data/vendor/local/lib/groonga/scripts/ruby/context.rb +31 -0
- data/vendor/local/lib/groonga/scripts/ruby/context/error_level.rb +30 -0
- data/vendor/local/lib/groonga/scripts/ruby/context/rc.rb +99 -0
- data/vendor/local/lib/groonga/scripts/ruby/eval_context.rb +13 -0
- data/vendor/local/lib/groonga/scripts/ruby/expression.rb +13 -0
- data/vendor/local/lib/groonga/scripts/ruby/index_info.rb +10 -0
- data/vendor/local/lib/groonga/scripts/ruby/logger.rb +27 -0
- data/vendor/local/lib/groonga/scripts/ruby/logger/level.rb +32 -0
- data/vendor/local/lib/groonga/scripts/ruby/scan_info.rb +30 -0
- data/vendor/local/lib/groonga/scripts/ruby/scan_info_builder.rb +342 -0
- data/vendor/local/lib/groonga/scripts/ruby/scan_info_data.rb +198 -0
- data/vendor/local/lib/libgroonga.a +0 -0
- data/vendor/local/lib/libgroonga.dll.a +0 -0
- data/vendor/local/lib/libmecab.a +0 -0
- data/vendor/local/lib/libmecab.dll.a +0 -0
- data/vendor/local/lib/libmsgpack.a +0 -0
- data/vendor/local/lib/libmsgpack.dll.a +0 -0
- data/vendor/local/lib/libmsgpackc.a +0 -0
- data/vendor/local/lib/libmsgpackc.dll.a +0 -0
- data/vendor/local/lib/libonig.a +0 -0
- data/vendor/local/lib/libonig.dll.a +0 -0
- data/vendor/local/lib/libonig.la +41 -0
- data/vendor/local/lib/pkgconfig/groonga.pc +2 -2
- data/vendor/local/lib/pkgconfig/oniguruma.pc +14 -0
- data/vendor/local/libexec/mecab/mecab-cost-train.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-dict-gen.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-dict-index.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-system-eval.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-test-gen.exe +0 -0
- data/vendor/local/share/doc/groonga/en/html/.buildinfo +1 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/contribution/report.txt +4 -5
- data/vendor/local/share/doc/groonga/en/html/_sources/install/centos.txt +46 -10
- data/vendor/local/share/doc/groonga/en/html/_sources/install/debian.txt +3 -87
- data/vendor/local/share/doc/groonga/en/html/_sources/install/fedora.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/mac_os_x.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/others.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/solaris.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/ubuntu.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/windows.txt +9 -9
- data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +68 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/executables.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/drilldown.txt +1 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/lexicon.txt +5 -4
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/micro_blog.txt +265 -232
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/query_expansion.txt +30 -23
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/search.txt +2 -2
- data/vendor/local/share/doc/groonga/en/html/characteristic.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/community.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/cooperation.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/release.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/repository.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/report.html +8 -9
- data/vendor/local/share/doc/groonga/en/html/development.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/development/travis-ci.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/genindex.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/geolocation_search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/index.html +17 -18
- data/vendor/local/share/doc/groonga/en/html/install.html +8 -9
- data/vendor/local/share/doc/groonga/en/html/install/centos.html +63 -10
- data/vendor/local/share/doc/groonga/en/html/install/debian.html +10 -108
- data/vendor/local/share/doc/groonga/en/html/install/fedora.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/mac_os_x.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/others.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/solaris.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/ubuntu.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/windows.html +14 -14
- data/vendor/local/share/doc/groonga/en/html/limitations.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news.html +123 -48
- data/vendor/local/share/doc/groonga/en/html/news/0.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/1.2.x.html +6 -6
- data/vendor/local/share/doc/groonga/en/html/news/1.3.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/2.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/3.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/senna.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/en/html/reference.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/reference/api.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/global_configurations.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_cache.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_column.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_command_version.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ctx.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_db.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_encoding.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_geo.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_hook.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ii.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_index_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_info.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_match_escalation.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_obj.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_proc.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_type.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_user_data.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/plugin.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/cast.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/column.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/columns/pseudo.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/columns/vector.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command/command_version.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command/output_format.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command/return_code.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/cache_limit.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/check.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/clearlock.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_create.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_list.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_remove.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_rename.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/define_selector.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/defrag.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/delete.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/dump.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/load.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_level.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_put.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_reopen.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/normalize.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/normalizer_list.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/quit.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/register.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_eval.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_load.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/select.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/shutdown.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/status.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/suggest.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_create.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_list.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_remove.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenize.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenizer_list.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/truncate.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/reference/executables/grnslap.html +12 -12
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-benchmark.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-httpd.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-server-http.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-create-dataset.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-httpd.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-learner.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/reference/function.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/between.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/edit_distance.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_distance.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_circle.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_rectangle.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/highlight_full.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/highlight_html.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/html_untag.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/now.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/query.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/rand.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/snippet_html.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/sub_filter.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/query_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/script_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/indexing.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/log.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/normalizers.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/output.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/query_expanders.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/query_expanders/tsv.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/tables.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/tokenizers.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/tuning.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/types.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
- data/vendor/local/share/doc/groonga/en/html/server.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http/comparison.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http/groonga-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/package.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/spec.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/spec/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/spec/search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/suggest.html +9 -9
- data/vendor/local/share/doc/groonga/en/html/suggest/completion.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/suggest/correction.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/suggest/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/suggest/suggestion.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/suggest/tutorial.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/troubleshooting/mmap_cannot_allocate_memory.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial.html +13 -13
- data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +6 -6
- data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +14 -13
- data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +264 -250
- data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +9 -9
- data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +46 -41
- data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/contribution/report.txt +4 -5
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/centos.txt +46 -10
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/debian.txt +3 -87
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/fedora.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/mac_os_x.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/others.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/solaris.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/ubuntu.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/windows.txt +9 -9
- data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +68 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/executables.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/drilldown.txt +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/lexicon.txt +5 -4
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/micro_blog.txt +265 -232
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/query_expansion.txt +30 -23
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/search.txt +2 -2
- data/vendor/local/share/doc/groonga/ja/html/characteristic.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/community.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/cooperation.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/release.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/repository.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +7 -6
- data/vendor/local/share/doc/groonga/ja/html/development.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/development/travis-ci.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/genindex.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/geolocation_search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/index.html +14 -15
- data/vendor/local/share/doc/groonga/ja/html/install.html +8 -9
- data/vendor/local/share/doc/groonga/ja/html/install/centos.html +57 -10
- data/vendor/local/share/doc/groonga/ja/html/install/debian.html +10 -102
- data/vendor/local/share/doc/groonga/ja/html/install/fedora.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/mac_os_x.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/others.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/solaris.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/ubuntu.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/windows.html +14 -14
- data/vendor/local/share/doc/groonga/ja/html/limitations.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news.html +130 -48
- data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/1.2.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/1.3.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/2.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/3.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/senna.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/ja/html/reference.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/global_configurations.html +9 -9
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_cache.html +17 -33
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_column.html +23 -26
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_command_version.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ctx.html +10 -10
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_db.html +6 -6
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_encoding.html +10 -10
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_expr.html +22 -37
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_geo.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_hook.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ii.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_index_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_info.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_match_escalation.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_obj.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_proc.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_type.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_user_data.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/plugin.html +6 -6
- data/vendor/local/share/doc/groonga/ja/html/reference/cast.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/column.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/columns/pseudo.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/columns/vector.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/command.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/command/command_version.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/command/output_format.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/command/return_code.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/cache_limit.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/check.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/clearlock.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_create.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_list.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_remove.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_rename.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/define_selector.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/defrag.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/delete.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/dump.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/load.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_level.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_put.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_reopen.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/normalize.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/normalizer_list.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/quit.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/register.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_eval.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_load.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/select.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/shutdown.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/status.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/suggest.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_create.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_list.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_remove.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/tokenize.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/tokenizer_list.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/truncate.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/grnslap.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-benchmark.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-server-http.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-create-dataset.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-learner.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/function.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/between.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/edit_distance.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_distance.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_circle.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_rectangle.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/highlight_full.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/highlight_html.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/html_untag.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/now.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/query.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/rand.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/snippet_html.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/sub_filter.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/query_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/script_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/indexing.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/log.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/normalizers.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/output.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders/tsv.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/tables.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/tuning.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/types.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
- data/vendor/local/share/doc/groonga/ja/html/server.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http/comparison.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http/groonga-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/package.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/spec.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/spec/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/spec/search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest/completion.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest/correction.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest/suggestion.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest/tutorial.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting/mmap_cannot_allocate_memory.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial.html +11 -11
- data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +6 -6
- data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +9 -9
- data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +249 -237
- data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +9 -9
- data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +36 -36
- data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +7 -7
- data/vendor/local/share/license/mruby/AUTHORS +22 -0
- data/vendor/local/share/license/mruby/LEGAL +6 -0
- data/vendor/local/share/license/mruby/MITL +20 -0
- data/vendor/local/share/license/mruby/README.md +111 -0
- data/vendor/local/share/license/onigmo/AUTHORS +2 -0
- data/vendor/local/share/license/onigmo/COPYING +87 -0
- data/vendor/local/share/license/onigmo/README +249 -0
- data/vendor/local/share/man/ja/man1/groonga.1 +471 -485
- data/vendor/local/share/man/man1/groonga.1 +389 -454
- metadata +82 -46
- data/README.textile +0 -73
@@ -0,0 +1,342 @@
|
|
1
|
+
module Groonga
|
2
|
+
# TODO: Move me
|
3
|
+
class ExpressionCode
|
4
|
+
module Flags
|
5
|
+
RELATIONAL_EXPRESSION = 0x01
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class ScanInfoBuilder
|
10
|
+
module Status
|
11
|
+
START = 0
|
12
|
+
VAR = 1
|
13
|
+
COL1 = 2
|
14
|
+
COL2 = 3
|
15
|
+
CONST = 4
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(expression, operator, size)
|
19
|
+
@data_list = []
|
20
|
+
@expression = expression
|
21
|
+
@operator = operator
|
22
|
+
@size = size
|
23
|
+
end
|
24
|
+
|
25
|
+
RELATION_OPERATORS = [
|
26
|
+
Operator::MATCH,
|
27
|
+
Operator::NEAR,
|
28
|
+
Operator::NEAR2,
|
29
|
+
Operator::SIMILAR,
|
30
|
+
Operator::PREFIX,
|
31
|
+
Operator::SUFFIX,
|
32
|
+
Operator::EQUAL,
|
33
|
+
Operator::NOT_EQUAL,
|
34
|
+
Operator::LESS,
|
35
|
+
Operator::GREATER,
|
36
|
+
Operator::LESS_EQUAL,
|
37
|
+
Operator::GREATER_EQUAL,
|
38
|
+
Operator::GEO_WITHINP5,
|
39
|
+
Operator::GEO_WITHINP6,
|
40
|
+
Operator::GEO_WITHINP8,
|
41
|
+
Operator::TERM_EXTRACT,
|
42
|
+
]
|
43
|
+
|
44
|
+
LOGICAL_OPERATORS = [
|
45
|
+
Operator::AND,
|
46
|
+
Operator::OR,
|
47
|
+
Operator::AND_NOT,
|
48
|
+
Operator::ADJUST,
|
49
|
+
]
|
50
|
+
def build
|
51
|
+
return nil unless valid?
|
52
|
+
|
53
|
+
status = Status::START
|
54
|
+
variable = @expression.get_var_by_offset(0)
|
55
|
+
data = nil
|
56
|
+
codes = @expression.codes
|
57
|
+
n_codes = codes.size
|
58
|
+
codes.each_with_index do |code, i|
|
59
|
+
case code.op
|
60
|
+
when *RELATION_OPERATORS
|
61
|
+
status = Status::START
|
62
|
+
data.op = code.op
|
63
|
+
data.end = i
|
64
|
+
data.match_resolve_index
|
65
|
+
@data_list << data
|
66
|
+
data = nil
|
67
|
+
when *LOGICAL_OPERATORS
|
68
|
+
put_logical_op(code.op, i)
|
69
|
+
# TODO: rescue and return nil
|
70
|
+
status = Status::START
|
71
|
+
when Operator::PUSH
|
72
|
+
data ||= ScanInfoData.new(i)
|
73
|
+
if code.value == variable
|
74
|
+
status = Status::VAR
|
75
|
+
else
|
76
|
+
data.args << code.value
|
77
|
+
if status == Status::START
|
78
|
+
data.flags |= ScanInfo::Flags::PRE_CONST
|
79
|
+
end
|
80
|
+
status = Status::CONST
|
81
|
+
end
|
82
|
+
when Operator::GET_VALUE
|
83
|
+
case status
|
84
|
+
when Status::START
|
85
|
+
data ||= ScanInfoData.new(i)
|
86
|
+
status = Status::COL1
|
87
|
+
data.args << code.value
|
88
|
+
when Status::CONST, Status::VAR
|
89
|
+
status = Status::COL1
|
90
|
+
data.args << code.value
|
91
|
+
when Status::COL1
|
92
|
+
raise "invalid expression: can't use column as a value: <#{code.value.name}>: <#{@expression.grn_inspect}>"
|
93
|
+
status = Status::COL2
|
94
|
+
when Status::COL2
|
95
|
+
# Do nothing
|
96
|
+
end
|
97
|
+
when Operator::CALL
|
98
|
+
data ||= ScanInfoData.new(i)
|
99
|
+
if (code.flags & ExpressionCode::Flags::RELATIONAL_EXPRESSION) != 0 or
|
100
|
+
(i + 1) == n_codes
|
101
|
+
status = Status::START
|
102
|
+
data.op = code.op
|
103
|
+
data.end = i
|
104
|
+
data.call_relational_resolve_indexes
|
105
|
+
@data_list << data
|
106
|
+
data = nil
|
107
|
+
else
|
108
|
+
status = Status::COL2
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
if @operator == Operator::OR and @size == 0
|
114
|
+
first_data = @data_list.first
|
115
|
+
if (first_data.flags & ScanInfo::Flags::PUSH) == 0 or
|
116
|
+
first_data.logical_op != @operator
|
117
|
+
raise "invalid expr"
|
118
|
+
else
|
119
|
+
first_data.flags &= ~ScanInfo::Flags::PUSH
|
120
|
+
first_data.logical_op = @operator
|
121
|
+
end
|
122
|
+
else
|
123
|
+
put_logical_op(@operator, n_codes)
|
124
|
+
end
|
125
|
+
|
126
|
+
optimize
|
127
|
+
end
|
128
|
+
|
129
|
+
private
|
130
|
+
def valid?
|
131
|
+
n_relation_expressions = 0
|
132
|
+
n_logical_expressions = 0
|
133
|
+
status = Status::START
|
134
|
+
variable = @expression.get_var_by_offset(0)
|
135
|
+
codes = @expression.codes
|
136
|
+
codes.each do |code|
|
137
|
+
case code.op
|
138
|
+
when *RELATION_OPERATORS
|
139
|
+
return false if status < Status::COL1
|
140
|
+
return false if status > Status::CONST
|
141
|
+
status = Status::START
|
142
|
+
n_relation_expressions += 1
|
143
|
+
when *LOGICAL_OPERATORS
|
144
|
+
return false if status != Status::START
|
145
|
+
n_logical_expressions += 1
|
146
|
+
return false if n_logical_expressions >= n_relation_expressions
|
147
|
+
when Operator::PUSH
|
148
|
+
if code.value == variable
|
149
|
+
status = Status::VAR
|
150
|
+
else
|
151
|
+
status = Status::CONST
|
152
|
+
end
|
153
|
+
when Operator::GET_VALUE
|
154
|
+
case status
|
155
|
+
when Status::START, Status::CONST, Status::VAR
|
156
|
+
status = Status::COL1
|
157
|
+
when Status::COL1
|
158
|
+
status = Status::COL2
|
159
|
+
when Status::COL2
|
160
|
+
# Do nothing
|
161
|
+
else
|
162
|
+
return false
|
163
|
+
end
|
164
|
+
when Operator::CALL
|
165
|
+
if (code.flags & ExpressionCode::Flags::RELATIONAL_EXPRESSION) != 0 or
|
166
|
+
code == codes.last
|
167
|
+
status = Status::START
|
168
|
+
n_relation_expressions += 1
|
169
|
+
else
|
170
|
+
status = Status::COL2
|
171
|
+
end
|
172
|
+
else
|
173
|
+
return false
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
return false if status != Status::START
|
178
|
+
return false if n_relation_expressions != (n_logical_expressions + 1)
|
179
|
+
|
180
|
+
true
|
181
|
+
end
|
182
|
+
|
183
|
+
def put_logical_op(operator, start)
|
184
|
+
n_parens = 1
|
185
|
+
n_dif_ops = 0
|
186
|
+
r = 0
|
187
|
+
j = @data_list.size
|
188
|
+
while j > 0
|
189
|
+
j -= 1
|
190
|
+
data = @data_list[j]
|
191
|
+
if (data.flags & ScanInfo::Flags::POP) != 0
|
192
|
+
n_dif_ops += 1
|
193
|
+
n_parens += 1
|
194
|
+
else
|
195
|
+
if (data.flags & ScanInfo::Flags::PUSH) != 0
|
196
|
+
n_parens -= 1
|
197
|
+
if n_parens == 0
|
198
|
+
if r == 0
|
199
|
+
if n_dif_ops > 0
|
200
|
+
if j > 0 and operator != Operator::AND_NOT
|
201
|
+
n_parens = 1
|
202
|
+
n_dif_ops = 0
|
203
|
+
r = j
|
204
|
+
else
|
205
|
+
new_data = ScanInfoData.new(start)
|
206
|
+
new_data.flags = ScanInfo::Flags::POP
|
207
|
+
new_data.logical_op = operator
|
208
|
+
@data_list << new_data
|
209
|
+
end
|
210
|
+
else
|
211
|
+
data.flags &= ~ScanInfo::Flags::PUSH
|
212
|
+
data.logical_op = operator
|
213
|
+
end
|
214
|
+
else
|
215
|
+
if n_dif_ops > 0
|
216
|
+
new_data = ScanInfoData.new(start)
|
217
|
+
new_data.flags = ScanInfo::Flags::POP
|
218
|
+
new_data.logical_op = operator
|
219
|
+
@data_list << new_data
|
220
|
+
else
|
221
|
+
data.flags &= ~ScanInfo::Flags::PUSH
|
222
|
+
data.logical_op = operator
|
223
|
+
@data_list =
|
224
|
+
@data_list[0...j] +
|
225
|
+
@data_list[r..-1] +
|
226
|
+
@data_list[j...r]
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
else
|
231
|
+
if operator == Operator::AND_NOT or operator != data.logical_op
|
232
|
+
n_dif_ops += 1
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
if j < 0
|
238
|
+
raise GRN_INVALID_ARGUMENT.new("unmatched nesting level")
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
def optimize
|
244
|
+
optimized_data_list = []
|
245
|
+
i = 0
|
246
|
+
n = @data_list.size
|
247
|
+
while i < n
|
248
|
+
data = @data_list[i]
|
249
|
+
next_data = @data_list[i + 1]
|
250
|
+
i += 1
|
251
|
+
if next_data.nil?
|
252
|
+
optimized_data_list << data
|
253
|
+
next
|
254
|
+
end
|
255
|
+
if range_operations?(data, next_data)
|
256
|
+
between_data = create_between_data(data, next_data)
|
257
|
+
optimized_data_list << between_data
|
258
|
+
i += 1
|
259
|
+
next
|
260
|
+
end
|
261
|
+
optimized_data_list << data
|
262
|
+
end
|
263
|
+
optimized_data_list
|
264
|
+
end
|
265
|
+
|
266
|
+
def range_operations?(data, next_data)
|
267
|
+
return false unless next_data.logical_op == Operator::AND
|
268
|
+
|
269
|
+
op, next_op = data.op, next_data.op
|
270
|
+
return false if !(lower_condition?(op) or lower_condition?(next_op))
|
271
|
+
return false if !(upper_condition?(op) or upper_condition?(next_op))
|
272
|
+
|
273
|
+
data.args[0] == next_data.args[0] and data.indexes == next_data.indexes
|
274
|
+
end
|
275
|
+
|
276
|
+
def lower_condition?(operator)
|
277
|
+
case operator
|
278
|
+
when Operator::GREATER, Operator::GREATER_EQUAL
|
279
|
+
true
|
280
|
+
else
|
281
|
+
false
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
285
|
+
def upper_condition?(operator)
|
286
|
+
case operator
|
287
|
+
when Operator::LESS, Operator::LESS_EQUAL
|
288
|
+
true
|
289
|
+
else
|
290
|
+
false
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
294
|
+
def create_between_data(data, next_data)
|
295
|
+
between_data = ScanInfoData.new(data.start)
|
296
|
+
between_data.end = next_data.end
|
297
|
+
between_data.flags = data.flags
|
298
|
+
between_data.op = Operator::CALL
|
299
|
+
between_data.logical_op = data.logical_op
|
300
|
+
between_data.args = create_between_data_args(data, next_data)
|
301
|
+
between_data.indexes = data.indexes
|
302
|
+
between_data
|
303
|
+
end
|
304
|
+
|
305
|
+
def create_between_data_args(data, next_data)
|
306
|
+
between = Context.instance["between"]
|
307
|
+
@expression.take_object(between)
|
308
|
+
column = data.args[0]
|
309
|
+
op, next_op = data.op, next_data.op
|
310
|
+
if lower_condition?(op)
|
311
|
+
min = data.args[1]
|
312
|
+
min_operator = op
|
313
|
+
max = next_data.args[1]
|
314
|
+
max_operator = next_op
|
315
|
+
else
|
316
|
+
min = next_data.args[1]
|
317
|
+
min_operator = next_op
|
318
|
+
max = data.args[1]
|
319
|
+
max_operator = op
|
320
|
+
end
|
321
|
+
if min_operator == Operator::GREATER
|
322
|
+
min_border = "exclude"
|
323
|
+
else
|
324
|
+
min_border = "include"
|
325
|
+
end
|
326
|
+
if max_operator == Operator::LESS
|
327
|
+
max_border = "exclude"
|
328
|
+
else
|
329
|
+
max_border = "include"
|
330
|
+
end
|
331
|
+
|
332
|
+
[
|
333
|
+
between,
|
334
|
+
column,
|
335
|
+
min,
|
336
|
+
@expression.allocate_constant(min_border),
|
337
|
+
max,
|
338
|
+
@expression.allocate_constant(max_border),
|
339
|
+
]
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
@@ -0,0 +1,198 @@
|
|
1
|
+
module Groonga
|
2
|
+
class ScanInfoData
|
3
|
+
attr_accessor :start
|
4
|
+
attr_accessor :end
|
5
|
+
attr_accessor :op
|
6
|
+
attr_accessor :logical_op
|
7
|
+
attr_accessor :query
|
8
|
+
attr_accessor :args
|
9
|
+
attr_accessor :indexes
|
10
|
+
attr_accessor :flags
|
11
|
+
attr_accessor :max_interval
|
12
|
+
attr_accessor :similarity_threshold
|
13
|
+
def initialize(start)
|
14
|
+
@start = start
|
15
|
+
@end = 0
|
16
|
+
@op = 0
|
17
|
+
@logical_op = Operator::OR
|
18
|
+
@query = nil
|
19
|
+
@args = []
|
20
|
+
@indexes = []
|
21
|
+
@flags = ScanInfo::Flags::PUSH
|
22
|
+
@max_interval = nil
|
23
|
+
@similarity_threshold = nil
|
24
|
+
end
|
25
|
+
|
26
|
+
def match_resolve_index
|
27
|
+
if near_search?
|
28
|
+
match_near_resolve_index
|
29
|
+
elsif similar_search?
|
30
|
+
match_similar_resolve_index
|
31
|
+
else
|
32
|
+
match_generic_resolve_index
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def call_relational_resolve_indexes
|
37
|
+
# better index resolving framework for functions should be implemented
|
38
|
+
@args.each do |arg|
|
39
|
+
call_relational_resolve_index(arg)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
def near_search?
|
45
|
+
(@op == Operator::NEAR or @op == Operator::NEAR2) and @args.size == 3
|
46
|
+
end
|
47
|
+
|
48
|
+
def match_near_resolve_index
|
49
|
+
arg = @args[0]
|
50
|
+
case arg
|
51
|
+
when Expression
|
52
|
+
match_resolve_index_expression(arg)
|
53
|
+
when Accessor
|
54
|
+
match_resolve_index_accessor(arg)
|
55
|
+
when Object
|
56
|
+
match_resolve_index_db_obj(arg)
|
57
|
+
else
|
58
|
+
message =
|
59
|
+
"The first argument of NEAR/NEAR2 must be Expression, Accessor or Object: #{arg.class}"
|
60
|
+
raise message
|
61
|
+
end
|
62
|
+
|
63
|
+
self.query = @args[1]
|
64
|
+
self.max_interval = @args[2].value
|
65
|
+
end
|
66
|
+
|
67
|
+
def similar_search?
|
68
|
+
@op == Operator::SIMILAR and @args.size == 3
|
69
|
+
end
|
70
|
+
|
71
|
+
def match_similar_resolve_index
|
72
|
+
arg = @args[0]
|
73
|
+
case arg
|
74
|
+
when Expression
|
75
|
+
match_resolve_index_expression(arg)
|
76
|
+
when Accessor
|
77
|
+
match_resolve_index_accessor(arg)
|
78
|
+
when Object
|
79
|
+
match_resolve_index_db_obj(arg)
|
80
|
+
else
|
81
|
+
message =
|
82
|
+
"The first argument of SIMILAR must be Expression, Accessor or Object: #{arg.class}"
|
83
|
+
raise message
|
84
|
+
end
|
85
|
+
|
86
|
+
self.query = @args[1]
|
87
|
+
self.similarity_threshold = @args[2].value
|
88
|
+
end
|
89
|
+
|
90
|
+
def match_generic_resolve_index
|
91
|
+
@args.each do |arg|
|
92
|
+
case arg
|
93
|
+
when Expression
|
94
|
+
match_resolve_index_expression(arg)
|
95
|
+
when Accessor
|
96
|
+
match_resolve_index_accessor(arg)
|
97
|
+
when Object
|
98
|
+
match_resolve_index_db_obj(arg)
|
99
|
+
else
|
100
|
+
self.query = arg
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def match_resolve_index_expression(expression)
|
106
|
+
codes = expression.codes
|
107
|
+
n_codes = codes.size
|
108
|
+
i = 0
|
109
|
+
while i < n_codes
|
110
|
+
code = codes[i]
|
111
|
+
value = code.value
|
112
|
+
case value
|
113
|
+
when Accessor
|
114
|
+
match_resolve_index_expression_accessor(code)
|
115
|
+
when FixedSizeColumn, VariableSizeColumn
|
116
|
+
match_resolve_index_expression_data_column(code)
|
117
|
+
when IndexColumn
|
118
|
+
section_id = 0
|
119
|
+
rest_n_codes = n_codes - i
|
120
|
+
if rest_n_codes >= 2 and
|
121
|
+
codes[i + 1].value.is_a?(Bulk) and
|
122
|
+
codes[i + 1].value.domain == ID::UINT32 and
|
123
|
+
codes[i + 2].op == Operator::GET_MEMBER
|
124
|
+
section_id = codes[i + 1].value.value + 1
|
125
|
+
code = codes[i + 2]
|
126
|
+
i += 2
|
127
|
+
end
|
128
|
+
put_index(value, section_id, code.weight)
|
129
|
+
end
|
130
|
+
i += 1
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def match_resolve_index_expression_accessor(expr_code)
|
135
|
+
accessor = expr_code.value
|
136
|
+
self.flags |= ScanInfo::Flags::ACCESSOR
|
137
|
+
index_info = accessor.find_index(op)
|
138
|
+
return if index_info.nil?
|
139
|
+
if accessor.next
|
140
|
+
put_index(accessor, index_info.section_id, expr_code.weight)
|
141
|
+
else
|
142
|
+
put_index(index_info.index, index_info.section_id, expr_code.weight)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
def match_resolve_index_expression_data_column(expr_code)
|
147
|
+
column = expr_code.value
|
148
|
+
index_info = column.find_index(op)
|
149
|
+
return if index_info.nil?
|
150
|
+
put_index(index_info.index, index_info.section_id, expr_code.weight)
|
151
|
+
end
|
152
|
+
|
153
|
+
def match_resolve_index_db_obj(db_obj)
|
154
|
+
index_info = db_obj.find_index(op)
|
155
|
+
return if index_info.nil?
|
156
|
+
put_index(index_info.index, index_info.section_id, 1)
|
157
|
+
end
|
158
|
+
|
159
|
+
def match_resolve_index_accessor(accessor)
|
160
|
+
self.flags |= ScanInfo::Flags::ACCESSOR
|
161
|
+
index_info = accessor.find_index(op)
|
162
|
+
return if index_info.nil?
|
163
|
+
if accessor.next
|
164
|
+
put_index(accessor, index_info.section_id, 1)
|
165
|
+
else
|
166
|
+
put_index(index_info.index, index_info.section_id, 1)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
def call_relational_resolve_index(object)
|
171
|
+
case object
|
172
|
+
when Accessor
|
173
|
+
call_relational_resolve_index_accessor(object)
|
174
|
+
when Bulk
|
175
|
+
self.query = object
|
176
|
+
else
|
177
|
+
call_relational_resolve_index_db_obj(object)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
def call_relational_resolve_index_db_obj(db_obj)
|
182
|
+
index_info = db_obj.find_index(op)
|
183
|
+
return if index_info.nil?
|
184
|
+
put_index(index_info.index, index_info.section_id, 1)
|
185
|
+
end
|
186
|
+
|
187
|
+
def call_relational_resolve_index_accessor(accessor)
|
188
|
+
self.flags |= ScanInfo::Flags::ACCESSOR
|
189
|
+
index_info = accessor.find_index(op)
|
190
|
+
return if index_info.nil?
|
191
|
+
put_index(index_info.index, index_info.section_id, 1)
|
192
|
+
end
|
193
|
+
|
194
|
+
def put_index(index, section_id, weight)
|
195
|
+
@indexes << [index, section_id, weight]
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|