rroonga 1.0.1-x86-mingw32 → 1.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 (387) hide show
  1. data/NEWS.ja.rdoc +146 -0
  2. data/NEWS.rdoc +146 -0
  3. data/README.ja.rdoc +7 -5
  4. data/README.rdoc +6 -5
  5. data/Rakefile +170 -18
  6. data/benchmark/create-wikipedia-database.rb +212 -0
  7. data/benchmark/read-write-many-small-items.rb +0 -0
  8. data/benchmark/repeat-load.rb +213 -0
  9. data/benchmark/select.rb +1052 -0
  10. data/benchmark/write-many-small-items.rb +0 -0
  11. data/example/bookmark.rb +94 -91
  12. data/example/index-html.rb +0 -0
  13. data/ext/groonga/extconf.rb +6 -6
  14. data/ext/groonga/rb-grn-accessor.c +1 -1
  15. data/ext/groonga/rb-grn-array.c +1 -1
  16. data/ext/groonga/rb-grn-column.c +201 -10
  17. data/ext/groonga/rb-grn-context.c +119 -20
  18. data/ext/groonga/rb-grn-database.c +27 -4
  19. data/ext/groonga/rb-grn-exception.c +15 -0
  20. data/ext/groonga/rb-grn-expression.c +14 -10
  21. data/ext/groonga/rb-grn-hash.c +4 -4
  22. data/ext/groonga/rb-grn-index-column.c +10 -6
  23. data/ext/groonga/rb-grn-logger.c +2 -2
  24. data/ext/groonga/rb-grn-object.c +33 -29
  25. data/ext/groonga/{rb-grn-operation.c → rb-grn-operator.c} +89 -87
  26. data/ext/groonga/rb-grn-patricia-trie.c +12 -12
  27. data/ext/groonga/rb-grn-plugin.c +134 -0
  28. data/ext/groonga/rb-grn-procedure.c +1 -1
  29. data/ext/groonga/rb-grn-query.c +7 -7
  30. data/ext/groonga/rb-grn-snippet.c +4 -3
  31. data/ext/groonga/rb-grn-table-cursor.c +1 -1
  32. data/ext/groonga/rb-grn-table-key-support.c +27 -24
  33. data/ext/groonga/rb-grn-table.c +119 -58
  34. data/ext/groonga/rb-grn-type.c +1 -1
  35. data/ext/groonga/rb-grn-utils.c +20 -19
  36. data/ext/groonga/rb-grn-variable.c +1 -1
  37. data/ext/groonga/rb-grn-view-accessor.c +1 -1
  38. data/ext/groonga/rb-grn-view.c +1 -1
  39. data/ext/groonga/rb-grn.h +26 -20
  40. data/ext/groonga/rb-groonga.c +6 -4
  41. data/extconf.rb +10 -4
  42. data/html/developer.html +8 -2
  43. data/html/favicon.ico +0 -0
  44. data/html/favicon.svg +591 -0
  45. data/html/index.html +78 -12
  46. data/html/logo.svg +612 -0
  47. data/html/ranguba.css +92 -7
  48. data/html/readme.svg +256 -0
  49. data/lib/groonga.so +0 -0
  50. data/lib/groonga/context.rb +52 -1
  51. data/lib/groonga/expression-builder.rb +42 -6
  52. data/lib/groonga/record.rb +84 -15
  53. data/lib/groonga/schema.rb +524 -122
  54. data/pkg/rroonga-1.1.0-x86-mingw32/NEWS.ja.rdoc +326 -0
  55. data/pkg/rroonga-1.1.0-x86-mingw32/NEWS.rdoc +328 -0
  56. data/pkg/rroonga-1.1.0-x86-mingw32/README.ja.rdoc +68 -0
  57. data/pkg/rroonga-1.1.0-x86-mingw32/README.rdoc +68 -0
  58. data/pkg/rroonga-1.1.0-x86-mingw32/text/expression.rdoc +285 -0
  59. data/{text/TUTORIAL.ja.rdoc → pkg/rroonga-1.1.0-x86-mingw32/text/tutorial.ja.rdoc} +165 -126
  60. data/pkg/rroonga-1.1.0/NEWS.ja.rdoc +326 -0
  61. data/pkg/rroonga-1.1.0/NEWS.rdoc +328 -0
  62. data/pkg/rroonga-1.1.0/README.ja.rdoc +68 -0
  63. data/pkg/rroonga-1.1.0/README.rdoc +68 -0
  64. data/pkg/rroonga-1.1.0/text/expression.rdoc +285 -0
  65. data/pkg/rroonga-1.1.0/text/tutorial.ja.rdoc +433 -0
  66. data/rroonga-build.rb +3 -3
  67. data/test/run-test.rb +1 -1
  68. data/test/test-array.rb +4 -0
  69. data/test/test-column.rb +31 -1
  70. data/test/test-context-select.rb +45 -14
  71. data/test/test-context.rb +44 -0
  72. data/test/test-database.rb +21 -1
  73. data/test/test-expression-builder.rb +46 -5
  74. data/test/test-fix-size-column.rb +12 -0
  75. data/test/test-hash.rb +10 -4
  76. data/test/test-index-column.rb +33 -0
  77. data/test/test-patricia-trie.rb +6 -0
  78. data/test/test-plugin.rb +29 -0
  79. data/test/test-record.rb +84 -1
  80. data/test/test-remote.rb +3 -2
  81. data/test/test-schema-create-table.rb +32 -2
  82. data/test/test-schema-type.rb +167 -0
  83. data/test/test-schema.rb +159 -12
  84. data/test/test-table-select-weight.rb +20 -1
  85. data/test/test-table-select.rb +12 -0
  86. data/test/test-table.rb +65 -0
  87. data/test/test-variable-size-column.rb +12 -0
  88. data/text/tutorial.ja.rdoc +433 -0
  89. data/vendor/local/bin/grntest.exe +0 -0
  90. data/vendor/local/bin/groonga.exe +0 -0
  91. data/vendor/local/bin/libgroonga-0.dll +0 -0
  92. data/vendor/local/etc/groonga/init.d/redhat/groonga +1 -9
  93. data/vendor/local/include/groonga/groonga.h +156 -6
  94. data/vendor/local/include/groonga/groonga/plugin.h +44 -0
  95. data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
  96. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
  97. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
  98. data/vendor/local/lib/groonga/{modules → plugins}/suggest/suggest.la +2 -2
  99. data/vendor/local/lib/libgroonga.a +0 -0
  100. data/vendor/local/lib/libgroonga.dll.a +0 -0
  101. data/vendor/local/lib/libgroonga.la +1 -1
  102. data/vendor/local/lib/pkgconfig/groonga.pc +3 -2
  103. data/vendor/local/share/groonga/examples/dictionary/edict/edict_import.sh +14 -3
  104. data/vendor/local/share/groonga/examples/dictionary/eijiro/eijiro_import.sh +3 -1
  105. data/vendor/local/share/groonga/examples/dictionary/gene95/gene_import.sh +19 -3
  106. data/vendor/local/share/groonga/munin/plugins/groonga_cpu_load +0 -0
  107. data/vendor/local/share/groonga/munin/plugins/groonga_cpu_time +0 -0
  108. data/vendor/local/share/groonga/munin/plugins/groonga_disk +0 -0
  109. data/vendor/local/share/groonga/munin/plugins/groonga_memory +0 -0
  110. data/vendor/local/share/groonga/munin/plugins/groonga_n_records +0 -0
  111. data/vendor/local/share/groonga/munin/plugins/groonga_query_performance +0 -0
  112. data/vendor/local/share/groonga/munin/plugins/groonga_status +0 -0
  113. metadata +91 -341
  114. data/html/favicon.xcf +0 -0
  115. data/html/logo.xcf +0 -0
  116. data/lib/1.8/groonga.so +0 -0
  117. data/lib/1.9/groonga.so +0 -0
  118. data/license/GPL +0 -340
  119. data/license/RUBY +0 -59
  120. data/vendor/local/lib/groonga/modules/suggest/suggest.a +0 -0
  121. data/vendor/local/lib/groonga/modules/suggest/suggest.dll +0 -0
  122. data/vendor/local/lib/groonga/modules/suggest/suggest.dll.a +0 -0
  123. data/vendor/local/share/groonga/doc/ja/html/.buildinfo +0 -4
  124. data/vendor/local/share/groonga/doc/ja/html/_sources/characteristic.txt +0 -56
  125. data/vendor/local/share/groonga/doc/ja/html/_sources/commands.txt +0 -10
  126. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/cache_limit.txt +0 -52
  127. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/check.txt +0 -164
  128. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/clearlock.txt +0 -61
  129. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_create.txt +0 -93
  130. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_list.txt +0 -97
  131. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_remove.txt +0 -58
  132. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/define_selector.txt +0 -114
  133. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/defrag.txt +0 -57
  134. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/delete.txt +0 -68
  135. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/dump.txt +0 -62
  136. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/load.txt +0 -98
  137. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_level.txt +0 -65
  138. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_put.txt +0 -69
  139. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_reopen.txt +0 -66
  140. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/quit.txt +0 -38
  141. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/select.txt +0 -247
  142. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/shutdown.txt +0 -38
  143. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/status.txt +0 -59
  144. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/suggest.txt +0 -79
  145. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_create.txt +0 -111
  146. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_list.txt +0 -87
  147. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_remove.txt +0 -50
  148. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/view_add.txt +0 -53
  149. data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/add.txt +0 -102
  150. data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/get.txt +0 -78
  151. data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/set.txt +0 -103
  152. data/vendor/local/share/groonga/doc/ja/html/_sources/developer.txt +0 -10
  153. data/vendor/local/share/groonga/doc/ja/html/_sources/developer/com.txt +0 -18
  154. data/vendor/local/share/groonga/doc/ja/html/_sources/developer/document.txt +0 -38
  155. data/vendor/local/share/groonga/doc/ja/html/_sources/developer/query.txt +0 -212
  156. data/vendor/local/share/groonga/doc/ja/html/_sources/developer/test.txt +0 -114
  157. data/vendor/local/share/groonga/doc/ja/html/_sources/execfile.txt +0 -226
  158. data/vendor/local/share/groonga/doc/ja/html/_sources/expr.txt +0 -43
  159. data/vendor/local/share/groonga/doc/ja/html/_sources/functions.txt +0 -10
  160. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/edit_distance.txt +0 -48
  161. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_distance.txt +0 -51
  162. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_in_circle.txt +0 -54
  163. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_in_rectangle.txt +0 -55
  164. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/now.txt +0 -34
  165. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/rand.txt +0 -41
  166. data/vendor/local/share/groonga/doc/ja/html/_sources/grnslap.txt +0 -64
  167. data/vendor/local/share/groonga/doc/ja/html/_sources/grntest.txt +0 -259
  168. data/vendor/local/share/groonga/doc/ja/html/_sources/http.txt +0 -52
  169. data/vendor/local/share/groonga/doc/ja/html/_sources/index.txt +0 -21
  170. data/vendor/local/share/groonga/doc/ja/html/_sources/install.txt +0 -114
  171. data/vendor/local/share/groonga/doc/ja/html/_sources/news.txt +0 -199
  172. data/vendor/local/share/groonga/doc/ja/html/_sources/process.txt +0 -12
  173. data/vendor/local/share/groonga/doc/ja/html/_sources/pseudo_column.txt +0 -38
  174. data/vendor/local/share/groonga/doc/ja/html/_sources/reference.txt +0 -14
  175. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial.txt +0 -10
  176. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial01.txt +0 -293
  177. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial02.txt +0 -100
  178. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial03.txt +0 -72
  179. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial04.txt +0 -111
  180. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial05.txt +0 -65
  181. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial06.txt +0 -91
  182. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial07.txt +0 -92
  183. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial08.txt +0 -53
  184. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial09.txt +0 -9
  185. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial10.txt +0 -486
  186. data/vendor/local/share/groonga/doc/ja/html/_sources/type.txt +0 -118
  187. data/vendor/local/share/groonga/doc/ja/html/_static/basic.css +0 -509
  188. data/vendor/local/share/groonga/doc/ja/html/_static/default.css +0 -277
  189. data/vendor/local/share/groonga/doc/ja/html/_static/doctools.js +0 -247
  190. data/vendor/local/share/groonga/doc/ja/html/_static/file.png +0 -0
  191. data/vendor/local/share/groonga/doc/ja/html/_static/jquery.js +0 -6240
  192. data/vendor/local/share/groonga/doc/ja/html/_static/minus.png +0 -0
  193. data/vendor/local/share/groonga/doc/ja/html/_static/plus.png +0 -0
  194. data/vendor/local/share/groonga/doc/ja/html/_static/pygments.css +0 -61
  195. data/vendor/local/share/groonga/doc/ja/html/_static/searchtools.js +0 -518
  196. data/vendor/local/share/groonga/doc/ja/html/_static/sidebar.js +0 -147
  197. data/vendor/local/share/groonga/doc/ja/html/_static/underscore.js +0 -16
  198. data/vendor/local/share/groonga/doc/ja/html/characteristic.html +0 -162
  199. data/vendor/local/share/groonga/doc/ja/html/commands.html +0 -139
  200. data/vendor/local/share/groonga/doc/ja/html/commands/cache_limit.html +0 -173
  201. data/vendor/local/share/groonga/doc/ja/html/commands/check.html +0 -285
  202. data/vendor/local/share/groonga/doc/ja/html/commands/clearlock.html +0 -180
  203. data/vendor/local/share/groonga/doc/ja/html/commands/column_create.html +0 -210
  204. data/vendor/local/share/groonga/doc/ja/html/commands/column_list.html +0 -220
  205. data/vendor/local/share/groonga/doc/ja/html/commands/column_remove.html +0 -183
  206. data/vendor/local/share/groonga/doc/ja/html/commands/define_selector.html +0 -221
  207. data/vendor/local/share/groonga/doc/ja/html/commands/defrag.html +0 -177
  208. data/vendor/local/share/groonga/doc/ja/html/commands/delete.html +0 -182
  209. data/vendor/local/share/groonga/doc/ja/html/commands/dump.html +0 -177
  210. data/vendor/local/share/groonga/doc/ja/html/commands/load.html +0 -208
  211. data/vendor/local/share/groonga/doc/ja/html/commands/log_level.html +0 -187
  212. data/vendor/local/share/groonga/doc/ja/html/commands/log_put.html +0 -190
  213. data/vendor/local/share/groonga/doc/ja/html/commands/log_reopen.html +0 -188
  214. data/vendor/local/share/groonga/doc/ja/html/commands/quit.html +0 -156
  215. data/vendor/local/share/groonga/doc/ja/html/commands/select.html +0 -331
  216. data/vendor/local/share/groonga/doc/ja/html/commands/shutdown.html +0 -156
  217. data/vendor/local/share/groonga/doc/ja/html/commands/status.html +0 -179
  218. data/vendor/local/share/groonga/doc/ja/html/commands/suggest.html +0 -191
  219. data/vendor/local/share/groonga/doc/ja/html/commands/table_create.html +0 -222
  220. data/vendor/local/share/groonga/doc/ja/html/commands/table_list.html +0 -202
  221. data/vendor/local/share/groonga/doc/ja/html/commands/table_remove.html +0 -173
  222. data/vendor/local/share/groonga/doc/ja/html/commands/view_add.html +0 -175
  223. data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/add.html +0 -180
  224. data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/get.html +0 -161
  225. data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/set.html +0 -182
  226. data/vendor/local/share/groonga/doc/ja/html/developer.html +0 -118
  227. data/vendor/local/share/groonga/doc/ja/html/developer/com.html +0 -136
  228. data/vendor/local/share/groonga/doc/ja/html/developer/document.html +0 -159
  229. data/vendor/local/share/groonga/doc/ja/html/developer/query.html +0 -336
  230. data/vendor/local/share/groonga/doc/ja/html/developer/test.html +0 -220
  231. data/vendor/local/share/groonga/doc/ja/html/execfile.html +0 -370
  232. data/vendor/local/share/groonga/doc/ja/html/expr.html +0 -157
  233. data/vendor/local/share/groonga/doc/ja/html/functions.html +0 -122
  234. data/vendor/local/share/groonga/doc/ja/html/functions/edit_distance.html +0 -162
  235. data/vendor/local/share/groonga/doc/ja/html/functions/geo_distance.html +0 -170
  236. data/vendor/local/share/groonga/doc/ja/html/functions/geo_in_circle.html +0 -173
  237. data/vendor/local/share/groonga/doc/ja/html/functions/geo_in_rectangle.html +0 -172
  238. data/vendor/local/share/groonga/doc/ja/html/functions/now.html +0 -152
  239. data/vendor/local/share/groonga/doc/ja/html/functions/rand.html +0 -159
  240. data/vendor/local/share/groonga/doc/ja/html/genindex.html +0 -227
  241. data/vendor/local/share/groonga/doc/ja/html/grnslap.html +0 -183
  242. data/vendor/local/share/groonga/doc/ja/html/grntest.html +0 -368
  243. data/vendor/local/share/groonga/doc/ja/html/http.html +0 -163
  244. data/vendor/local/share/groonga/doc/ja/html/index.html +0 -291
  245. data/vendor/local/share/groonga/doc/ja/html/install.html +0 -228
  246. data/vendor/local/share/groonga/doc/ja/html/news.html +0 -310
  247. data/vendor/local/share/groonga/doc/ja/html/objects.inv +0 -0
  248. data/vendor/local/share/groonga/doc/ja/html/process.html +0 -120
  249. data/vendor/local/share/groonga/doc/ja/html/pseudo_column.html +0 -147
  250. data/vendor/local/share/groonga/doc/ja/html/reference.html +0 -174
  251. data/vendor/local/share/groonga/doc/ja/html/search.html +0 -96
  252. data/vendor/local/share/groonga/doc/ja/html/searchindex.js +0 -1
  253. data/vendor/local/share/groonga/doc/ja/html/tutorial.html +0 -172
  254. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial01.html +0 -388
  255. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial02.html +0 -214
  256. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial03.html +0 -183
  257. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial04.html +0 -212
  258. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial05.html +0 -169
  259. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial06.html +0 -209
  260. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial07.html +0 -212
  261. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial08.html +0 -139
  262. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial09.html +0 -114
  263. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial10.html +0 -458
  264. data/vendor/local/share/groonga/doc/ja/html/type.html +0 -217
  265. data/vendor/local/share/groonga/doc/ja/source/__init__.py +0 -0
  266. data/vendor/local/share/groonga/doc/ja/source/characteristic.txt +0 -56
  267. data/vendor/local/share/groonga/doc/ja/source/commands.txt +0 -10
  268. data/vendor/local/share/groonga/doc/ja/source/commands/cache_limit.txt +0 -52
  269. data/vendor/local/share/groonga/doc/ja/source/commands/check.txt +0 -164
  270. data/vendor/local/share/groonga/doc/ja/source/commands/clearlock.txt +0 -61
  271. data/vendor/local/share/groonga/doc/ja/source/commands/column_create.txt +0 -93
  272. data/vendor/local/share/groonga/doc/ja/source/commands/column_list.txt +0 -97
  273. data/vendor/local/share/groonga/doc/ja/source/commands/column_remove.txt +0 -58
  274. data/vendor/local/share/groonga/doc/ja/source/commands/define_selector.txt +0 -114
  275. data/vendor/local/share/groonga/doc/ja/source/commands/defrag.txt +0 -57
  276. data/vendor/local/share/groonga/doc/ja/source/commands/delete.txt +0 -68
  277. data/vendor/local/share/groonga/doc/ja/source/commands/dump.txt +0 -62
  278. data/vendor/local/share/groonga/doc/ja/source/commands/load.txt +0 -98
  279. data/vendor/local/share/groonga/doc/ja/source/commands/log_level.txt +0 -65
  280. data/vendor/local/share/groonga/doc/ja/source/commands/log_put.txt +0 -69
  281. data/vendor/local/share/groonga/doc/ja/source/commands/log_reopen.txt +0 -66
  282. data/vendor/local/share/groonga/doc/ja/source/commands/quit.txt +0 -38
  283. data/vendor/local/share/groonga/doc/ja/source/commands/select.txt +0 -247
  284. data/vendor/local/share/groonga/doc/ja/source/commands/shutdown.txt +0 -38
  285. data/vendor/local/share/groonga/doc/ja/source/commands/status.txt +0 -59
  286. data/vendor/local/share/groonga/doc/ja/source/commands/table_create.txt +0 -111
  287. data/vendor/local/share/groonga/doc/ja/source/commands/table_list.txt +0 -87
  288. data/vendor/local/share/groonga/doc/ja/source/commands/table_remove.txt +0 -50
  289. data/vendor/local/share/groonga/doc/ja/source/commands/view_add.txt +0 -53
  290. data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/add.txt +0 -102
  291. data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/get.txt +0 -78
  292. data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/set.txt +0 -103
  293. data/vendor/local/share/groonga/doc/ja/source/conf.py +0 -265
  294. data/vendor/local/share/groonga/doc/ja/source/developer.txt +0 -10
  295. data/vendor/local/share/groonga/doc/ja/source/developer/com.txt +0 -18
  296. data/vendor/local/share/groonga/doc/ja/source/developer/document.txt +0 -38
  297. data/vendor/local/share/groonga/doc/ja/source/developer/query.txt +0 -212
  298. data/vendor/local/share/groonga/doc/ja/source/developer/test.txt +0 -114
  299. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-1.log +0 -6
  300. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-10.log +0 -5
  301. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-11.log +0 -5
  302. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-12.log +0 -5
  303. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-13.log +0 -5
  304. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-14.log +0 -9
  305. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-15.log +0 -5
  306. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-16.log +0 -5
  307. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-17.log +0 -5
  308. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-2.log +0 -5
  309. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-3.log +0 -5
  310. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-4.log +0 -7
  311. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-5.log +0 -5
  312. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-6.log +0 -5
  313. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-7.log +0 -16
  314. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-8.log +0 -5
  315. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-9.log +0 -5
  316. data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-1.log +0 -8
  317. data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-2.log +0 -6
  318. data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-3.log +0 -12
  319. data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-1.log +0 -18
  320. data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-2.log +0 -10
  321. data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-3.log +0 -10
  322. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-1.log +0 -5
  323. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-2.log +0 -7
  324. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-3.log +0 -7
  325. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-4.log +0 -13
  326. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-5.log +0 -5
  327. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-6.log +0 -5
  328. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-7.log +0 -5
  329. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-1.log +0 -24
  330. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-2.log +0 -5
  331. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-3.log +0 -5
  332. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-4.log +0 -5
  333. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-5.log +0 -5
  334. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-6.log +0 -5
  335. data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-1.log +0 -25
  336. data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-2.log +0 -9
  337. data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-3.log +0 -21
  338. data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-4.log +0 -7
  339. data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-5.log +0 -5
  340. data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-1.log +0 -22
  341. data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-2.log +0 -9
  342. data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-3.log +0 -20
  343. data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-4.log +0 -9
  344. data/vendor/local/share/groonga/doc/ja/source/example/tutorial08-1.log +0 -14
  345. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-1.log +0 -5
  346. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-10.log +0 -5
  347. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-2.log +0 -5
  348. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-3.log +0 -5
  349. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-4.log +0 -5
  350. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-5.log +0 -5
  351. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-6.log +0 -5
  352. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-7.log +0 -5
  353. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-8.log +0 -5
  354. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-9.log +0 -5
  355. data/vendor/local/share/groonga/doc/ja/source/execfile.txt +0 -226
  356. data/vendor/local/share/groonga/doc/ja/source/expr.txt +0 -43
  357. data/vendor/local/share/groonga/doc/ja/source/functions.txt +0 -10
  358. data/vendor/local/share/groonga/doc/ja/source/functions/edit_distance.txt +0 -48
  359. data/vendor/local/share/groonga/doc/ja/source/functions/geo_distance.txt +0 -51
  360. data/vendor/local/share/groonga/doc/ja/source/functions/geo_in_circle.txt +0 -54
  361. data/vendor/local/share/groonga/doc/ja/source/functions/geo_in_rectangle.txt +0 -55
  362. data/vendor/local/share/groonga/doc/ja/source/functions/now.txt +0 -34
  363. data/vendor/local/share/groonga/doc/ja/source/functions/rand.txt +0 -41
  364. data/vendor/local/share/groonga/doc/ja/source/grnslap.txt +0 -64
  365. data/vendor/local/share/groonga/doc/ja/source/grntest.txt +0 -259
  366. data/vendor/local/share/groonga/doc/ja/source/http.txt +0 -52
  367. data/vendor/local/share/groonga/doc/ja/source/index.txt +0 -21
  368. data/vendor/local/share/groonga/doc/ja/source/install.txt +0 -114
  369. data/vendor/local/share/groonga/doc/ja/source/news.txt +0 -199
  370. data/vendor/local/share/groonga/doc/ja/source/process.txt +0 -12
  371. data/vendor/local/share/groonga/doc/ja/source/pseudo_column.txt +0 -38
  372. data/vendor/local/share/groonga/doc/ja/source/rdoc.py +0 -762
  373. data/vendor/local/share/groonga/doc/ja/source/reference.txt +0 -14
  374. data/vendor/local/share/groonga/doc/ja/source/tutorial.txt +0 -10
  375. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial01.txt +0 -293
  376. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial02.txt +0 -100
  377. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial03.txt +0 -72
  378. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial04.txt +0 -111
  379. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial05.txt +0 -65
  380. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial06.txt +0 -91
  381. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial07.txt +0 -92
  382. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial08.txt +0 -53
  383. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial09.txt +0 -9
  384. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial10.txt +0 -486
  385. data/vendor/local/share/groonga/doc/ja/source/type.txt +0 -118
  386. data/vendor/local/share/groonga/doc/ja/source/update_execution_example.py +0 -113
  387. data/vendor/local/share/man/man1/groonga.1 +0 -5498
