rroonga 1.0.1-x86-mingw32 → 1.1.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
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
File without changes
data/example/bookmark.rb CHANGED
@@ -27,7 +27,7 @@ path = ARGV[0]
27
27
  if path.nil?
28
28
  require 'tmpdir'
29
29
  require 'fileutils'
30
- temporary_directory = File.join(Dir.tmpdir, "ruby-groonga")
30
+ temporary_directory = File.join(Dir.tmpdir, "rroonga")
31
31
  FileUtils.mkdir_p(temporary_directory)
32
32
  at_exit {FileUtils.rm_rf(temporary_directory)}
33
33
  path = File.join(temporary_directory, "db")
@@ -36,126 +36,129 @@ persistent = true
36
36
 
37
37
  p Groonga::Database.create(:path => path)
38
38
 
39
- p(items = Groonga::Hash.create(:name => "Items",
40
- :key_type => "ShortText",
41
- :persistent => persistent))
39
+ p Groonga::Schema.create_table("Items", :type => :hash)
40
+ p(items = Groonga["Items"])
41
+
42
+ p items.size
42
43
 
43
44
  p items.add("http://ja.wikipedia.org/wiki/Ruby")
44
- p items.add("http://www.ruby-lang.org/")
45
+ p items.add("http://www.ruby-lang.org/ja/")
46
+
47
+ p items.size
48
+
49
+ p items["http://ja.wikipedia.org/wiki/Ruby"]
45
50
 
46
- p items.define_column("title", "Text", :persistent => persistent)
51
+ p(Groonga::Schema.change_table("Items") do |table|
52
+ table.text("title")
53
+ end)
54
+ p(title_column = Groonga["Items.title"])
47
55
 
