rroonga 2.0.8-x86-mingw32 → 2.1.0-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (389) hide show
  1. data/README.textile +2 -2
  2. data/bin/groonga-index-dump +47 -0
  3. data/doc/text/news.textile +733 -0
  4. data/doc/text/tutorial.textile +535 -0
  5. data/example/bookmark.rb +1 -1
  6. data/ext/groonga/rb-grn-database.c +21 -24
  7. data/ext/groonga/rb-grn-double-array-trie.c +50 -58
  8. data/ext/groonga/rb-grn-exception.c +18 -1
  9. data/ext/groonga/rb-grn-hash.c +18 -3
  10. data/ext/groonga/rb-grn-index-column.c +50 -2
  11. data/ext/groonga/rb-grn-normalizer.c +83 -0
  12. data/ext/groonga/rb-grn-object.c +18 -14
  13. data/ext/groonga/rb-grn-patricia-trie.c +17 -2
  14. data/ext/groonga/rb-grn-query-logger.c +263 -0
  15. data/ext/groonga/rb-grn-snippet.c +6 -0
  16. data/ext/groonga/rb-grn-table-key-support.c +204 -13
  17. data/ext/groonga/rb-grn-table.c +124 -46
  18. data/ext/groonga/rb-grn.h +14 -3
  19. data/ext/groonga/rb-groonga.c +2 -0
  20. data/lib/1.8/groonga.so +0 -0
  21. data/lib/1.9/groonga.so +0 -0
  22. data/lib/groonga.rb +2 -1
  23. data/lib/groonga/database.rb +7 -0
  24. data/lib/groonga/dumper.rb +21 -2
  25. data/lib/groonga/index-column.rb +170 -0
  26. data/lib/groonga/query-logger.rb +129 -0
  27. data/lib/groonga/record.rb +32 -8
  28. data/lib/groonga/schema.rb +231 -288
  29. data/rroonga-build.rb +2 -2
  30. data/rroonga.gemspec +11 -7
  31. data/test/groonga-test-utils.rb +18 -6
  32. data/test/test-hash.rb +49 -20
  33. data/test/test-index-cursor.rb +4 -4
  34. data/{Gemfile → test/test-normalizer.rb} +9 -5
  35. data/test/test-pagination.rb +1 -1
  36. data/test/test-patricia-trie.rb +8 -0
  37. data/test/test-schema.rb +16 -13
  38. data/test/test-snippet.rb +5 -0
  39. data/test/test-table.rb +24 -12
  40. data/test/test-view.rb +0 -1
  41. data/vendor/local/bin/groonga-benchmark.exe +0 -0
  42. data/vendor/local/bin/groonga.exe +0 -0
  43. data/vendor/local/bin/libgroonga-0.dll +0 -0
  44. data/vendor/local/bin/libmecab-1.dll +0 -0
  45. data/vendor/local/bin/libmsgpack-3.dll +0 -0
  46. data/vendor/local/bin/libmsgpackc-2.dll +0 -0
  47. data/vendor/local/bin/mecab-config +2 -2
  48. data/vendor/local/bin/mecab.exe +0 -0
  49. data/vendor/local/etc/groonga/httpd/groonga-httpd.conf +2 -2
  50. data/vendor/local/include/groonga/groonga.h +25 -14
  51. data/vendor/local/include/groonga/groonga/normalizer.h +55 -0
  52. data/vendor/local/include/groonga/groonga/tokenizer.h +33 -13
  53. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.a +0 -0
  54. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll +0 -0
  55. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll.a +0 -0
  56. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.la +2 -2
  57. data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
  58. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
  59. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
  60. data/vendor/local/lib/groonga/plugins/suggest/suggest.la +2 -2
  61. data/vendor/local/lib/groonga/plugins/table/table.a +0 -0
  62. data/vendor/local/lib/groonga/plugins/table/table.dll +0 -0
  63. data/vendor/local/lib/groonga/plugins/table/table.dll.a +0 -0
  64. data/vendor/local/lib/groonga/plugins/table/table.la +2 -2
  65. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.a +0 -0
  66. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll +0 -0
  67. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll.a +0 -0
  68. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.la +2 -2
  69. data/vendor/local/lib/libgroonga.a +0 -0
  70. data/vendor/local/lib/libgroonga.dll.a +0 -0
  71. data/vendor/local/lib/libgroonga.la +2 -2
  72. data/vendor/local/lib/libmecab.a +0 -0
  73. data/vendor/local/lib/libmecab.dll.a +0 -0
  74. data/vendor/local/lib/libmecab.la +1 -1
  75. data/vendor/local/lib/libmsgpack.a +0 -0
  76. data/vendor/local/lib/libmsgpack.dll.a +0 -0
  77. data/vendor/local/lib/libmsgpack.la +1 -1
  78. data/vendor/local/lib/libmsgpackc.a +0 -0
  79. data/vendor/local/lib/libmsgpackc.dll.a +0 -0
  80. data/vendor/local/lib/libmsgpackc.la +1 -1
  81. data/vendor/local/lib/pkgconfig/groonga.pc +3 -3
  82. data/vendor/local/libexec/mecab/mecab-cost-train.exe +0 -0
  83. data/vendor/local/libexec/mecab/mecab-dict-gen.exe +0 -0
  84. data/vendor/local/libexec/mecab/mecab-dict-index.exe +0 -0
  85. data/vendor/local/libexec/mecab/mecab-system-eval.exe +0 -0
  86. data/vendor/local/libexec/mecab/mecab-test-gen.exe +0 -0
  87. data/vendor/local/sbin/groonga-httpd-restart +9 -3
  88. data/vendor/local/share/doc/groonga/en/html/.buildinfo +1 -1
  89. data/vendor/local/share/doc/groonga/en/html/_sources/install/centos.txt +6 -6
  90. data/vendor/local/share/doc/groonga/en/html/_sources/install/debian.txt +3 -3
  91. data/vendor/local/share/doc/groonga/en/html/_sources/install/fedora.txt +4 -4
  92. data/vendor/local/share/doc/groonga/en/html/_sources/install/mac_os_x.txt +3 -3
  93. data/vendor/local/share/doc/groonga/en/html/_sources/install/others.txt +3 -3
  94. data/vendor/local/share/doc/groonga/en/html/_sources/install/solaris.txt +3 -3
  95. data/vendor/local/share/doc/groonga/en/html/_sources/install/ubuntu.txt +3 -42
  96. data/vendor/local/share/doc/groonga/en/html/_sources/install/windows.txt +16 -16
  97. data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +59 -0
  98. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/match_columns.txt +129 -0
  99. data/vendor/local/share/doc/groonga/en/html/_static/doctools.js +0 -12
  100. data/vendor/local/share/doc/groonga/en/html/_static/searchtools.js +3 -3
  101. data/vendor/local/share/doc/groonga/en/html/characteristic.html +6 -6
  102. data/vendor/local/share/doc/groonga/en/html/community.html +6 -6
  103. data/vendor/local/share/doc/groonga/en/html/contribution.html +6 -6
  104. data/vendor/local/share/doc/groonga/en/html/contribution/development.html +5 -5
  105. data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +5 -5
  106. data/vendor/local/share/doc/groonga/en/html/contribution/development/document.html +5 -5
  107. data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +5 -5
  108. data/vendor/local/share/doc/groonga/en/html/contribution/development/release.html +5 -5
  109. data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +5 -5
  110. data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +5 -5
  111. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +5 -5
  112. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +5 -5
  113. data/vendor/local/share/doc/groonga/en/html/contribution/report.html +5 -5
  114. data/vendor/local/share/doc/groonga/en/html/development.html +6 -6
  115. data/vendor/local/share/doc/groonga/en/html/development/travis-ci.html +5 -5
  116. data/vendor/local/share/doc/groonga/en/html/genindex.html +6 -6
  117. data/vendor/local/share/doc/groonga/en/html/geolocation_search.html +6 -6
  118. data/vendor/local/share/doc/groonga/en/html/index.html +12 -12
  119. data/vendor/local/share/doc/groonga/en/html/install.html +10 -11
  120. data/vendor/local/share/doc/groonga/en/html/install/centos.html +11 -11
  121. data/vendor/local/share/doc/groonga/en/html/install/debian.html +8 -8
  122. data/vendor/local/share/doc/groonga/en/html/install/fedora.html +9 -9
  123. data/vendor/local/share/doc/groonga/en/html/install/mac_os_x.html +8 -8
  124. data/vendor/local/share/doc/groonga/en/html/install/others.html +8 -8
  125. data/vendor/local/share/doc/groonga/en/html/install/solaris.html +8 -8
  126. data/vendor/local/share/doc/groonga/en/html/install/ubuntu.html +16 -53
  127. data/vendor/local/share/doc/groonga/en/html/install/windows.html +16 -16
  128. data/vendor/local/share/doc/groonga/en/html/limitations.html +6 -6
  129. data/vendor/local/share/doc/groonga/en/html/news.html +146 -82
  130. data/vendor/local/share/doc/groonga/en/html/news/0.x.html +5 -5
  131. data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +5 -5
  132. data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +5 -5
  133. data/vendor/local/share/doc/groonga/en/html/news/1.2.x.html +5 -5
  134. data/vendor/local/share/doc/groonga/en/html/news/senna.html +5 -5
  135. data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
  136. data/vendor/local/share/doc/groonga/en/html/reference.html +6 -6
  137. data/vendor/local/share/doc/groonga/en/html/reference/api.html +5 -5
  138. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_expr.html +5 -5
  139. data/vendor/local/share/doc/groonga/en/html/reference/cast.html +5 -5
  140. data/vendor/local/share/doc/groonga/en/html/reference/command.html +5 -5
  141. data/vendor/local/share/doc/groonga/en/html/reference/command/command_version.html +5 -5
  142. data/vendor/local/share/doc/groonga/en/html/reference/command/output_format.html +5 -5
  143. data/vendor/local/share/doc/groonga/en/html/reference/command/return_code.html +5 -5
  144. data/vendor/local/share/doc/groonga/en/html/reference/commands/cache_limit.html +5 -5
  145. data/vendor/local/share/doc/groonga/en/html/reference/commands/check.html +5 -5
  146. data/vendor/local/share/doc/groonga/en/html/reference/commands/clearlock.html +5 -5
  147. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_create.html +5 -5
  148. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_list.html +5 -5
  149. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_remove.html +5 -5
  150. data/vendor/local/share/doc/groonga/en/html/reference/commands/define_selector.html +5 -5
  151. data/vendor/local/share/doc/groonga/en/html/reference/commands/defrag.html +5 -5
  152. data/vendor/local/share/doc/groonga/en/html/reference/commands/delete.html +5 -5
  153. data/vendor/local/share/doc/groonga/en/html/reference/commands/dump.html +5 -5
  154. data/vendor/local/share/doc/groonga/en/html/reference/commands/load.html +5 -5
  155. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_level.html +5 -5
  156. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_put.html +5 -5
  157. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_reopen.html +5 -5
  158. data/vendor/local/share/doc/groonga/en/html/reference/commands/quit.html +5 -5
  159. data/vendor/local/share/doc/groonga/en/html/reference/commands/register.html +5 -5
  160. data/vendor/local/share/doc/groonga/en/html/reference/commands/select.html +5 -5
  161. data/vendor/local/share/doc/groonga/en/html/reference/commands/shutdown.html +5 -5
  162. data/vendor/local/share/doc/groonga/en/html/reference/commands/status.html +5 -5
  163. data/vendor/local/share/doc/groonga/en/html/reference/commands/suggest.html +5 -5
  164. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_create.html +5 -5
  165. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_list.html +5 -5
  166. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_remove.html +5 -5
  167. data/vendor/local/share/doc/groonga/en/html/reference/commands/view_add.html +5 -5
  168. data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/add.html +5 -5
  169. data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/get.html +5 -5
  170. data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/set.html +5 -5
  171. data/vendor/local/share/doc/groonga/en/html/reference/executables.html +5 -5
  172. data/vendor/local/share/doc/groonga/en/html/reference/executables/grnslap.html +5 -5
  173. data/vendor/local/share/doc/groonga/en/html/reference/executables/grntest.html +5 -5
  174. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-httpd.html +5 -5
  175. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-server-http.html +5 -5
  176. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-create-dataset.html +5 -5
  177. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga.html +5 -5
  178. data/vendor/local/share/doc/groonga/en/html/reference/function.html +5 -5
  179. data/vendor/local/share/doc/groonga/en/html/reference/functions/edit_distance.html +5 -5
  180. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_distance.html +5 -5
  181. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_circle.html +5 -5
  182. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_rectangle.html +5 -5
  183. data/vendor/local/share/doc/groonga/en/html/reference/functions/now.html +5 -5
  184. data/vendor/local/share/doc/groonga/en/html/reference/functions/rand.html +5 -5
  185. data/vendor/local/share/doc/groonga/en/html/reference/functions/snippet_html.html +5 -5
  186. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr.html +5 -5
  187. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/query_syntax.html +5 -5
  188. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/script_syntax.html +5 -5
  189. data/vendor/local/share/doc/groonga/en/html/reference/indexing.html +5 -5
  190. data/vendor/local/share/doc/groonga/en/html/reference/log.html +5 -5
  191. data/vendor/local/share/doc/groonga/en/html/reference/output.html +5 -5
  192. data/vendor/local/share/doc/groonga/en/html/reference/pseudo_column.html +5 -5
  193. data/vendor/local/share/doc/groonga/en/html/reference/query_expanders.html +5 -5
  194. data/vendor/local/share/doc/groonga/en/html/reference/query_expanders/tsv.html +5 -5
  195. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers.html +5 -5
  196. data/vendor/local/share/doc/groonga/en/html/reference/type.html +5 -5
  197. data/vendor/local/share/doc/groonga/en/html/search.html +6 -6
  198. data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
  199. data/vendor/local/share/doc/groonga/en/html/server.html +6 -6
  200. data/vendor/local/share/doc/groonga/en/html/server/gqtp.html +5 -5
  201. data/vendor/local/share/doc/groonga/en/html/server/http.html +5 -5
  202. data/vendor/local/share/doc/groonga/en/html/server/http/comparison.html +5 -5
  203. data/vendor/local/share/doc/groonga/en/html/server/http/groonga-httpd.html +5 -5
  204. data/vendor/local/share/doc/groonga/en/html/server/http/groonga.html +5 -5
  205. data/vendor/local/share/doc/groonga/en/html/spec.html +6 -6
  206. data/vendor/local/share/doc/groonga/en/html/spec/gqtp.html +5 -5
  207. data/vendor/local/share/doc/groonga/en/html/spec/search.html +5 -5
  208. data/vendor/local/share/doc/groonga/en/html/suggest.html +6 -6
  209. data/vendor/local/share/doc/groonga/en/html/suggest/completion.html +5 -5
  210. data/vendor/local/share/doc/groonga/en/html/suggest/correction.html +5 -5
  211. data/vendor/local/share/doc/groonga/en/html/suggest/introduction.html +5 -5
  212. data/vendor/local/share/doc/groonga/en/html/suggest/suggestion.html +5 -5
  213. data/vendor/local/share/doc/groonga/en/html/suggest/tutorial.html +5 -5
  214. data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +6 -6
  215. data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
  216. data/vendor/local/share/doc/groonga/en/html/tutorial.html +8 -7
  217. data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +5 -5
  218. data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +5 -5
  219. data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +5 -5
  220. data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +5 -5
  221. data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +5 -5
  222. data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +265 -7
  223. data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +5 -5
  224. data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +5 -5
  225. data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +5 -5
  226. data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +5 -5
  227. data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +5 -5
  228. data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
  229. data/vendor/local/share/doc/groonga/ja/html/_sources/install/centos.txt +6 -6
  230. data/vendor/local/share/doc/groonga/ja/html/_sources/install/debian.txt +3 -3
  231. data/vendor/local/share/doc/groonga/ja/html/_sources/install/fedora.txt +4 -4
  232. data/vendor/local/share/doc/groonga/ja/html/_sources/install/mac_os_x.txt +3 -3
  233. data/vendor/local/share/doc/groonga/ja/html/_sources/install/others.txt +3 -3
  234. data/vendor/local/share/doc/groonga/ja/html/_sources/install/solaris.txt +3 -3
  235. data/vendor/local/share/doc/groonga/ja/html/_sources/install/ubuntu.txt +3 -42
  236. data/vendor/local/share/doc/groonga/ja/html/_sources/install/windows.txt +16 -16
  237. data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +59 -0
  238. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/match_columns.txt +129 -0
  239. data/vendor/local/share/doc/groonga/ja/html/_static/doctools.js +0 -12
  240. data/vendor/local/share/doc/groonga/ja/html/_static/searchtools.js +2 -2
  241. data/vendor/local/share/doc/groonga/ja/html/characteristic.html +6 -6
  242. data/vendor/local/share/doc/groonga/ja/html/community.html +6 -6
  243. data/vendor/local/share/doc/groonga/ja/html/contribution.html +9 -9
  244. data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +5 -5
  245. data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +5 -5
  246. data/vendor/local/share/doc/groonga/ja/html/contribution/development/document.html +5 -5
  247. data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +5 -5
  248. data/vendor/local/share/doc/groonga/ja/html/contribution/development/release.html +5 -5
  249. data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +5 -5
  250. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +6 -6
  251. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +6 -6
  252. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +6 -6
  253. data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +5 -5
  254. data/vendor/local/share/doc/groonga/ja/html/development.html +6 -6
  255. data/vendor/local/share/doc/groonga/ja/html/development/travis-ci.html +5 -5
  256. data/vendor/local/share/doc/groonga/ja/html/genindex.html +6 -6
  257. data/vendor/local/share/doc/groonga/ja/html/geolocation_search.html +6 -6
  258. data/vendor/local/share/doc/groonga/ja/html/index.html +12 -12
  259. data/vendor/local/share/doc/groonga/ja/html/install.html +10 -11
  260. data/vendor/local/share/doc/groonga/ja/html/install/centos.html +11 -11
  261. data/vendor/local/share/doc/groonga/ja/html/install/debian.html +8 -8
  262. data/vendor/local/share/doc/groonga/ja/html/install/fedora.html +9 -9
  263. data/vendor/local/share/doc/groonga/ja/html/install/mac_os_x.html +8 -8
  264. data/vendor/local/share/doc/groonga/ja/html/install/others.html +8 -8
  265. data/vendor/local/share/doc/groonga/ja/html/install/solaris.html +8 -8
  266. data/vendor/local/share/doc/groonga/ja/html/install/ubuntu.html +16 -51
  267. data/vendor/local/share/doc/groonga/ja/html/install/windows.html +16 -16
  268. data/vendor/local/share/doc/groonga/ja/html/limitations.html +6 -6
  269. data/vendor/local/share/doc/groonga/ja/html/news.html +126 -82
  270. data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +5 -5
  271. data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +5 -5
  272. data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +5 -5
  273. data/vendor/local/share/doc/groonga/ja/html/news/1.2.x.html +5 -5
  274. data/vendor/local/share/doc/groonga/ja/html/news/senna.html +5 -5
  275. data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
  276. data/vendor/local/share/doc/groonga/ja/html/reference.html +6 -6
  277. data/vendor/local/share/doc/groonga/ja/html/reference/api.html +5 -5
  278. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_expr.html +5 -5
  279. data/vendor/local/share/doc/groonga/ja/html/reference/cast.html +5 -5
  280. data/vendor/local/share/doc/groonga/ja/html/reference/command.html +5 -5
  281. data/vendor/local/share/doc/groonga/ja/html/reference/command/command_version.html +5 -5
  282. data/vendor/local/share/doc/groonga/ja/html/reference/command/output_format.html +5 -5
  283. data/vendor/local/share/doc/groonga/ja/html/reference/command/return_code.html +5 -5
  284. data/vendor/local/share/doc/groonga/ja/html/reference/commands/cache_limit.html +5 -5
  285. data/vendor/local/share/doc/groonga/ja/html/reference/commands/check.html +5 -5
  286. data/vendor/local/share/doc/groonga/ja/html/reference/commands/clearlock.html +5 -5
  287. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_create.html +5 -5
  288. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_list.html +5 -5
  289. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_remove.html +5 -5
  290. data/vendor/local/share/doc/groonga/ja/html/reference/commands/define_selector.html +5 -5
  291. data/vendor/local/share/doc/groonga/ja/html/reference/commands/defrag.html +5 -5
  292. data/vendor/local/share/doc/groonga/ja/html/reference/commands/delete.html +5 -5
  293. data/vendor/local/share/doc/groonga/ja/html/reference/commands/dump.html +5 -5
  294. data/vendor/local/share/doc/groonga/ja/html/reference/commands/load.html +5 -5
  295. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_level.html +5 -5
  296. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_put.html +5 -5
  297. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_reopen.html +5 -5
  298. data/vendor/local/share/doc/groonga/ja/html/reference/commands/quit.html +5 -5
  299. data/vendor/local/share/doc/groonga/ja/html/reference/commands/register.html +5 -5
  300. data/vendor/local/share/doc/groonga/ja/html/reference/commands/select.html +5 -5
  301. data/vendor/local/share/doc/groonga/ja/html/reference/commands/shutdown.html +5 -5
  302. data/vendor/local/share/doc/groonga/ja/html/reference/commands/status.html +5 -5
  303. data/vendor/local/share/doc/groonga/ja/html/reference/commands/suggest.html +5 -5
  304. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_create.html +5 -5
  305. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_list.html +5 -5
  306. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_remove.html +5 -5
  307. data/vendor/local/share/doc/groonga/ja/html/reference/commands/view_add.html +5 -5
  308. data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/add.html +5 -5
  309. data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/get.html +5 -5
  310. data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/set.html +5 -5
  311. data/vendor/local/share/doc/groonga/ja/html/reference/executables.html +5 -5
  312. data/vendor/local/share/doc/groonga/ja/html/reference/executables/grnslap.html +5 -5
  313. data/vendor/local/share/doc/groonga/ja/html/reference/executables/grntest.html +5 -5
  314. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-httpd.html +5 -5
  315. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-server-http.html +5 -5
  316. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-create-dataset.html +5 -5
  317. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga.html +5 -5
  318. data/vendor/local/share/doc/groonga/ja/html/reference/function.html +5 -5
  319. data/vendor/local/share/doc/groonga/ja/html/reference/functions/edit_distance.html +5 -5
  320. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_distance.html +5 -5
  321. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_circle.html +5 -5
  322. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_rectangle.html +5 -5
  323. data/vendor/local/share/doc/groonga/ja/html/reference/functions/now.html +5 -5
  324. data/vendor/local/share/doc/groonga/ja/html/reference/functions/rand.html +5 -5
  325. data/vendor/local/share/doc/groonga/ja/html/reference/functions/snippet_html.html +5 -5
  326. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr.html +5 -5
  327. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/query_syntax.html +5 -5
  328. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/script_syntax.html +5 -5
  329. data/vendor/local/share/doc/groonga/ja/html/reference/indexing.html +5 -5
  330. data/vendor/local/share/doc/groonga/ja/html/reference/log.html +5 -5
  331. data/vendor/local/share/doc/groonga/ja/html/reference/output.html +5 -5
  332. data/vendor/local/share/doc/groonga/ja/html/reference/pseudo_column.html +5 -5
  333. data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders.html +5 -5
  334. data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders/tsv.html +5 -5
  335. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers.html +5 -5
  336. data/vendor/local/share/doc/groonga/ja/html/reference/type.html +5 -5
  337. data/vendor/local/share/doc/groonga/ja/html/search.html +6 -6
  338. data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
  339. data/vendor/local/share/doc/groonga/ja/html/server.html +6 -6
  340. data/vendor/local/share/doc/groonga/ja/html/server/gqtp.html +5 -5
  341. data/vendor/local/share/doc/groonga/ja/html/server/http.html +5 -5
  342. data/vendor/local/share/doc/groonga/ja/html/server/http/comparison.html +5 -5
  343. data/vendor/local/share/doc/groonga/ja/html/server/http/groonga-httpd.html +5 -5
  344. data/vendor/local/share/doc/groonga/ja/html/server/http/groonga.html +5 -5
  345. data/vendor/local/share/doc/groonga/ja/html/spec.html +6 -6
  346. data/vendor/local/share/doc/groonga/ja/html/spec/gqtp.html +5 -5
  347. data/vendor/local/share/doc/groonga/ja/html/spec/search.html +5 -5
  348. data/vendor/local/share/doc/groonga/ja/html/suggest.html +6 -6
  349. data/vendor/local/share/doc/groonga/ja/html/suggest/completion.html +5 -5
  350. data/vendor/local/share/doc/groonga/ja/html/suggest/correction.html +5 -5
  351. data/vendor/local/share/doc/groonga/ja/html/suggest/introduction.html +5 -5
  352. data/vendor/local/share/doc/groonga/ja/html/suggest/suggestion.html +5 -5
  353. data/vendor/local/share/doc/groonga/ja/html/suggest/tutorial.html +5 -5
  354. data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +6 -6
  355. data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
  356. data/vendor/local/share/doc/groonga/ja/html/tutorial.html +8 -7
  357. data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +5 -5
  358. data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +5 -5
  359. data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +5 -5
  360. data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +5 -5
  361. data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +5 -5
  362. data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +259 -7
  363. data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +5 -5
  364. data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +5 -5
  365. data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +5 -5
  366. data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +5 -5
  367. data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +5 -5
  368. data/vendor/local/share/doc/groonga/source/example/tutorial/match_columns-nested-index-data-with-three-relationship.log +23 -0
  369. data/vendor/local/share/doc/groonga/source/example/tutorial/match_columns-nested-index-data.log +16 -0
  370. data/vendor/local/share/doc/groonga/source/example/tutorial/match_columns-nested-index-schema-with-three-relationship.log +30 -0
  371. data/vendor/local/share/doc/groonga/source/example/tutorial/match_columns-nested-index-schema.log +20 -0
  372. data/vendor/local/share/doc/groonga/source/example/tutorial/match_columns-nested-index-select-with-three-relationship.log +86 -0
  373. data/vendor/local/share/doc/groonga/source/example/tutorial/match_columns-nested-index-select.log +41 -0
  374. data/vendor/local/share/doc/groonga/source/install/centos.txt +6 -6
  375. data/vendor/local/share/doc/groonga/source/install/debian.txt +3 -3
  376. data/vendor/local/share/doc/groonga/source/install/fedora.txt +4 -4
  377. data/vendor/local/share/doc/groonga/source/install/mac_os_x.txt +3 -3
  378. data/vendor/local/share/doc/groonga/source/install/others.txt +3 -3
  379. data/vendor/local/share/doc/groonga/source/install/solaris.txt +3 -3
  380. data/vendor/local/share/doc/groonga/source/install/ubuntu.txt +3 -42
  381. data/vendor/local/share/doc/groonga/source/install/windows.txt +16 -16
  382. data/vendor/local/share/doc/groonga/source/news.txt +59 -0
  383. data/vendor/local/share/doc/groonga/source/tutorial/match_columns.txt +129 -0
  384. data/vendor/local/share/man/ja/man1/groonga.1 +338 -93
  385. data/vendor/local/share/man/man1/groonga.1 +341 -92
  386. metadata +1258 -1242
  387. data/AUTHORS +0 -5
  388. data/Rakefile +0 -203
  389. data/bin/groonga-query-log-extract +0 -117