@@ -56,19 +56,27 @@ rb_grn_context_from_ruby_object (VALUE object)
56
56
  return rb_grn_context->context;
57
57
  }
58
58
 
59
- void
60
- rb_grn_context_fin (grn_ctx *context)
59
+ static void
60
+ rb_grn_context_unlink_database (grn_ctx *context)
61
61
  {
62
62
  grn_obj *database;
63
63
 
64
- if (context->stat == GRN_CTX_FIN)
65
- return;
66
-
67
64
  database = grn_ctx_db(context);
68
65
  debug("context:database: %p:%p\n", context, database);
69
66
  if (database && database->header.type == GRN_DB) {
67
+ debug("context:database: %p:%p: unlink\n", context, database);
70
68
  grn_obj_unlink(context, database);
71
69
  }
70
+ debug("context:database: %p:%p: done\n", context, database);
71
+ }
72
+
73
+ void
74
+ rb_grn_context_fin (grn_ctx *context)
75
+ {
76
+ if (context->stat == GRN_CTX_FIN)
77
+ return;
78
+
79
+ rb_grn_context_unlink_database(context);
72
80
  grn_ctx_fin(context);
73
81
  }
74
82
 
@@ -92,6 +100,33 @@ rb_grn_context_alloc (VALUE klass)
92
100
  return Data_Wrap_Struct(klass, NULL, rb_grn_context_free, NULL);