48
- p(terms = Groonga::Hash.create(:name => "Terms",
49
- :key_type => "ShortText",
50
- :persistent => persistent,
56
+ p(Groonga::Schema.create_table("Terms",
57
+ :type => :patricia_trie,
58
+ :key_normalize => true,
51
59
  :default_tokenizer => "TokenBigram"))
52
- p terms.define_index_column("item_title", items,
53
- :persistent => persistent,
54
- :with_weight => true,
55
- :with_section => true,
56
- :with_position => true,
57
- :source => "Items.title")
58
-
59
- p items.find("http://ja.wikipedia.org/wiki/Ruby")["title"] = "Ruby"
60
- p items.find("http://www.ruby-lang.org/")["title"] = "オブジェクト指向スクリプト言語Ruby"
61
-
62
- p(users = Groonga::Hash.create(:name => "Users",
63
- :key_type => "ShortText",
64
- :persistent => persistent))
65
- p users.define_column("name", "Text",
66
- :persistent => persistent)
67
-
68
- p(comments = Groonga::Array.create(:name => "Comments",
69
- :persistent => persistent))
70
- p comments.define_column("item", items)
71
- p comments.define_column("author", users)
72
- p comments.define_column("content", "Text")
73
- p comments.define_column("issued", "Time")
74
-
75
- p terms.define_index_column("comment_content", comments,
76
- :persistent => persistent,
77
- :with_weight => true,
78
- :with_section => true,
79
- :with_position => true,
80
- :source => "Comments.content")
81
-
82
- p users.add("moritan", :name => "モリタン")
83
- p users.add("taporobo", :name => "タポロボ")
84
-
85
-
86
- p items.find("http://d.hatena.ne.jp/brazil/20050829/1125321936")
87
-
88
- p items.add("http://d.hatena.ne.jp/brazil/20050829/1125321936",
89
- :title => "[翻訳]JavaScript: 世界で最も誤解されたプログラミング言語")
90
-
91
- p comments.add(:item => "http://d.hatena.ne.jp/brazil/20050829/1125321936",
60
+ p(Groonga::Schema.change_table("Terms") do |table|
61
+ table.index("Items.title")
62
+ end)
63
+
64
+ p(items["http://ja.wikipedia.org/wiki/Ruby"].title = "Ruby")
65
+ p(items["http://www.ruby-lang.org/ja/"].title = "オブジェクトスクリプト言語Ruby")
66
+
67
+ p(ruby_items = items.select {|record| record.title =~ "Ruby"})
68
+ p(ruby_items.collect {|record| record.key.key})
69
+ p(ruby_items.collect {|record| record["_key"]})
70
+
71
+ p(Groonga::Schema.create_table("Users", :type => :hash) do |table|
72
+ table.text("name")
73
+ end)
74
+ p(Groonga::Schema.create_table("Comments") do |table|
75
+ table.reference("item")
76
+ table.reference("author", "Users")
77
+ table.text("content")
78
+ table.time("issued")
79
+ end)
80
+
81
+ p(Groonga::Schema.change_table("Terms") do |table|
82
+ table.index("Comments.content")
83
+ end)
84
+
85
+ p(users = Groonga["Users"])
86
+ p(users.add("moritan", :name => "モリタン"))
87
+ p(users.add("taporobo", :name => "タポロボ"))
88
+
89
+ p(items.has_key?("http://www.rubyist.net/~matz/"))
90
+ p(items.add("http://www.rubyist.net/~matz/",
91
+ :title => "Matzにっき"))
92
+
93
+ require "time"
94
+
95
+ p(comments = Groonga["Comments"])
96
+ p(comments.add(:item => "http://www.rubyist.net/~matz/",
92
97
  :author => "moritan",
93
- :content => "JavaScript LISP",
94
- :issued => 1187430026)
98
+ :content => "Ruby Matz",
99
+ :issued => Time.parse("2010-11-20T18:01:22+09:00")))
95
100
 
96
- @items = items
97
- @comments = comments
101
+ p(@items = items)
102
+ p(@comments = comments)
98
103
  def add_bookmark(url, title, author, content, issued)
99
- item = @items.find(url) || @items.add(url, :title => title)
104
+ item = @items[url] || @items.add(url, :title => title)
100
105
  @comments.add(:item => item,
101
106
  :author => author,
102
107
  :content => content,
103
108
  :issued => issued)
104
109
  end
105
110
 
106
- p add_bookmark("http://practical-scheme.net/docs/cont-j.html",
107
- "なんでも継続", "moritan", "継続 LISP Scheme", 1187568692)
108
- p add_bookmark("http://d.hatena.ne.jp/higepon/20070815/1187192864",
109
- "末尾再帰", "taporobo", "末尾再帰 Scheme LISP", 1187568793)
110
- p add_bookmark("http://practical-scheme.net/docs/cont-j.html",
111
- "なんでも継続", "taporobo", "トランポリン LISP continuation",
112
- 1187568692.98765)
113
- p add_bookmark("http://jp.rubyist.net/managinze",
114
- "るびま", "moritan", "Ruby ドキュメント",
115
- Time.now)
116
- p add_bookmark("http://jp.rubyist.net/managinze",
117
- "るびま", "taporobo", "Ruby 雑誌",
118
- Time.now)
119
- p add_bookmark("http://groonga.rubyforge.org/",
120
- "ラングバ", "moritan", "Ruby groonga",
121
- Time.parse("2009-07-19"))
122
-
123
-
124
- records = comments.select do |record|
125
- record["content"] =~ "LISP"
126
- end
111
+ p(add_bookmark("http://jp.rubyist.net/magazine/",
112
+ "Rubyist Magazine - るびま", "moritan", "Ruby 記事",
113
+ Time.parse("2010-10-07T14:18:28+09:00")))
114
+ p(add_bookmark("http://groonga.rubyforge.org/",
115
+ "Rubyでgroonga使って全文検索 - ラングバ", "taporobo",
116
+ "Ruby groonga 全文検索",
117
+ Time.parse("2010-11-11T12:39:59+09:00")))
118
+ p(add_bookmark("http://www.rubyist.net/~matz/",
119
+ "Matz日記", "taporobo", "Ruby 日記",
120
+ Time.parse("2010-07-28T20:46:23+09:00")))
121
+
122
+ p(records = comments.select do |record|
123
+ record["content"] =~ "Ruby"
124
+ end)
127
125
 
128
126
  records.each do |record|
129
127
  record = record.key
130
128
  p [record.id,
131
- record[".issued"],
132
- record[".item.title"],
133
- record[".author.name"],
134
- record[".content"]]
129
+ record.issued,
130
+ record.item.title,
131
+ record.author.name,
132
+ record.content]
135
133
  end
136
134
 
137
135
  p records
138
136
 
139
- records.sort([{:key => ".issued", :order => "descending"}]).each do |record|
137
+ records.sort([{:key => "issued", :order => "descending"}]).each do |record|
140
138
  record = record.key
141
139
  p [record.id,
142
- record[".issued"],
143
- record[".item.title"],
144
- record[".author.name"],
145
- record[".content"]]
140
+ record.issued,
141
+ record.item.title,
142
+ record.author.name,
143
+ record.content]
146
144
  end