@@ -663,9 +663,9 @@ rb_grn_object_inspect_content_id_with_label (VALUE inspected,
663
663
  return inspected;
664
664
  }
665
665
 
666
- static VALUE
667
- rb_grn_object_inspect_content_name (VALUE inspected,
668
- grn_ctx *context, grn_obj *object)
666
+ VALUE
667
+ rb_grn_object_inspect_object_content_name (VALUE inspected,
668
+ grn_ctx *context, grn_obj *object)
669
669
  {
670
670
  int name_size;
671
671
 
@@ -694,7 +694,7 @@ rb_grn_object_inspect_content_name_with_label (VALUE inspected,
694
694
  {
695
695
 
696
696
  rb_str_cat2(inspected, "name: ");
697
- rb_grn_object_inspect_content_name(inspected, context, object);
697
+ rb_grn_object_inspect_object_content_name(inspected, context, object);
698
698
  return inspected;
699
699
  }
700
700
 
@@ -736,8 +736,9 @@ rb_grn_object_inspect_content_domain_with_label (VALUE inspected,
736
736
  if (domain_object == object) {
737
737
  rb_str_cat2(inspected, "(self)");
738
738
  } else {
739
- rb_grn_object_inspect_content_name(inspected,
740
- context, domain_object);
739
+ rb_grn_object_inspect_object_content_name(inspected,
740
+ context,
741
+ domain_object);
741
742
  }
742
743
  } else {
743
744
  rb_str_cat2(inspected, "(");
@@ -776,8 +777,9 @@ rb_grn_object_inspect_content_range_with_label (VALUE inspected,
776
777
  if (range_object == object) {
777
778
  rb_str_cat2(inspected, "(self)");
778
779
  } else {
779
- rb_grn_object_inspect_content_name(inspected,
780
- context, range_object);
780
+ rb_grn_object_inspect_object_content_name(inspected,
781
+ context,
782
+ range_object);
781
783
  }
782
784
  } else {
783
785
  rb_str_cat2(inspected, "(");
@@ -876,16 +878,18 @@ rb_grn_object_inspect_content_flags_with_label (VALUE inspected,
876
878
  if (flags & GRN_OBJ_COMPRESS_LZO)
877
879
  rb_ary_push(inspected_flags, rb_str_new2("COMPRESS_LZO"));
878
880
  break;
881
+ case GRN_COLUMN_INDEX:
882
+ if (flags & GRN_OBJ_WITH_SECTION)
883
+ rb_ary_push(inspected_flags, rb_str_new2("WITH_SECTION"));
884
+ if (flags & GRN_OBJ_WITH_WEIGHT)
885
+ rb_ary_push(inspected_flags, rb_str_new2("WITH_WEIGHT"));
886
+ if (flags & GRN_OBJ_WITH_POSITION)
887
+ rb_ary_push(inspected_flags, rb_str_new2("WITH_POSITION"));
888
+ break;
879
889
  default:
880
890
  break;
881
891
  }
882
892
 
883
- if (flags & GRN_OBJ_WITH_SECTION)
884
- rb_ary_push(inspected_flags, rb_str_new2("WITH_SECTION"));
885
- if (flags & GRN_OBJ_WITH_WEIGHT)
886
- rb_ary_push(inspected_flags, rb_str_new2("WITH_WEIGHT"));
887
- if (flags & GRN_OBJ_WITH_POSITION)
888
- rb_ary_push(inspected_flags, rb_str_new2("WITH_POSITION"));
889
893
  if (flags & GRN_OBJ_RING_BUFFER)
890
894
  rb_ary_push(inspected_flags, rb_str_new2("RING_BUFFER"));
891
895
 
@@ -104,8 +104,12 @@ VALUE rb_cGrnPatriciaTrie;
104
104
  * 場合は自動的にパスが付加される。 +:context+ で指定した
105
105
  * {Groonga::Context} に結びついているデータベースが一時デー
106
106
  * タベースの場合は例外が発生する。
107
- * @option options :key_normalize
108
- * +true+ を指定するとキーを正規化する。
107
+ *
108
+ * @option options :key_normalize (false) Keys are normalized
109
+ * if this value is @true@.
110
+ *
111
+ * @deprecated Use @:normalizer => "NormalizerAuto"@ instead.
112
+ *
109
113
  * @option options :key_with_sis
110
114
  * +true+ を指定するとキーの文字列の全suffixが自動的に登
111
115
  * 録される。
@@ -141,6 +145,12 @@ VALUE rb_cGrnPatriciaTrie;
141
145
  * +true+ を指定すると {#group} でグループ化したときに、
142
146
  * {Groonga::Record#n_sub_records} でグループに含まれるレコー
143
147
  * ドの件数を取得できる。
148
+ *
149
+ * @option options [String, Groonga::Procedure, nil] :normalizer
150
+ * The normalizer that is used by {Groonga::IndexColumn}. You
151
+ * can specify this by normalizer name as String such as
152
+ * @"NormalizerAuto"@ or normalizer object.
153
+ *
144
154
  * @!macro patricia_trie.create.options
145
155
  * @overload create(options={})
146
156
  * @yield [table]
@@ -159,6 +169,7 @@ rb_grn_patricia_trie_s_create (int argc, VALUE *argv, VALUE klass)
159
169
  VALUE rb_key_normalize, rb_key_with_sis, rb_key_type;
160
170
  VALUE rb_value_type;
161
171
  VALUE rb_default_tokenizer, rb_sub_records;
172
+ VALUE rb_normalizer;
162
173
 
163
174
  rb_scan_args(argc, argv, "01", &options);
164
175
 
@@ -173,6 +184,7 @@ rb_grn_patricia_trie_s_create (int argc, VALUE *argv, VALUE klass)
173
184
  "value_type", &rb_value_type,
174
185
  "default_tokenizer", &rb_default_tokenizer,
175
186
  "sub_records", &rb_sub_records,
187
+ "normalizer", &rb_normalizer,
176
188
  NULL);
177
189
 
178
190
  context = rb_grn_context_ensure(&rb_context);
@@ -218,6 +230,9 @@ rb_grn_patricia_trie_s_create (int argc, VALUE *argv, VALUE klass)
218
230
  if (!NIL_P(rb_default_tokenizer))
219
231
  rb_funcall(rb_table, rb_intern("default_tokenizer="), 1,
220
232
  rb_default_tokenizer);
233
+ if (!NIL_P(rb_normalizer))
234
+ rb_funcall(rb_table, rb_intern("normalizer="), 1,
235
+ rb_normalizer);
221
236
 
222
237
  if (rb_block_given_p())
223
238
  return rb_ensure(rb_yield, rb_table, rb_grn_object_close, rb_table);
@@ -0,0 +1,263 @@
1
+ /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
+ /*
3
+ Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
4
+
5
+ This library is free software; you can redistribute it and/or
6
+ modify it under the terms of the GNU Lesser General Public
7
+ License version 2.1 as published by the Free Software Foundation.
8
+
9
+ This library is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ Lesser General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Lesser General Public
15
+ License along with this library; if not, write to the Free Software
16
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
+ */
18
+
19
+ #include "rb-grn.h"
20
+
21
+ /*
22
+ * Document-class: Groonga::QueryLogger
23
+ *
24
+ * A class for logging query log.
25
+ *
26
+ */
27
+
28
+ #define GRNQUERYLOGFLAGS2RVAL(flags) (rb_grn_query_log_flags_to_ruby_object(flags))
29
+
30
+ VALUE cGrnQueryLogger;
31
+ VALUE mGrnQueryLoggerFlags;
32
+ VALUE cGrnCallbackQueryLogger;
33
+
34
+ static ID id_new;
35
+ static ID id_parse;
36
+ static ID id_log;
37
+ static ID id_reopen;
38
+ static ID id_fin;
39
+
40
+ static grn_query_logger rb_grn_query_logger;
41
+
42
+ static VALUE
43
+ rb_grn_query_log_flags_to_ruby_object (unsigned int flags)
44
+ {
45
+ return UINT2NUM(flags);
46
+ }
47
+
48
+ static void
49
+ rb_grn_query_logger_log (grn_ctx *ctx, unsigned int flag,
50
+ const char *timestamp, const char *info,
51
+ const char *message, void *user_data)
52
+ {
53
+ VALUE handler = (VALUE)user_data;
54
+
55
+ if (NIL_P(handler))
56
+ return;
57
+
58
+ /* TODO: use rb_protect(). */
59
+ rb_funcall(handler, id_log, 4,
60
+ GRNQUERYLOGFLAGS2RVAL(flag),
61
+ rb_str_new2(timestamp),
62
+ rb_str_new2(info),
63
+ rb_str_new2(message));
64
+ }
65
+
66
+ static void
67
+ rb_grn_query_logger_reopen (grn_ctx *ctx, void *user_data)
68
+ {
69
+ VALUE handler = (VALUE)user_data;
70
+
71
+ if (NIL_P(handler))
72
+ return;
73
+
74
+ /* TODO: use rb_protect(). */
75
+ rb_funcall(handler, id_reopen, 0);
76
+ }
77
+
78
+ static void
79
+ rb_grn_query_logger_fin (grn_ctx *ctx, void *user_data)
80
+ {
81
+ VALUE handler = (VALUE)user_data;
82
+
83
+ if (NIL_P(handler))
84
+ return;
85
+
86
+ /* TODO: use rb_protect(). */
87
+ rb_funcall(handler, id_fin, 0);
88
+ }
89
+
90
+ /*
91
+ * Registers a query logger or a callback that is called when a
92
+ * query log event is emitted.
93
+ *
94
+ * @overload register(logger, options={})
95
+ * @param logger [#log, #reopen, #fin] The query logger. It is easy to
96
+ * inherit {QueryLogger}.
97
+ *
98
+ * @!macro query-logger.register.options
99
+ * @param options [::Hash] The options.
100
+ * @option options [Symbol, String, Integer or nil] :flags (:default)
101
+ * Flags describe what query log should be logged.
102
+ *
103
+ * @see {QueryLogger::Flags.parse}
104
+ *
105
+ * @return void
106
+ *
107
+ * @overload register(options={})
108
+ * @yield [action, flag, timestamp, info, message]
109
+ * ...
110
+ *
111
+ * @!macro query-logger.register.options
112
+ */
113
+ static VALUE
114
+ rb_grn_query_logger_s_register (int argc, VALUE *argv, VALUE klass)
115
+ {
116
+ VALUE rb_context = Qnil;
117
+ grn_ctx *context;
118
+ VALUE rb_logger, rb_callback;
119
+ VALUE rb_options, rb_command, rb_result_code, rb_destination;
120
+ VALUE rb_cache, rb_size, rb_score, rb_default, rb_all, rb_flags;
121
+ unsigned int flags = GRN_QUERY_LOG_NONE;
122
+
123
+ rb_scan_args(argc, argv, "02&", &rb_logger, &rb_options, &rb_callback);
124
+
125
+ if (rb_block_given_p()) {
126
+ rb_logger = rb_funcall(cGrnCallbackQueryLogger, id_new, 1, rb_callback);
127
+ }
128
+
129
+ rb_grn_scan_options(rb_options,
130
+ "command", &rb_command,
131
+ "result_code", &rb_result_code,
132
+ "destination", &rb_destination,
133
+ "cache", &rb_cache,
134
+ "size", &rb_size,
135
+ "score", &rb_score,
136
+ "default", &rb_default,
137
+ "all", &rb_all,
138
+ "flags", &rb_flags,
139
+ NULL);
140
+
141
+ if (RVAL2CBOOL(rb_command)) {
142
+ flags |= GRN_QUERY_LOG_COMMAND;
143
+ }
144
+ if (RVAL2CBOOL(rb_result_code)) {
145
+ flags |= GRN_QUERY_LOG_RESULT_CODE;
146
+ }
147
+ if (RVAL2CBOOL(rb_destination)) {
148
+ flags |= GRN_QUERY_LOG_DESTINATION;
149
+ }
150
+ if (RVAL2CBOOL(rb_cache)) {
151
+ flags |= GRN_QUERY_LOG_CACHE;
152
+ }
153
+ if (RVAL2CBOOL(rb_size)) {
154
+ flags |= GRN_QUERY_LOG_SIZE;
155
+ }
156
+ if (RVAL2CBOOL(rb_score)) {
157
+ flags |= GRN_QUERY_LOG_SCORE;
158
+ }
159
+ if (RVAL2CBOOL(rb_default)) {
160
+ flags |= GRN_QUERY_LOG_DEFAULT;
161
+ }
162
+ if (RVAL2CBOOL(rb_all)) {
163
+ flags |= GRN_QUERY_LOG_ALL;
164
+ }
165
+ if (!NIL_P(rb_flags)) {
166
+ flags = rb_funcall(mGrnQueryLoggerFlags, id_parse, 2,
167
+ UINT2NUM(flags), rb_flags);
168
+ }
169
+
170
+ rb_grn_query_logger.flags = flags;
171
+ rb_grn_query_logger.user_data = (void *)rb_logger;
172
+
173
+ context = rb_grn_context_ensure(&rb_context);
174
+ grn_query_logger_set(context, &rb_grn_query_logger);
175
+ rb_grn_context_check(context, rb_logger);
176
+ rb_cv_set(klass, "@@current_logger", rb_logger);
177
+
178
+ return Qnil;
179
+ }
180
+
181
+ static VALUE
182
+ rb_grn_query_logger_s_unregister (VALUE klass)
183
+ {
184
+ VALUE current_logger;
185
+ VALUE rb_context = Qnil;
186
+ grn_ctx *context;
187
+
188
+ current_logger = rb_cv_get(klass, "@@current_logger");
189
+ if (NIL_P(current_logger))
190
+ return Qnil;
191
+
192
+ rb_cv_set(klass, "@@current_logger", Qnil);
193
+
194
+ context = rb_grn_context_ensure(&rb_context);
195
+ grn_query_logger_set(context, NULL);
196
+ rb_grn_context_check(context, klass);
197
+
198
+ return Qnil;
199
+ }
200
+
201
+ /*
202
+ * Sends reopen request to the current query logger. It is useful for
203
+ * rotating log file.
204
+ *
205
+ * @overload reopen
206
+ * @return void
207
+ */
208
+ static VALUE
209
+ rb_grn_query_logger_s_reopen (VALUE klass)
210
+ {
211
+ VALUE rb_context = Qnil;
212
+ grn_ctx *context;
213
+
214
+ context = rb_grn_context_ensure(&rb_context);
215
+ grn_query_logger_reopen(context);
216
+ rb_grn_context_check(context, klass);
217
+
218
+ return Qnil;
219
+ }
220
+
221
+ void
222
+ rb_grn_init_query_logger (VALUE mGrn)
223
+ {
224
+ id_new = rb_intern("new");
225
+ id_parse = rb_intern("parse");
226
+ id_log = rb_intern("log");
227
+ id_reopen = rb_intern("reopen");
228
+ id_fin = rb_intern("fin");
229
+
230
+ rb_grn_query_logger.log = rb_grn_query_logger_log;
231
+ rb_grn_query_logger.reopen = rb_grn_query_logger_reopen;
232
+ rb_grn_query_logger.fin = rb_grn_query_logger_fin;
233
+
234
+ rb_grn_query_logger.user_data = (void *)Qnil;
235
+
236
+ cGrnQueryLogger = rb_define_class_under(mGrn, "QueryLogger", rb_cObject);
237
+
238
+ rb_cv_set(cGrnQueryLogger, "@@current_logger", Qnil);
239
+ rb_define_singleton_method(cGrnQueryLogger, "register",
240
+ rb_grn_query_logger_s_register, -1);
241
+ rb_define_singleton_method(cGrnQueryLogger, "unregister",
242
+ rb_grn_query_logger_s_unregister, 0);
243
+ rb_define_singleton_method(cGrnQueryLogger, "reopen",
244
+ rb_grn_query_logger_s_reopen, 0);
245
+
246
+ mGrnQueryLoggerFlags = rb_define_module_under(cGrnQueryLogger, "Flags");
247
+ #define DEFINE_FLAG(NAME) \
248
+ rb_define_const(mGrnQueryLoggerFlags, \
249
+ #NAME, UINT2NUM(GRN_QUERY_LOG_ ## NAME))
250
+ DEFINE_FLAG(NONE);
251
+ DEFINE_FLAG(COMMAND);
252
+ DEFINE_FLAG(RESULT_CODE);
253
+ DEFINE_FLAG(DESTINATION);
254
+ DEFINE_FLAG(CACHE);
255
+ DEFINE_FLAG(SIZE);
256
+ DEFINE_FLAG(SCORE);
257
+ DEFINE_FLAG(ALL);
258
+ DEFINE_FLAG(DEFAULT);
259
+ #undef DEFINE_FLAG
260
+
261
+ cGrnCallbackQueryLogger =
262
+ rb_define_class_under(mGrn, "CallbackQueryLogger", cGrnQueryLogger);
263
+ }
@@ -111,6 +111,12 @@ rb_grn_snippet_initialize (int argc, VALUE *argv, VALUE self)
111
111
  NULL);
112
112
 
113
113
  context = rb_grn_context_ensure(&rb_context);
114
+ if (!grn_ctx_db(context)) {
115
+ rb_raise(rb_eArgError,
116
+ "Groonga::Context should be associated with a database by "
117
+ "Groonga::Database#open or #create: %s",
118
+ rb_grn_inspect(rb_context));
119
+ }
114
120
 
115
121
  if (RVAL2CBOOL(rb_normalize))
116
122
  flags |= GRN_SNIP_NORMALIZE;
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; c-file-style: "ruby" -*- */
2
2
  /*
3
- Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2012 Kouhei Sutou <kou@clear-code.com>
4
4
 
5
5
  This library is free software; you can redistribute it and/or
6
6
  modify it under the terms of the GNU Lesser General Public
@@ -87,6 +87,101 @@ rb_grn_table_key_support_bind (RbGrnTableKeySupport *rb_grn_table_key_support,
87
87
  grn_obj_open(context, GRN_BULK, 0, rb_grn_object->domain_id);
88
88
  }
89
89
 
90
+ static VALUE
91
+ rb_grn_table_key_support_inspect_content (VALUE self, VALUE inspected)
92
+ {
93
+ RbGrnTableKeySupport *rb_grn_table;
94
+ grn_ctx *context = NULL;
95
+ grn_obj *table;
96
+
97
+ rb_grn_table = SELF(self);
98
+ if (!rb_grn_table)
99
+ return inspected;
100
+
101
+ rb_grn_table_key_support_deconstruct(SELF(self), &table, &context,
102
+ NULL, NULL, NULL,
103
+ NULL, NULL, NULL,
104
+ NULL);
105
+ if (!table)
106
+ return inspected;
107
+ if (!context)
108
+ return inspected;
109
+
110
+ {
111
+ grn_obj value;
112
+ grn_encoding encoding;
113
+
114
+ rb_str_cat2(inspected, ", ");
115
+ rb_str_cat2(inspected, "encoding: <");
116
+ GRN_OBJ_INIT(&value, GRN_BULK, 0, GRN_ID_NIL);
117
+ grn_obj_get_info(context, table, GRN_INFO_ENCODING, &value);
118
+ encoding = *((grn_encoding *)GRN_BULK_HEAD(&value));
119
+ grn_obj_unlink(context, &value);
120
+
121
+ if (context->rc == GRN_SUCCESS) {
122
+ rb_str_concat(inspected, rb_inspect(GRNENCODING2RVAL(encoding)));
123
+ } else {
124
+ rb_str_cat2(inspected, "invalid");
125
+ }
126
+
127
+ rb_str_cat2(inspected, ">");
128
+ }
129
+
130
+ {
131
+ grn_obj *default_tokenizer;
132
+
133
+ rb_str_cat2(inspected, ", ");
134
+ rb_str_cat2(inspected, "default_tokenizer: ");
135
+ default_tokenizer = grn_obj_get_info(context, table,
136
+ GRN_INFO_DEFAULT_TOKENIZER,
137
+ NULL);
138
+ if (default_tokenizer) {
139
+ rb_grn_object_inspect_object_content_name(inspected, context,
140
+ default_tokenizer);
141
+ } else {
142
+ rb_str_cat2(inspected, "(nil)");
143
+ }
144
+ }
145
+
146
+ {
147
+ grn_obj *normalizer;
148
+
149
+ rb_str_cat2(inspected, ", ");
150
+ rb_str_cat2(inspected, "normalizer: ");
151
+ normalizer = grn_obj_get_info(context, table, GRN_INFO_NORMALIZER,
152
+ NULL);
153
+ if (normalizer) {
154
+ rb_grn_object_inspect_object_content_name(inspected, context,
155
+ normalizer);
156
+ } else {
157
+ rb_str_cat2(inspected, "(nil)");
158
+ }
159
+ }
160
+
161
+ return inspected;
162
+ }
163
+
164
+ /*
165
+ * Inspects the table.
166
+ *
167
+ * @overload inspect
168
+ * @return [String] the inspected string.
169
+ */
170
+ static VALUE
171
+ rb_grn_table_key_support_inspect (VALUE self)
172
+ {
173
+ VALUE inspected;
174
+
175
+ inspected = rb_str_new2("");
176
+ rb_grn_object_inspect_header(self, inspected);
177
+ rb_grn_object_inspect_content(self, inspected);
178
+ rb_grn_table_inspect_content(self, inspected);
179
+ rb_grn_table_key_support_inspect_content(self, inspected);
180
+ rb_grn_object_inspect_footer(self, inspected);
181
+
182
+ return inspected;
183
+ }
184
+
90
185
  static grn_id
91
186
  rb_grn_table_key_support_add_raw (VALUE self, VALUE rb_key, int *added)
92
187
  {
@@ -283,16 +378,42 @@ rb_grn_table_key_support_delete_by_key (VALUE self, VALUE rb_key)
283
378
  }
284
379
 
285
380
  /*
286
- * テーブルの _id_ または _key_ に対応するレコードを削除する。
287
- *
288
381
  * @overload delete(id)
382
+ * Delete a record that has ID @id@.
383
+ *
384
+ * @param id [Integer] The ID of delete target record.
385
+ *
386
+ * @return void
387
+ *
289
388
  * @overload delete(key)
389
+ * Delete a record that has key @key@.
390
+ *
391
+ * @param key [Object] The key of delete target record.
392
+ *
393
+ * @return void
394
+ *
395
+ * @overload delete
396
+ * @yield [record]
397
+ * TODO: See #select.
398
+ * @yieldparam [Groonga::RecodExpressionBuilder] record
399
+ * TODO: See #select.
400
+ * @yieldreturn [Groonga::ExpressionBuilder]
401
+ * TODO: See #select.
402
+ *
403
+ * @return void
290
404
  */
291
405
  static VALUE
292
- rb_grn_table_key_support_delete (VALUE self, VALUE rb_id_or_key)
406
+ rb_grn_table_key_support_delete (int argc, VALUE *argv, VALUE self)
293
407
  {
408
+ VALUE rb_id_or_key;
409
+
410
+ if (rb_block_given_p()) {
411
+ return rb_grn_table_delete_by_expression(self);
412
+ }
413
+
414
+ rb_scan_args(argc, argv, "1", &rb_id_or_key);
294
415
  if (FIXNUM_P(rb_id_or_key)) {
295
- return rb_grn_table_delete(self, rb_id_or_key);
416
+ return rb_grn_table_delete_by_id(self, rb_id_or_key);
296
417
  } else {
297
418
  return rb_grn_table_key_support_delete_by_key(self, rb_id_or_key);
298
419
  }
@@ -659,21 +780,83 @@ rb_grn_table_key_support_set_default_tokenizer (VALUE self, VALUE rb_tokenizer)
659
780
  }
660
781
 
661
782
  /*
662
- * キーを正規化する場合は +true+ 、正規化しない場合は +false+ を返
663
- * す。
783
+ * Returns the normalizer that is used by {Groonga::IndexColumn}.
664
784
  *
665
- * @overload normalize_key?
785
+ * @overload normalizer
786
+ * @return [nil, Groonga::Procedure]
666
787
  */
667
788
  static VALUE
668
- rb_grn_table_key_normalize_key_p (VALUE self)
789
+ rb_grn_table_key_support_get_normalizer (VALUE self)
669
790
  {
791
+ grn_ctx *context = NULL;
670
792
  grn_obj *table;
793
+ grn_obj *normalizer = NULL;
671
794
 
672
- rb_grn_table_key_support_deconstruct(SELF(self), &table, NULL,
795
+ rb_grn_table_key_support_deconstruct(SELF(self), &table, &context,
796
+ NULL, NULL, NULL,
797
+ NULL, NULL, NULL,
798
+ NULL);
799
+
800
+ normalizer = grn_obj_get_info(context, table, GRN_INFO_NORMALIZER, NULL);
801
+ rb_grn_context_check(context, self);
802
+
803
+ return GRNOBJECT2RVAL(Qnil, context, normalizer, GRN_FALSE);
804
+ }
805
+
806
+ /*
807
+ * Specifies the normalizer used by {Groonga::IndexColumn}.
808
+ *
809
+ * @example
810
+ * # Uses NFKC normalizer.
811
+ * table.normalizer = "NormalizerNFKC51"
812
+ * # Specifies normalizer object.
813
+ * table.normalizer = Groonga::Context["NormalizerNFKC51"]
814
+ * # Uses auto normalizer that is a normalizer for backward compatibility.
815
+ * table.normalizer = "TNormalizerAuto"
816
+ *
817
+ * @overload normalizer=(name)
818
+ * @param [String] name Set a nomalizer named @name@.
819
+ *
820
+ * @overload normalizer=(normalizer)
821
+ * @param [Groonga::Procedure] normalizer Set the normalizer object.
822
+ *
823
+ * @overload normalizer=(normalizer)
824
+ * @param [nil] normalizer Unset normalizer.
825
+ */
826
+ static VALUE
827
+ rb_grn_table_key_support_set_normalizer (VALUE self, VALUE rb_normalizer)
828
+ {
829
+ grn_ctx *context;
830
+ grn_obj *table;
831
+ grn_obj *normalizer;
832
+ grn_rc rc;
833
+
834
+ rb_grn_table_key_support_deconstruct(SELF(self), &table, &context,
673
835
  NULL, NULL, NULL,
674
836
  NULL, NULL, NULL,
675
837
  NULL);
676
- return CBOOL2RVAL(table->header.flags & GRN_OBJ_KEY_NORMALIZE);
838
+
839
+ normalizer = RVAL2GRNOBJECT(rb_normalizer, &context);
840
+ rc = grn_obj_set_info(context, table, GRN_INFO_NORMALIZER, normalizer);
841
+ rb_grn_context_check(context, self);
842
+ rb_grn_rc_check(rc, self);
843
+
844
+ return Qnil;
845
+ }
846
+
847
+ /*
848
+ * キーを正規化する場合は +true+ 、正規化しない場合は +false+ を返
849
+ * す。
850
+ *
851
+ * @overload normalize_key?
852
+ */
853
+ static VALUE
854
+ rb_grn_table_key_support_normalize_key_p (VALUE self)
855
+ {
856
+ VALUE normalizer;
857
+
858
+ normalizer = rb_grn_table_key_support_get_normalizer(self);
859
+ return CBOOL2RVAL(!NIL_P(normalizer));
677
860
  }
678
861
 
679
862
  /*
@@ -700,6 +883,9 @@ rb_grn_init_table_key_support (VALUE mGrn)
700
883
  rb_mGrnTableKeySupport = rb_define_module_under(rb_cGrnTable, "KeySupport");
701
884
  rb_include_module(rb_mGrnTableKeySupport, rb_mGrnEncodingSupport);
702
885
 
886
+ rb_define_method(rb_mGrnTableKeySupport, "inspect",
887
+ rb_grn_table_key_support_inspect, 0);
888
+
703
889
  rb_define_method(rb_mGrnTableKeySupport, "add",
704
890
  rb_grn_table_key_support_add, -1);
705
891
  rb_define_method(rb_mGrnTableKeySupport, "id",
@@ -710,7 +896,7 @@ rb_grn_init_table_key_support (VALUE mGrn)
710
896
  rb_grn_table_key_support_has_key, 1);
711
897
 
712
898
  rb_define_method(rb_mGrnTableKeySupport, "delete",
713
- rb_grn_table_key_support_delete, 1);
899
+ rb_grn_table_key_support_delete, -1);
714
900
 
715
901
  rb_define_method(rb_mGrnTableKeySupport, "[]",
716
902
  rb_grn_table_key_support_array_reference, 1);
@@ -732,8 +918,13 @@ rb_grn_init_table_key_support (VALUE mGrn)
732
918
  rb_define_method(rb_mGrnTableKeySupport, "default_tokenizer=",
733
919
  rb_grn_table_key_support_set_default_tokenizer, 1);
734
920
 
921
+ rb_define_method(rb_mGrnTableKeySupport, "normalizer",
922
+ rb_grn_table_key_support_get_normalizer, 0);
923
+ rb_define_method(rb_mGrnTableKeySupport, "normalizer=",
924
+ rb_grn_table_key_support_set_normalizer, 1);
925
+
735
926
  rb_define_method(rb_mGrnTableKeySupport, "normalize_key?",
736
- rb_grn_table_key_normalize_key_p, 0);
927
+ rb_grn_table_key_support_normalize_key_p, 0);
737
928
 
738
929
  rb_define_method(rb_mGrnTableKeySupport, "support_key?",
739
930
  rb_grn_table_key_support_support_key_p, 0);