93
101
  }
94
102
 
103
+ static grn_obj *
104
+ rb_grn_context_finalizer (grn_ctx *context, int n_args, grn_obj **grn_objects,
105
+ grn_user_data *user_data)
106
+ {
107
+ RbGrnContext *rb_grn_context;
108
+
109
+ if (rb_grn_exited)
110
+ return NULL;
111
+
112
+ rb_grn_context = user_data->ptr;
113
+
114
+ GRN_CTX_USER_DATA(context)->ptr = NULL;
115
+ grn_ctx_set_finalizer(context, NULL);
116
+
117
+ debug("context-finalize: %p:%p:%p\n",
118
+ context, rb_grn_context, rb_grn_context->context);
119
+
120
+ rb_grn_context->context = NULL;
121
+
122
+ rb_grn_context_unlink_database(context);
123
+
124
+ debug("context-finalize: %p:%p:%p: done\n",
125
+ context, rb_grn_context, rb_grn_context->context);
126
+
127
+ return NULL;
128
+ }
129
+
95
130
  VALUE
96
131
  rb_grn_context_to_exception (grn_ctx *context, VALUE related_object)
97
132
  {
@@ -301,6 +336,7 @@ rb_grn_context_initialize (int argc, VALUE *argv, VALUE self)
301
336
  rb_grn_context_check(context, self);
302
337
 
303
338
  GRN_CTX_USER_DATA(context)->ptr = rb_grn_context;
339
+ grn_ctx_set_finalizer(context, rb_grn_context_finalizer);
304
340
 
305
341
  if (!NIL_P(rb_encoding)) {
306
342
  grn_encoding encoding;
@@ -334,15 +370,21 @@ rb_grn_context_inspect (VALUE self)
334
370
  rb_str_concat(inspected, rb_inspect(rb_obj_class(self)));
335
371
  rb_str_cat2(inspected, " ");
336
372
 
337
- rb_str_cat2(inspected, "encoding: <");
338
- rb_str_concat(inspected, rb_inspect(GRNENCODING2RVAL(context->encoding)));
339
- rb_str_cat2(inspected, ">, ");
340
-
341
- rb_str_cat2(inspected, "database: <");
342
- database = grn_ctx_db(context);
343
- rb_database = GRNDB2RVAL(context, database, RB_GRN_FALSE);
344
- rb_str_concat(inspected, rb_inspect(rb_database));
345
- rb_str_cat2(inspected, ">");
373
+ if (rb_grn_exited) {
374
+ rb_str_cat2(inspected, "(finished)");
375
+ } else if (context) {
376
+ rb_str_cat2(inspected, "encoding: <");
377
+ rb_str_concat(inspected, rb_inspect(GRNENCODING2RVAL(context->encoding)));
378
+ rb_str_cat2(inspected, ">, ");
379
+
380
+ rb_str_cat2(inspected, "database: <");
381
+ database = grn_ctx_db(context);
382
+ rb_database = GRNDB2RVAL(context, database, GRN_FALSE);
383
+ rb_str_concat(inspected, rb_inspect(rb_database));
384
+ rb_str_cat2(inspected, ">");
385
+ } else {
386
+ rb_str_cat2(inspected, "(closed)");
387
+ }
346
388
 
347
389
  rb_str_cat2(inspected, ">");
348
390
  return inspected;
@@ -380,6 +422,52 @@ rb_grn_context_set_encoding (VALUE self, VALUE rb_encoding)
380
422
  return rb_encoding;
381
423
  }
382
424
 
425
+ /*
426
+ * call-seq:
427
+ * context.support_zlib?
428
+ *
429
+ * groongaがZlibサポート付きでビルドされていれば+true+、そう
430
+ * でなければ+false+を返す。
431
+ */
432
+ static VALUE
433
+ rb_grn_context_support_zlib_p (VALUE self)
434
+ {
435
+ VALUE rb_support_p;
436
+ grn_ctx *context;
437
+ grn_obj support_p;
438
+
439
+ context = SELF(self);
440
+ GRN_BOOL_INIT(&support_p, 0);
441
+ grn_obj_get_info(context, NULL, GRN_INFO_SUPPORT_ZLIB, &support_p);
442
+ rb_support_p = CBOOL2RVAL(GRN_BOOL_VALUE(&support_p));
443
+ GRN_OBJ_FIN(context, &support_p);
444
+
445
+ return rb_support_p;
446
+ }
447
+
448
+ /*
449
+ * call-seq:
450
+ * context.support_lzo?
451
+ *
452
+ * groongaがLZOサポート付きでビルドされていれば+true+、そう
453
+ * でなければ+false+を返す。
454
+ */
455
+ static VALUE
456
+ rb_grn_context_support_lzo_p (VALUE self)
457
+ {
458
+ VALUE rb_support_p;
459
+ grn_ctx *context;
460
+ grn_obj support_p;
461
+
462
+ context = SELF(self);
463
+ GRN_BOOL_INIT(&support_p, 0);
464
+ grn_obj_get_info(context, NULL, GRN_INFO_SUPPORT_LZO, &support_p);
465
+ rb_support_p = CBOOL2RVAL(GRN_BOOL_VALUE(&support_p));
466
+ GRN_OBJ_FIN(context, &support_p);
467
+
468
+ return rb_support_p;
469
+ }
470
+
383
471
  /*
384
472
  * call-seq:
385
473
  * context.database -> Groonga::Database
@@ -392,7 +480,7 @@ rb_grn_context_get_database (VALUE self)
392
480
  grn_ctx *context;
393
481
 
394
482
  context = SELF(self);
395
- return GRNDB2RVAL(context, grn_ctx_db(context), RB_GRN_FALSE);
483
+ return GRNDB2RVAL(context, grn_ctx_db(context), GRN_FALSE);
396
484
  }
397
485
 
398
486
  /*
@@ -481,16 +569,22 @@ static VALUE
481
569
  rb_grn_context_receive (VALUE self)
482
570
  {
483
571
  grn_ctx *context;
484
- char *string;
485
- unsigned string_size;
572
+ char *result = NULL;
573
+ unsigned result_size;
574
+ VALUE rb_result;
486
575
  int flags = 0;
487
576
  unsigned int query_id;
488
577
 
489
578
  context = SELF(self);
490
- query_id = grn_ctx_recv(context, &string, &string_size, &flags);
579
+ query_id = grn_ctx_recv(context, &result, &result_size, &flags);
580
+ if (result) {
581
+ rb_result = rb_str_new(result, result_size);
582
+ } else {
583
+ rb_result = Qnil;
584
+ }
491
585
  rb_grn_context_check(context, self);
492
586
 
493
- return rb_ary_new3(2, UINT2NUM(query_id), rb_str_new(string, string_size));
587
+ return rb_ary_new3(2, UINT2NUM(query_id), rb_result);
494
588
  }
495
589
 
496
590
  static const char *
@@ -611,7 +705,7 @@ rb_grn_context_array_reference (VALUE self, VALUE name_or_id)
611
705
  break;
612
706
  }
613
707
 
614
- return GRNOBJECT2RVAL(Qnil, context, object, RB_GRN_FALSE);
708
+ return GRNOBJECT2RVAL(Qnil, context, object, GRN_FALSE);
615
709
  }
616
710
 
617
711
  void
@@ -639,6 +733,11 @@ rb_grn_init_context (VALUE mGrn)
639
733
  rb_define_method(cGrnContext, "encoding", rb_grn_context_get_encoding, 0);
640
734
  rb_define_method(cGrnContext, "encoding=", rb_grn_context_set_encoding, 1);
641
735
 
736
+ rb_define_method(cGrnContext, "support_zlib?",
737
+ rb_grn_context_support_zlib_p, 0);
738
+ rb_define_method(cGrnContext, "support_lzo?",
739
+ rb_grn_context_support_lzo_p, 0);
740
+
642
741
  rb_define_method(cGrnContext, "database", rb_grn_context_get_database, 0);
643
742
 
644
743
  rb_define_method(cGrnContext, "[]", rb_grn_context_array_reference, 1);
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby" -*- */
2
2
  /*
3
- Copyright (C) 2009 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2010 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
@@ -45,7 +45,7 @@ rb_grn_database_from_ruby_object (VALUE object)
45
45
 
46
46
  VALUE
47
47
  rb_grn_database_to_ruby_object (grn_ctx *context, grn_obj *database,
48
- rb_grn_boolean owner)
48
+ grn_bool owner)
49
49
  {
50
50
  return GRNOBJECT2RVAL(rb_cGrnDatabase, context, database, owner);
51
51
  }
@@ -195,7 +195,7 @@ rb_grn_database_s_create (int argc, VALUE *argv, VALUE klass)
195
195
  grn_obj_unlink(context, old_database);
196
196
  database = grn_db_create(context, path, &create_args);
197
197
  rb_grn_context_check(context, rb_ary_new4(argc, argv));
198
- rb_database = GRNOBJECT2RVAL(klass, context, database, RB_GRN_TRUE);
198
+ rb_database = GRNOBJECT2RVAL(klass, context, database, GRN_TRUE);
199
199
  rb_iv_set(rb_database, "@context", rb_context);
200
200
  if (!NIL_P(rb_context))
201
201
  rb_iv_set(rb_context, "database", rb_database);
@@ -315,7 +315,7 @@ rb_grn_database_each (VALUE self)
315
315
 
316
316
  object = grn_ctx_at(context, id);
317
317
  if (object)
318
- rb_yield(GRNOBJECT2RVAL(Qnil, context, object, RB_GRN_FALSE));
318
+ rb_yield(GRNOBJECT2RVAL(Qnil, context, object, GRN_FALSE));
319
319
  }
320
320
  rb_grn_object_close(rb_cursor);
321
321
  rb_iv_set(self, "cursor", Qnil);
@@ -441,6 +441,27 @@ rb_grn_database_is_locked (VALUE self)
441
441
  return CBOOL2RVAL(grn_obj_is_locked(context, database));
442
442
  }
443
443
 
444
+ /*
445
+ * Document-method: touch
446
+ *
447
+ * call-seq:
448
+ * database.touch
449
+ *
450
+ * _database_の最終更新時刻を現在時刻にする。
451
+ */
452
+ static VALUE
453
+ rb_grn_database_touch (VALUE self)
454
+ {
455
+ grn_ctx *context;
456
+ grn_obj *database;
457
+
458
+ rb_grn_database_deconstruct(SELF(self), &database, &context,
459
+ NULL, NULL, NULL, NULL);
460
+
461
+ grn_db_touch(context, database);
462
+ return Qnil;
463
+ }
464
+
444
465
  void
445
466
  rb_grn_init_database (VALUE mGrn)
446
467
  {
@@ -469,4 +490,6 @@ rb_grn_init_database (VALUE mGrn)
469
490
  rb_define_method(rb_cGrnDatabase, "clear_lock",
470
491
  rb_grn_database_clear_lock, 0);
471
492
  rb_define_method(rb_cGrnDatabase, "locked?", rb_grn_database_is_locked, 0);
493
+
494
+ rb_define_method(rb_cGrnDatabase, "touch", rb_grn_database_touch, 0);
472
495
  }
@@ -93,6 +93,7 @@ static VALUE eGrnTooSmallOffset;
93
93
  static VALUE eGrnTooLargeOffset;
94
94
  static VALUE eGrnTooSmallLimit;
95
95
  static VALUE eGrnCASError;
96
+ static VALUE eGrnUnsupportedCommandVersion;
96
97
 
97
98
  VALUE
98
99
  rb_grn_rc_to_exception (grn_rc rc)
@@ -316,6 +317,9 @@ rb_grn_rc_to_exception (grn_rc rc)
316
317
  case GRN_CAS_ERROR:
317
318
  exception = eGrnCASError;
318
319
  break;
320
+ case GRN_UNSUPPORTED_COMMAND_VERSION:
321
+ exception = eGrnUnsupportedCommandVersion;
322
+ break;
319
323
  }