147
145
 
148
146
  records.group("item").each do |record|
149
147
  item = record.key
150
148
  p [record.n_sub_records,
151
149
  item.key,
152
- item[".title"]]
150
+ item.title]
153
151
  end
154
152
 
155
- p ruby_comments = @comments.select {|record| record["content"] =~ "Ruby"}
156
- p ruby_items = @items.select("*W1:50 title:@Ruby")
157
-
158
- p ruby_items = ruby_comments.group(".item").union!(ruby_items)
159
- ruby_items.sort([{:key => "._score", :order => "descending"}]).each do |record|
160
- p [record["._score"], record[".title"]]
153
+ p(ruby_comments = @comments.select {|record| record.content =~ "Ruby"})
154
+ p(ruby_items = @items.select do |record|
155
+ target = record.match_target do |match_record|
156
+ match_record.title * 10
157
+ end
158
+ target =~ "Ruby"
159
+ end)
160
+
161
+ p(ruby_items = ruby_comments.group("item").union!(ruby_items))
162
+ ruby_items.sort([{:key => "_score", :order => "descending"}]).each do |record|
163
+ p [record.score, record.title]
161
164
  end
File without changes
@@ -15,14 +15,9 @@
15
15
  # License along with this library; if not, write to the Free Software
16
16
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
17
 
18
- require 'pathname'
19
-
20
- base_dir = Pathname(__FILE__).dirname.parent.parent
21
- $LOAD_PATH.unshift(base_dir.to_s)
22
-
23
18
  require 'English'
19
+ require 'pathname'
24
20
  require 'mkmf'
25
- require 'rroonga-build'
26
21
 
27
22
  begin
28
23
  require 'pkg-config'
@@ -31,6 +26,11 @@ rescue LoadError
31
26
  require 'pkg-config'
32
27
  end
33
28
 
29
+ base_dir = Pathname(__FILE__).dirname.parent.parent
30
+ $LOAD_PATH.unshift(base_dir.to_s)
31
+
32
+ require 'rroonga-build'
33
+
34
34
  include RroongaBuild
35
35
 
36
36
  package_name = "groonga"
@@ -34,7 +34,7 @@ rb_grn_accessor_from_ruby_object (VALUE object)
34
34
 
35
35
  VALUE
36
36
  rb_grn_accessor_to_ruby_object (grn_ctx *context, grn_obj *table,
37
- rb_grn_boolean owner)
37
+ grn_bool owner)
38
38
  {
39
39
  return GRNOBJECT2RVAL(rb_cGrnAccessor, context, table, owner);
40
40
  }
@@ -139,7 +139,7 @@ rb_grn_array_s_create (int argc, VALUE *argv, VALUE klass)
139
139
  flags, NULL, value_type);
140
140
  if (!table)
141
141
  rb_grn_context_check(context, rb_ary_new4(argc, argv));