320
324
 
321
325
  if (NIL_P(exception))
@@ -546,6 +550,9 @@ rb_grn_rc_to_message (grn_rc rc)
546
550
  case GRN_CAS_ERROR:
547
551
  message = "CAS error";
548
552
  break;
553
+ case GRN_UNSUPPORTED_COMMAND_VERSION:
554
+ message = "unsupported command version";
555
+ break;
549
556
  }
550
557
 
551
558
  if (!message)
@@ -1166,4 +1173,12 @@ rb_grn_init_exception (VALUE mGrn)
1166
1173
  * CAS(Compare and Swap)が失敗したときに発生する。
1167
1174
  */
1168
1175
  eGrnCASError = rb_define_class_under(mGrn, "CASError", rb_eGrnError);
1176
+
1177
+ /*
1178
+ * Document-class: Groonga::UnsupportedCommandVersion
1179
+ *
1180
+ * 未サポートのコマンドバージョンを指定したときに発生する。
1181
+ */
1182
+ eGrnUnsupportedCommandVersion =
1183
+ rb_define_class_under(mGrn, "UnsupportedCommandVersion", rb_eGrnError);
1169
1184
  }
@@ -98,6 +98,8 @@ rb_grn_expression_initialize (int argc, VALUE *argv, VALUE self)
98
98
  rb_grn_object_assign(Qnil, self, rb_context, context, expression);
99
99
  rb_grn_context_check(context, self);
100
100
 
101
+ rb_iv_set(self, "@objects", rb_ary_new());
102
+
101
103
  return Qnil;
102
104
  }
103
105
 
@@ -155,7 +157,7 @@ rb_grn_expression_define_variable (int argc, VALUE *argv, VALUE self)
155
157
  /*
156
158
  * call-seq:
157
159
  * expression.append_object(object,
158
- * operation=Groonga::Operation::PUSH,
160
+ * operation=Groonga::Operator::PUSH,
159
161
  * n_arguments=1) -> self
160
162
  *
161
163
  * _object_を追加し、_n_arguments_個の引数を取る_operation_を追加する。
@@ -183,13 +185,15 @@ rb_grn_expression_append_object (int argc, VALUE *argv, VALUE self)
183
185
  grn_expr_append_obj(context, expression, object,
184
186
  operation, n_arguments);
185
187
  rb_grn_context_check(context, self);
188
+ rb_ary_push(rb_iv_get(self, "@objects"), rb_object);
189
+
186
190
  return self;
187
191
  }
188
192
 
189
193
  /*
190
194
  * call-seq:
191
195
  * expression.append_constant(constant,
192
- * operation=Groonga::Operation::PUSH,
196
+ * operation=Groonga::Operator::PUSH,
193
197
  * n_arguments=1) -> self
194
198
  *
195
199
  * _constant_を追加し、_n_arguments_個の引数を取る_operation_を追加する。
@@ -266,19 +270,19 @@ rb_grn_expression_append_operation (VALUE self, VALUE rb_operation,
266
270
  * [+:default_operator+]
267
271
  * "+"や"OR"で繋がれず、ただ列挙された複数の条件があった時、
268
272
  * _expression_全体として各レコードをヒットとみなすかの論理
269
- * 条件を指定する。省略した場合はGroonga::Operation::AND。
273
+ * 条件を指定する。省略した場合はGroonga::Operator::AND。
270
274
  *
271
- * [Groonga::Operation::OR]
275
+ * [Groonga::Operator::OR]
272
276
  * レコードはいずれかの条件にマッチすればいい。
273
- * [Groonga::Operation::AND]
277
+ * [Groonga::Operator::AND]
274
278
  * レコードは全ての条件にマッチしなければならない。
275
- * [Groonga::Operation::BUT]
279
+ * [Groonga::Operator::BUT]
276
280
  * 最初の条件にレコードはマッチし、残りの条件にレコードは
277
281
  * マッチしてはならない。
278
282
  *
279
283
  * [+:default_mode+]
280
284
  * 検索時のモードを指定する。省略した場合は
281
- * Groonga::Operation::MATCH。(FIXME: モードによってどう
285
+ * Groonga::Operator::MATCH。(FIXME: モードによってどう
282
286
  * いう動作になるかを書く。)
283
287
  *
284
288
  * [+:syntax+]
@@ -334,7 +338,7 @@ rb_grn_expression_parse (int argc, VALUE *argv, VALUE self)
334
338
  {
335
339
  grn_ctx *context = NULL;
336
340
  grn_obj *expression, *default_column;
337
- rb_grn_boolean default_column_is_created = RB_GRN_FALSE;
341
+ grn_bool default_column_is_created = GRN_FALSE;
338
342
  grn_operator default_operator = GRN_OP_AND;
339
343
  grn_operator default_mode = GRN_OP_MATCH;
340
344
  grn_rc rc;
@@ -370,7 +374,7 @@ rb_grn_expression_parse (int argc, VALUE *argv, VALUE self)
370
374
  default_column = RVAL2GRNOBJECT(rb_default_column, &context);
371
375
  } else {
372
376
  default_column = RVAL2GRNBULK(rb_default_column, context, NULL);
373
- default_column_is_created = RB_GRN_TRUE;
377
+ default_column_is_created = GRN_TRUE;
374
378
  }
375
379
 
376
380
  if (!NIL_P(rb_default_mode))
@@ -701,7 +705,7 @@ rb_grn_expression_snippet (int argc, VALUE *argv, VALUE self)
701
705
  rb_grn_context_check(context,
702
706
  rb_ary_new3(2, self, rb_ary_new4(argc, argv)));
703
707
 
704
- return GRNSNIPPET2RVAL(context, snippet, RB_GRN_TRUE);
708
+ return GRNSNIPPET2RVAL(context, snippet, GRN_TRUE);
705
709
  }
706
710
 
707
711
  void
@@ -81,7 +81,7 @@ VALUE rb_cGrnHash;
81
81
  * ともでき、その場合は自動的にGroonga::Recordからレコード
82
82
  * IDを取得する。
83
83
  *
84
- * 省略した場合は文字列をキーとして使用する。この場合、
84
+ * 省略した場合はShortText型をキーとして使用する。この場合、
85
85
  * 4096バイトまで使用可能である。
86
86
  *
87
87
  * [+:value_type+]
@@ -192,7 +192,7 @@ rb_grn_hash_s_create (int argc, VALUE *argv, VALUE klass)
192
192
  flags |= GRN_OBJ_KEY_NORMALIZE;
193
193
 
194
194
  if (NIL_P(rb_key_type)) {
195
- flags |= GRN_OBJ_KEY_VAR_SIZE;
195
+ key_type = grn_ctx_at(context, GRN_DB_SHORT_TEXT);
196
196
  } else {
197
197
  key_type = RVAL2GRNOBJECT(rb_key_type, &context);
198
198
  }
@@ -207,7 +207,7 @@ rb_grn_hash_s_create (int argc, VALUE *argv, VALUE klass)
207
207
  flags, key_type, value_type);
208
208
  if (!table)
209
209
  rb_grn_context_check(context, rb_ary_new4(argc, argv));
210
- rb_table = GRNOBJECT2RVAL(klass, context, table, RB_GRN_TRUE);
210
+ rb_table = GRNOBJECT2RVAL(klass, context, table, GRN_TRUE);
211
211
 
212
212
  if (!NIL_P(rb_default_tokenizer))
213
213
  rb_funcall(rb_table, rb_intern("default_tokenizer="), 1,
@@ -275,7 +275,7 @@ rb_grn_hash_search (int argc, VALUE *argv, VALUE self)
275
275
  GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
276
276
  table, 0);
277
277
  rb_grn_context_check(context, self);
278
- rb_result = GRNOBJECT2RVAL(Qnil, context, result, RB_GRN_TRUE);
278
+ rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
279
279
  } else {
280
280
  result = RVAL2GRNOBJECT(rb_result, &context);
281
281
  }
@@ -257,7 +257,7 @@ rb_grn_index_column_get_sources (VALUE self)
257
257
  VALUE rb_source;
258
258
 
259
259
  source = grn_ctx_at(context, *source_ids);
260
- rb_source = GRNOBJECT2RVAL(Qnil, context, source, RB_GRN_FALSE);
260
+ rb_source = GRNOBJECT2RVAL(Qnil, context, source, GRN_FALSE);
261
261
  rb_ary_push(rb_sources, rb_source);
262
262
  source_ids++;
263
263
  }
@@ -267,7 +267,8 @@ rb_grn_index_column_get_sources (VALUE self)
267
267
  }
268
268
 
269
269
  static grn_id
270
- resolve_source_id (grn_ctx *context, grn_obj *column, VALUE rb_source)
270
+ resolve_source_id (grn_ctx *context, grn_obj *column, grn_id range_id,
271
+ VALUE rb_source)
271
272
  {
272
273
  grn_id source_id;
273
274
 
@@ -316,7 +317,7 @@ resolve_source_id (grn_ctx *context, grn_obj *column, VALUE rb_source)
316
317
  rb_raise(rb_eArgError,
317
318
  "source accessor must be '_key': <%s>", name);
318
319
  }
319
- source_id = grn_obj_id(context, column);
320
+ source_id = range_id;
320
321
  } else {
321
322
  source_id = grn_obj_id(context, source);
322
323
  }
@@ -339,19 +340,22 @@ rb_grn_index_column_set_sources (VALUE self, VALUE rb_sources)
339
340
  grn_obj *column;
340
341
  int i, n;
341
342
  VALUE *rb_source_values;
343
+ grn_id range_id;
342
344
  grn_id *sources;
343
345
  grn_rc rc;
344
346
 
345
347
  rb_grn_index_column_deconstruct(SELF(self), &column, &context,
346
348
  NULL, NULL,
347
- NULL, NULL, NULL, NULL,
349
+ NULL, NULL,
350
+ &range_id, NULL,
348
351
  NULL, NULL);
349
352
 
350
353
  n = RARRAY_LEN(rb_sources);
351
354
  rb_source_values = RARRAY_PTR(rb_sources);
352
355
  sources = ALLOCA_N(grn_id, n);
353
356
  for (i = 0; i < n; i++) {
354
- sources[i] = resolve_source_id(context, column, rb_source_values[i]);
357
+ sources[i] = resolve_source_id(context, column, range_id,
358
+ rb_source_values[i]);
355
359
  }
356
360
 
357
361
  {
@@ -466,7 +470,7 @@ rb_grn_index_column_search (int argc, VALUE *argv, VALUE self)
466
470
  GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
467
471
  range, 0);
468
472
  rb_grn_context_check(context, self);
469
- rb_result = GRNOBJECT2RVAL(Qnil, context, result, RB_GRN_TRUE);
473
+ rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
470
474
  } else {
471
475
  result = RVAL2GRNOBJECT(rb_result, &context);
472
476
  }