142
- rb_table = GRNOBJECT2RVAL(klass, context, table, RB_GRN_TRUE);
142
+ rb_table = GRNOBJECT2RVAL(klass, context, table, GRN_TRUE);
143
143
  rb_grn_context_check(context, rb_table);
144
144
  rb_iv_set(rb_table, "@context", rb_context);
145
145
 
@@ -1,7 +1,7 @@
1
1
  /* -*- c-file-style: "ruby" -*- */
2
2
  /* vim: set sts=4 sw=4 ts=8 noet: */
3
3
  /*
4
- Copyright (C) 2009-2010 Kouhei Sutou <kou@clear-code.com>
4
+ Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
5
5
 
6
6
  This library is free software; you can redistribute it and/or
7
7
  modify it under the terms of the GNU Lesser General Public
@@ -60,7 +60,7 @@ rb_grn_column_from_ruby_object (VALUE object, grn_ctx **context)
60
60
 
61
61
  VALUE
62
62
  rb_grn_column_to_ruby_object (VALUE klass, grn_ctx *context, grn_obj *column,
63
- rb_grn_boolean owner)
63
+ grn_bool owner)
64
64
  {
65
65
  return GRNOBJECT2RVAL(klass, context, column, owner);
66
66
  }
@@ -128,7 +128,7 @@ rb_grn_column_get_table (VALUE self)
128
128
  table = grn_column_table(context, column);
129
129
  rb_grn_context_check(context, self);
130
130
 
131
- return GRNOBJECT2RVAL(Qnil, context, table, RB_GRN_FALSE);
131
+ return GRNOBJECT2RVAL(Qnil, context, table, GRN_FALSE);
132
132
  }
133
133
 
134
134
  /*
@@ -235,17 +235,17 @@ rb_grn_column_get_local_name (VALUE self)
235
235
  *
236
236
  * [+:operator+]
237
237
  * マッチしたレコードをどのように扱うか。指定可能な値は以
238
- * 下の通り。省略した場合はGroonga::Operation::OR。
238
+ * 下の通り。省略した場合はGroonga::Operator::OR。
239
239
  *
240
- * [Groonga::Operation::OR]
240
+ * [Groonga::Operator::OR]
241
241
  * マッチしたレコードを追加。すでにレコードが追加され
242
242
  * ている場合は何もしない。
243
- * [Groonga::Operation::AND]
243
+ * [Groonga::Operator::AND]
244
244
  * マッチしたレコードのスコアを増加。マッチしなかった
245
245
  * レコードを削除。
246
- * [Groonga::Operation::BUT]
246
+ * [Groonga::Operator::BUT]
247
247
  * マッチしたレコードを削除。
248
- * [Groonga::Operation::ADJUST]
248
+ * [Groonga::Operator::ADJUST]
249
249
  * マッチしたレコードのスコアを増加。
250
250
  *
251
251
  * [+:result+]
@@ -333,7 +333,7 @@ rb_grn_column_select (int argc, VALUE *argv, VALUE self)
333
333
  GRN_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
334
334
  table,
335
335
  0);
336
- rb_result = GRNTABLE2RVAL(context, result, RB_GRN_TRUE);
336
+ rb_result = GRNTABLE2RVAL(context, result, GRN_TRUE);
337
337
  } else {
338
338
  result = RVAL2GRNTABLE(rb_result, &context);
339
339
  }
@@ -355,7 +355,7 @@ rb_grn_column_select (int argc, VALUE *argv, VALUE self)
355
355
 
356
356
  rb_attr(rb_singleton_class(rb_result),
357
357
  rb_intern("expression"),
358
- RB_GRN_TRUE, RB_GRN_FALSE, RB_GRN_FALSE);
358
+ GRN_TRUE, GRN_FALSE, GRN_FALSE);
359
359
  rb_iv_set(rb_result, "@expression", rb_expression);
360
360
 
361
361
  return rb_result;
@@ -552,6 +552,187 @@ rb_grn_column_is_locked (int argc, VALUE *argv, VALUE self)
552
552
  return CBOOL2RVAL(grn_obj_is_locked(context, column));
553
553
  }
554
554
 
555
+ /*
556
+ * Document-method: reference?
557
+ *
558
+ * call-seq:
559
+ * column.reference? -> true/false
560
+ *
561
+ * _column_の値がテーブルのレコードとなる場合は+true+を返し、
562
+ * そうでない場合は+false+を返す。
563
+ *
564
+ * @since: 1.0.5
565
+ */
566
+ static VALUE
567
+ rb_grn_column_reference_p (VALUE self)
568
+ {
569
+ grn_ctx *context;
570
+ grn_obj *column;
571
+ grn_id range_id;
572
+ grn_obj *range;
573
+ unsigned short int type;
574
+
575
+ rb_grn_column_deconstruct(SELF(self), &column, &context,
576
+ NULL, NULL,
577
+ NULL, NULL, NULL);
578
+
579
+ range_id = grn_obj_get_range(context, column);
580
+ range = grn_ctx_at(context, range_id);
581
+ type = range->header.type;
582
+ grn_obj_unlink(context, range);
583
+ switch (type) {
584
+ case GRN_TABLE_HASH_KEY:
585
+ case GRN_TABLE_PAT_KEY:
586
+ case GRN_TABLE_NO_KEY:
587
+ return Qtrue;
588
+ default:
589
+ return Qfalse;
590
+ }
591
+ }
592
+
593
+ /*
594
+ * Document-method: index?
595
+ *
596
+ * call-seq:
597
+ * column.index? -> true/false
598
+ *
599
+ * _column_がGroonga::IndexColumnの場合は+true+を返し、
600
+ * そうでない場合は+false+を返す。
601
+ *
602
+ * @since: 1.0.5
603
+ */
604
+ static VALUE
605
+ rb_grn_column_index_p (VALUE self)
606
+ {
607
+ grn_ctx *context;
608
+ grn_obj *column;
609
+
610
+ rb_grn_column_deconstruct(SELF(self), &column, &context,
611
+ NULL, NULL,
612
+ NULL, NULL, NULL);
613
+
614
+ if (column->header.type == GRN_COLUMN_INDEX) {
615
+ return Qtrue;
616
+ } else {
617
+ return Qfalse;
618
+ }
619
+ }
620
+
621
+ /*
622
+ * Document-method: vector?
623
+ *
624
+ * call-seq:
625
+ * column.vector? -> true/false
626
+ *
627
+ * _column_がベクターカラムの場合は+true+を返し、
628
+ * そうでない場合は+false+を返す。
629
+ *
630
+ * @since: 1.0.5
631
+ */
632
+ static VALUE
633
+ rb_grn_column_vector_p (VALUE self)
634
+ {
635
+ grn_ctx *context;
636
+ grn_obj *column;
637
+
638
+ rb_grn_column_deconstruct(SELF(self), &column, &context,
639
+ NULL, NULL,
640
+ NULL, NULL, NULL);
641
+
642
+ if (column->header.type == GRN_COLUMN_VAR_SIZE &&
643
+ ((column->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) ==
644
+ GRN_OBJ_COLUMN_VECTOR)) {
645
+ return Qtrue;
646
+ } else {
647
+ return Qfalse;
648
+ }
649
+ }
650
+
651
+ /*
652
+ * Document-method: scalar?
653
+ *
654
+ * call-seq:
655
+ * column.scalar? -> true/false
656
+ *
657
+ * _column_がスカラーカラムの場合は+true+を返し、
658
+ * そうでない場合は+false+を返す。
659
+ *
660
+ * @since: 1.0.5
661
+ */
662
+ static VALUE
663
+ rb_grn_column_scalar_p (VALUE self)
664
+ {
665
+ grn_ctx *context;
666
+ grn_obj *column;
667
+
668
+ rb_grn_column_deconstruct(SELF(self), &column, &context,
669
+ NULL, NULL,
670
+ NULL, NULL, NULL);
671
+
672
+ switch (column->header.type) {
673
+ case GRN_COLUMN_FIX_SIZE:
674
+ return Qtrue;
675
+ case GRN_COLUMN_VAR_SIZE:
676
+ if ((column->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) ==
677
+ GRN_OBJ_COLUMN_SCALAR) {
678
+ return Qtrue;
679
+ } else {
680
+ return Qfalse;
681
+ }
682
+ default:
683
+ return Qfalse;
684
+ }
685
+ }
686
+
687
+ /*
688
+ * Document-method: indexes
689
+ *
690
+ * call-seq:
691
+ * column.indexes(operator=Groonga::Operator::MATCH) -> [index_column, ...]
692
+ *
693
+ * _operation_を実行できる_column_のインデックスを返す。
694
+ *
695
+ * @since: 1.0.9
696
+ */
697
+ static VALUE
698
+ rb_grn_column_get_indexes (int argc, VALUE *argv, VALUE self)
699
+ {
700
+ grn_ctx *context;
701
+ grn_obj *column;
702
+ grn_obj **indexes = NULL;
703
+ int i, n_indexes;
704
+ grn_operator operator = GRN_OP_MATCH;
705
+ VALUE rb_operator, rb_indexes;
706
+
707
+ rb_scan_args(argc, argv, "01", &rb_operator);
708
+
709
+ rb_grn_column_deconstruct(SELF(self), &column, &context,
710
+ NULL, NULL,
711
+ NULL, NULL, NULL);
712
+
713
+ if (!NIL_P(rb_operator)) {
714
+ operator = RVAL2GRNOPERATOR(rb_operator);
715
+ }
716
+
717
+ rb_indexes = rb_ary_new();
718
+ n_indexes = grn_column_index(context, column, operator,
719
+ NULL, 0, NULL);
720
+ if (n_indexes == 0)
721
+ return rb_indexes;
722
+
723
+ indexes = xmalloc(sizeof(grn_obj *) * n_indexes);
724
+ n_indexes = grn_column_index(context, column, operator,
725
+ indexes, n_indexes, NULL);
726
+ for (i = 0; i < n_indexes; i++) {
727
+ VALUE rb_index;
728
+ rb_index = GRNOBJECT2RVAL(Qnil, context, indexes[i], GRN_FALSE);
729
+ rb_ary_push(rb_indexes, rb_index);
730
+ grn_obj_unlink(context, indexes[i]);
731
+ }
732
+ xfree(indexes);
733
+ return rb_indexes;
734
+ }
735
+
555
736
  void
556
737
  rb_grn_init_column (VALUE mGrn)
557
738
  {
@@ -566,6 +747,16 @@ rb_grn_init_column (VALUE mGrn)
566
747
  rb_define_method(rb_cGrnColumn, "unlock", rb_grn_column_unlock, -1);
567
748
  rb_define_method(rb_cGrnColumn, "clear_lock", rb_grn_column_clear_lock, -1);
568
749
  rb_define_method(rb_cGrnColumn, "locked?", rb_grn_column_is_locked, -1);
750
+ rb_define_method(rb_cGrnColumn, "reference?", rb_grn_column_reference_p, 0);
751
+ /* deprecated: backward compatibility */
752
+ rb_define_alias(rb_cGrnColumn, "reference_column?", "reference?");
753
+ rb_define_method(rb_cGrnColumn, "index?", rb_grn_column_index_p, 0);
754
+ /* deprecated: backward compatibility */
755
+ rb_define_alias(rb_cGrnColumn, "index_column?", "index?");
756
+ rb_define_method(rb_cGrnColumn, "vector?", rb_grn_column_vector_p, 0);
757
+ rb_define_method(rb_cGrnColumn, "scalar?", rb_grn_column_scalar_p, 0);
758
+
759
+ rb_define_method(rb_cGrnColumn, "indexes", rb_grn_column_get_indexes, -1);
569
760
 
570
761
  rb_grn_init_fix_size_column(mGrn);
571
762
  rb_grn_init_variable_size_column(mGrn);