rroonga 1.3.0-x86-mingw32 → 1.3.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (334) hide show
  1. data/Rakefile +33 -2
  2. data/benchmark/common.rb +2 -2
  3. data/benchmark/read-write-many-small-items.rb +71 -62
  4. data/benchmark/write-many-small-items.rb +61 -53
  5. data/ext/groonga/rb-grn-context.c +23 -5
  6. data/ext/groonga/rb-grn-index-column.c +2 -6
  7. data/ext/groonga/rb-grn-operator.c +31 -1
  8. data/ext/groonga/rb-grn-variable-size-column.c +77 -1
  9. data/ext/groonga/rb-grn.h +2 -11
  10. data/ext/groonga/rb-groonga.c +1 -2
  11. data/lib/1.8/groonga.so +0 -0
  12. data/lib/1.9/groonga.so +0 -0
  13. data/lib/groonga/command.rb +169 -0
  14. data/lib/groonga/context.rb +4 -124
  15. data/lib/groonga/dumper.rb +10 -8
  16. data/lib/groonga/record.rb +7 -0
  17. data/lib/groonga/schema.rb +98 -7
  18. data/rroonga-build.rb +3 -3
  19. data/test/{test-context-select.rb → test-command-select.rb} +3 -3
  20. data/test/test-record.rb +18 -1
  21. data/test/test-schema-dumper.rb +48 -0
  22. data/test/test-schema-type.rb +35 -0
  23. data/test/test-schema.rb +81 -11
  24. data/test/test-table-select.rb +49 -38
  25. data/test/test-variable-size-column.rb +30 -0
  26. data/vendor/local/bin/grntest.exe +0 -0
  27. data/vendor/local/bin/groonga.exe +0 -0
  28. data/vendor/local/bin/libgroonga-0.dll +0 -0
  29. data/vendor/local/bin/libmecab-1.dll +0 -0
  30. data/vendor/local/bin/mecab.exe +0 -0
  31. data/vendor/local/include/groonga/groonga/plugin.h +3 -2
  32. data/vendor/local/include/groonga/groonga.h +106 -78
  33. data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
  34. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
  35. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
  36. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.a +0 -0
  37. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll +0 -0
  38. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll.a +0 -0
  39. data/vendor/local/lib/libgroonga.a +0 -0
  40. data/vendor/local/lib/libgroonga.dll.a +0 -0
  41. data/vendor/local/lib/libmecab.a +0 -0
  42. data/vendor/local/lib/libmecab.dll.a +0 -0
  43. data/vendor/local/lib/pkgconfig/groonga.pc +5 -2
  44. data/vendor/local/libexec/mecab/mecab-cost-train.exe +0 -0
  45. data/vendor/local/libexec/mecab/mecab-dict-gen.exe +0 -0
  46. data/vendor/local/libexec/mecab/mecab-dict-index.exe +0 -0
  47. data/vendor/local/libexec/mecab/mecab-system-eval.exe +0 -0
  48. data/vendor/local/libexec/mecab/mecab-test-gen.exe +0 -0
  49. data/vendor/local/share/doc/groonga/en/html/.buildinfo +1 -1
  50. data/vendor/local/share/doc/groonga/en/html/_sources/characteristic.txt +42 -32
  51. data/vendor/local/share/doc/groonga/en/html/_sources/commands/delete.txt +5 -1
  52. data/vendor/local/share/doc/groonga/en/html/_sources/commands/table_create.txt +5 -2
  53. data/vendor/local/share/doc/groonga/en/html/_sources/community.txt +4 -3
  54. data/vendor/local/share/doc/groonga/en/html/_sources/contribution.txt +8 -6
  55. data/vendor/local/share/doc/groonga/en/html/_sources/functions/geo_distance.txt +42 -3
  56. data/vendor/local/share/doc/groonga/en/html/_sources/functions/geo_in_circle.txt +26 -1
  57. data/vendor/local/share/doc/groonga/en/html/_sources/index.txt +2 -2
  58. data/vendor/local/share/doc/groonga/en/html/_sources/install.txt +102 -27
  59. data/vendor/local/share/doc/groonga/en/html/_sources/limitations.txt +10 -10
  60. data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +130 -21
  61. data/vendor/local/share/doc/groonga/en/html/_sources/output.txt +164 -0
  62. data/vendor/local/share/doc/groonga/en/html/_sources/reference.txt +1 -0
  63. data/vendor/local/share/doc/groonga/en/html/_sources/suggest.txt +0 -5
  64. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/data.txt +6 -4
  65. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/drilldown.txt +1 -3
  66. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/index.txt +2 -1
  67. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/introduction.txt +95 -116
  68. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/match_columns.txt +1 -4
  69. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/micro_blog.txt +1 -4
  70. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/network.txt +3 -0
  71. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/patricia_trie.txt +1 -2
  72. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/query_expansion.txt +5 -0
  73. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/search.txt +3 -0
  74. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial.txt +2 -2
  75. data/vendor/local/share/doc/groonga/en/html/_sources/type.txt +3 -3
  76. data/vendor/local/share/doc/groonga/en/html/_static/basic.css +13 -1
  77. data/vendor/local/share/doc/groonga/en/html/_static/doctools.js +5 -5
  78. data/vendor/local/share/doc/groonga/en/html/_static/searchtools.js +11 -7
  79. data/vendor/local/share/doc/groonga/en/html/_static/websupport.js +1 -1
  80. data/vendor/local/share/doc/groonga/en/html/characteristic.html +60 -52
  81. data/vendor/local/share/doc/groonga/en/html/command_version.html +30 -30
  82. data/vendor/local/share/doc/groonga/en/html/commands/cache_limit.html +34 -34
  83. data/vendor/local/share/doc/groonga/en/html/commands/check.html +34 -34
  84. data/vendor/local/share/doc/groonga/en/html/commands/clearlock.html +34 -34
  85. data/vendor/local/share/doc/groonga/en/html/commands/column_create.html +34 -34
  86. data/vendor/local/share/doc/groonga/en/html/commands/column_list.html +34 -34
  87. data/vendor/local/share/doc/groonga/en/html/commands/column_remove.html +34 -34
  88. data/vendor/local/share/doc/groonga/en/html/commands/define_selector.html +36 -36
  89. data/vendor/local/share/doc/groonga/en/html/commands/defrag.html +34 -34
  90. data/vendor/local/share/doc/groonga/en/html/commands/delete.html +38 -35
  91. data/vendor/local/share/doc/groonga/en/html/commands/dump.html +32 -32
  92. data/vendor/local/share/doc/groonga/en/html/commands/load.html +36 -36
  93. data/vendor/local/share/doc/groonga/en/html/commands/log_level.html +36 -36
  94. data/vendor/local/share/doc/groonga/en/html/commands/log_put.html +36 -36
  95. data/vendor/local/share/doc/groonga/en/html/commands/log_reopen.html +38 -38
  96. data/vendor/local/share/doc/groonga/en/html/commands/quit.html +32 -32
  97. data/vendor/local/share/doc/groonga/en/html/commands/select.html +38 -38
  98. data/vendor/local/share/doc/groonga/en/html/commands/shutdown.html +32 -32
  99. data/vendor/local/share/doc/groonga/en/html/commands/status.html +34 -34
  100. data/vendor/local/share/doc/groonga/en/html/commands/suggest.html +36 -36
  101. data/vendor/local/share/doc/groonga/en/html/commands/table_create.html +38 -36
  102. data/vendor/local/share/doc/groonga/en/html/commands/table_list.html +34 -34
  103. data/vendor/local/share/doc/groonga/en/html/commands/table_remove.html +34 -34
  104. data/vendor/local/share/doc/groonga/en/html/commands/view_add.html +34 -34
  105. data/vendor/local/share/doc/groonga/en/html/commands.html +41 -41
  106. data/vendor/local/share/doc/groonga/en/html/community.html +14 -12
  107. data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +7 -7
  108. data/vendor/local/share/doc/groonga/en/html/contribution/development/document.html +7 -7
  109. data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +7 -7
  110. data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +7 -7
  111. data/vendor/local/share/doc/groonga/en/html/contribution/development.html +7 -7
  112. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +7 -7
  113. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +7 -7
  114. data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +7 -7
  115. data/vendor/local/share/doc/groonga/en/html/contribution/report.html +7 -7
  116. data/vendor/local/share/doc/groonga/en/html/contribution.html +15 -13
  117. data/vendor/local/share/doc/groonga/en/html/executables/grnslap.html +7 -7
  118. data/vendor/local/share/doc/groonga/en/html/executables/grntest.html +7 -7
  119. data/vendor/local/share/doc/groonga/en/html/executables/groonga-http.html +7 -7
  120. data/vendor/local/share/doc/groonga/en/html/executables/groonga-suggest-create-dataset.html +12 -12
  121. data/vendor/local/share/doc/groonga/en/html/executables/groonga.html +7 -7
  122. data/vendor/local/share/doc/groonga/en/html/executables.html +7 -7
  123. data/vendor/local/share/doc/groonga/en/html/expr.html +25 -25
  124. data/vendor/local/share/doc/groonga/en/html/functions/edit_distance.html +32 -32
  125. data/vendor/local/share/doc/groonga/en/html/functions/geo_distance.html +71 -36
  126. data/vendor/local/share/doc/groonga/en/html/functions/geo_in_circle.html +53 -33
  127. data/vendor/local/share/doc/groonga/en/html/functions/geo_in_rectangle.html +32 -32
  128. data/vendor/local/share/doc/groonga/en/html/functions/now.html +30 -30
  129. data/vendor/local/share/doc/groonga/en/html/functions/rand.html +32 -32
  130. data/vendor/local/share/doc/groonga/en/html/functions.html +22 -22
  131. data/vendor/local/share/doc/groonga/en/html/genindex.html +7 -7
  132. data/vendor/local/share/doc/groonga/en/html/geolocation_search.html +7 -7
  133. data/vendor/local/share/doc/groonga/en/html/index.html +92 -87
  134. data/vendor/local/share/doc/groonga/en/html/install.html +109 -40
  135. data/vendor/local/share/doc/groonga/en/html/limitations.html +19 -19
  136. data/vendor/local/share/doc/groonga/en/html/log.html +21 -21
  137. data/vendor/local/share/doc/groonga/en/html/news/0.x.html +7 -7
  138. data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +7 -7
  139. data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +7 -7
  140. data/vendor/local/share/doc/groonga/en/html/news/senna.html +7 -7
  141. data/vendor/local/share/doc/groonga/en/html/news.html +233 -112
  142. data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
  143. data/vendor/local/share/doc/groonga/en/html/output.html +302 -0
  144. data/vendor/local/share/doc/groonga/en/html/pseudo_column.html +21 -21
  145. data/vendor/local/share/doc/groonga/en/html/reference.html +59 -55
  146. data/vendor/local/share/doc/groonga/en/html/search.html +6 -6
  147. data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
  148. data/vendor/local/share/doc/groonga/en/html/spec/search.html +11 -11
  149. data/vendor/local/share/doc/groonga/en/html/spec.html +11 -11
  150. data/vendor/local/share/doc/groonga/en/html/suggest/completion.html +7 -7
  151. data/vendor/local/share/doc/groonga/en/html/suggest/correction.html +7 -7
  152. data/vendor/local/share/doc/groonga/en/html/suggest/introduction.html +7 -7
  153. data/vendor/local/share/doc/groonga/en/html/suggest/suggestion.html +7 -7
  154. data/vendor/local/share/doc/groonga/en/html/suggest/tutorial.html +7 -7
  155. data/vendor/local/share/doc/groonga/en/html/suggest.html +7 -12
  156. data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +7 -7
  157. data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +11 -11
  158. data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +23 -23
  159. data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +10 -10
  160. data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +10 -10
  161. data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +124 -164
  162. data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +10 -10
  163. data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +10 -10
  164. data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +10 -10
  165. data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +14 -14
  166. data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +10 -10
  167. data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +11 -10
  168. data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +10 -10
  169. data/vendor/local/share/doc/groonga/en/html/tutorial.html +26 -26
  170. data/vendor/local/share/doc/groonga/en/html/type.html +31 -31
  171. data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
  172. data/vendor/local/share/doc/groonga/ja/html/_sources/characteristic.txt +42 -32
  173. data/vendor/local/share/doc/groonga/ja/html/_sources/commands/delete.txt +5 -1
  174. data/vendor/local/share/doc/groonga/ja/html/_sources/commands/table_create.txt +5 -2
  175. data/vendor/local/share/doc/groonga/ja/html/_sources/community.txt +4 -3
  176. data/vendor/local/share/doc/groonga/ja/html/_sources/contribution.txt +8 -6
  177. data/vendor/local/share/doc/groonga/ja/html/_sources/functions/geo_distance.txt +42 -3
  178. data/vendor/local/share/doc/groonga/ja/html/_sources/functions/geo_in_circle.txt +26 -1
  179. data/vendor/local/share/doc/groonga/ja/html/_sources/index.txt +2 -2
  180. data/vendor/local/share/doc/groonga/ja/html/_sources/install.txt +102 -27
  181. data/vendor/local/share/doc/groonga/ja/html/_sources/limitations.txt +10 -10
  182. data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +130 -21
  183. data/vendor/local/share/doc/groonga/ja/html/_sources/output.txt +164 -0
  184. data/vendor/local/share/doc/groonga/ja/html/_sources/reference.txt +1 -0
  185. data/vendor/local/share/doc/groonga/ja/html/_sources/suggest.txt +0 -5
  186. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/data.txt +6 -4
  187. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/drilldown.txt +1 -3
  188. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/index.txt +2 -1
  189. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/introduction.txt +95 -116
  190. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/match_columns.txt +1 -4
  191. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/micro_blog.txt +1 -4
  192. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/network.txt +3 -0
  193. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/patricia_trie.txt +1 -2
  194. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/query_expansion.txt +5 -0
  195. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/search.txt +3 -0
  196. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial.txt +2 -2
  197. data/vendor/local/share/doc/groonga/ja/html/_sources/type.txt +3 -3
  198. data/vendor/local/share/doc/groonga/ja/html/_static/basic.css +13 -1
  199. data/vendor/local/share/doc/groonga/ja/html/_static/doctools.js +5 -5
  200. data/vendor/local/share/doc/groonga/ja/html/_static/searchtools.js +11 -7
  201. data/vendor/local/share/doc/groonga/ja/html/_static/websupport.js +1 -1
  202. data/vendor/local/share/doc/groonga/ja/html/characteristic.html +55 -47
  203. data/vendor/local/share/doc/groonga/ja/html/command_version.html +30 -30
  204. data/vendor/local/share/doc/groonga/ja/html/commands/cache_limit.html +34 -34
  205. data/vendor/local/share/doc/groonga/ja/html/commands/check.html +34 -34
  206. data/vendor/local/share/doc/groonga/ja/html/commands/clearlock.html +34 -34
  207. data/vendor/local/share/doc/groonga/ja/html/commands/column_create.html +34 -34
  208. data/vendor/local/share/doc/groonga/ja/html/commands/column_list.html +34 -34
  209. data/vendor/local/share/doc/groonga/ja/html/commands/column_remove.html +34 -34
  210. data/vendor/local/share/doc/groonga/ja/html/commands/define_selector.html +36 -36
  211. data/vendor/local/share/doc/groonga/ja/html/commands/defrag.html +34 -34
  212. data/vendor/local/share/doc/groonga/ja/html/commands/delete.html +38 -35
  213. data/vendor/local/share/doc/groonga/ja/html/commands/dump.html +32 -32
  214. data/vendor/local/share/doc/groonga/ja/html/commands/load.html +36 -36
  215. data/vendor/local/share/doc/groonga/ja/html/commands/log_level.html +36 -36
  216. data/vendor/local/share/doc/groonga/ja/html/commands/log_put.html +36 -36
  217. data/vendor/local/share/doc/groonga/ja/html/commands/log_reopen.html +38 -38
  218. data/vendor/local/share/doc/groonga/ja/html/commands/quit.html +32 -32
  219. data/vendor/local/share/doc/groonga/ja/html/commands/select.html +38 -38
  220. data/vendor/local/share/doc/groonga/ja/html/commands/shutdown.html +32 -32
  221. data/vendor/local/share/doc/groonga/ja/html/commands/status.html +34 -34
  222. data/vendor/local/share/doc/groonga/ja/html/commands/suggest.html +36 -36
  223. data/vendor/local/share/doc/groonga/ja/html/commands/table_create.html +38 -36
  224. data/vendor/local/share/doc/groonga/ja/html/commands/table_list.html +34 -34
  225. data/vendor/local/share/doc/groonga/ja/html/commands/table_remove.html +34 -34
  226. data/vendor/local/share/doc/groonga/ja/html/commands/view_add.html +34 -34
  227. data/vendor/local/share/doc/groonga/ja/html/commands.html +41 -41
  228. data/vendor/local/share/doc/groonga/ja/html/community.html +10 -8
  229. data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +7 -7
  230. data/vendor/local/share/doc/groonga/ja/html/contribution/development/document.html +7 -7
  231. data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +7 -7
  232. data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +7 -7
  233. data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +7 -7
  234. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +7 -7
  235. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +7 -7
  236. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +7 -7
  237. data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +7 -7
  238. data/vendor/local/share/doc/groonga/ja/html/contribution.html +7 -7
  239. data/vendor/local/share/doc/groonga/ja/html/executables/grnslap.html +7 -7
  240. data/vendor/local/share/doc/groonga/ja/html/executables/grntest.html +7 -7
  241. data/vendor/local/share/doc/groonga/ja/html/executables/groonga-http.html +7 -7
  242. data/vendor/local/share/doc/groonga/ja/html/executables/groonga-suggest-create-dataset.html +12 -12
  243. data/vendor/local/share/doc/groonga/ja/html/executables/groonga.html +7 -7
  244. data/vendor/local/share/doc/groonga/ja/html/executables.html +7 -7
  245. data/vendor/local/share/doc/groonga/ja/html/expr.html +25 -25
  246. data/vendor/local/share/doc/groonga/ja/html/functions/edit_distance.html +32 -32
  247. data/vendor/local/share/doc/groonga/ja/html/functions/geo_distance.html +71 -36
  248. data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_circle.html +53 -33
  249. data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_rectangle.html +32 -32
  250. data/vendor/local/share/doc/groonga/ja/html/functions/now.html +30 -30
  251. data/vendor/local/share/doc/groonga/ja/html/functions/rand.html +32 -32
  252. data/vendor/local/share/doc/groonga/ja/html/functions.html +22 -22
  253. data/vendor/local/share/doc/groonga/ja/html/genindex.html +7 -7
  254. data/vendor/local/share/doc/groonga/ja/html/geolocation_search.html +7 -7
  255. data/vendor/local/share/doc/groonga/ja/html/index.html +84 -79
  256. data/vendor/local/share/doc/groonga/ja/html/install.html +92 -16
  257. data/vendor/local/share/doc/groonga/ja/html/limitations.html +13 -13
  258. data/vendor/local/share/doc/groonga/ja/html/log.html +21 -21
  259. data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +7 -7
  260. data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +7 -7
  261. data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +7 -7
  262. data/vendor/local/share/doc/groonga/ja/html/news/senna.html +7 -7
  263. data/vendor/local/share/doc/groonga/ja/html/news.html +202 -99
  264. data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
  265. data/vendor/local/share/doc/groonga/ja/html/output.html +287 -0
  266. data/vendor/local/share/doc/groonga/ja/html/pseudo_column.html +21 -21
  267. data/vendor/local/share/doc/groonga/ja/html/reference.html +59 -55
  268. data/vendor/local/share/doc/groonga/ja/html/search.html +6 -6
  269. data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
  270. data/vendor/local/share/doc/groonga/ja/html/spec/search.html +7 -7
  271. data/vendor/local/share/doc/groonga/ja/html/spec.html +11 -11
  272. data/vendor/local/share/doc/groonga/ja/html/suggest/completion.html +7 -7
  273. data/vendor/local/share/doc/groonga/ja/html/suggest/correction.html +7 -7
  274. data/vendor/local/share/doc/groonga/ja/html/suggest/introduction.html +7 -7
  275. data/vendor/local/share/doc/groonga/ja/html/suggest/suggestion.html +7 -7
  276. data/vendor/local/share/doc/groonga/ja/html/suggest/tutorial.html +7 -7
  277. data/vendor/local/share/doc/groonga/ja/html/suggest.html +7 -11
  278. data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +7 -7
  279. data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +7 -7
  280. data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +20 -20
  281. data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +7 -7
  282. data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +7 -7
  283. data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +93 -115
  284. data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +7 -7
  285. data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +7 -7
  286. data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +7 -7
  287. data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +8 -8
  288. data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +7 -7
  289. data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +8 -7
  290. data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +7 -7
  291. data/vendor/local/share/doc/groonga/ja/html/tutorial.html +21 -21
  292. data/vendor/local/share/doc/groonga/ja/html/type.html +31 -31
  293. data/vendor/local/share/doc/groonga/source/characteristic.txt +42 -32
  294. data/vendor/local/share/doc/groonga/source/commands/delete.txt +5 -1
  295. data/vendor/local/share/doc/groonga/source/commands/table_create.txt +5 -2
  296. data/vendor/local/share/doc/groonga/source/community.txt +4 -3
  297. data/vendor/local/share/doc/groonga/source/contribution.txt +8 -6
  298. data/vendor/local/share/doc/groonga/source/example/tutorial/data-1.log +8 -8
  299. data/vendor/local/share/doc/groonga/source/example/tutorial/data-2.log +4 -4
  300. data/vendor/local/share/doc/groonga/source/example/tutorial/data-3.log +4 -4
  301. data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-1.log +3 -15
  302. data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-2.log +2 -7
  303. data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-3.log +2 -7
  304. data/vendor/local/share/doc/groonga/source/functions/geo_distance.txt +42 -3
  305. data/vendor/local/share/doc/groonga/source/functions/geo_in_circle.txt +26 -1
  306. data/vendor/local/share/doc/groonga/source/index.txt +2 -2
  307. data/vendor/local/share/doc/groonga/source/install.txt +102 -27
  308. data/vendor/local/share/doc/groonga/source/limitations.txt +10 -10
  309. data/vendor/local/share/doc/groonga/source/news.txt +130 -21
  310. data/vendor/local/share/doc/groonga/source/output.txt +164 -0
  311. data/vendor/local/share/doc/groonga/source/reference.txt +1 -0
  312. data/vendor/local/share/doc/groonga/source/suggest.txt +0 -5
  313. data/vendor/local/share/doc/groonga/source/tutorial/data.txt +6 -4
  314. data/vendor/local/share/doc/groonga/source/tutorial/drilldown.txt +1 -3
  315. data/vendor/local/share/doc/groonga/source/tutorial/index.txt +2 -1
  316. data/vendor/local/share/doc/groonga/source/tutorial/introduction.txt +95 -116
  317. data/vendor/local/share/doc/groonga/source/tutorial/match_columns.txt +1 -4
  318. data/vendor/local/share/doc/groonga/source/tutorial/micro_blog.txt +1 -4
  319. data/vendor/local/share/doc/groonga/source/tutorial/network.txt +3 -0
  320. data/vendor/local/share/doc/groonga/source/tutorial/patricia_trie.txt +1 -2
  321. data/vendor/local/share/doc/groonga/source/tutorial/query_expansion.txt +5 -0
  322. data/vendor/local/share/doc/groonga/source/tutorial/search.txt +3 -0
  323. data/vendor/local/share/doc/groonga/source/tutorial.txt +2 -2
  324. data/vendor/local/share/doc/groonga/source/type.txt +3 -3
  325. data/vendor/local/share/groonga/examples/dictionary/html/js/dictionary.js +1 -0
  326. data/vendor/local/share/groonga/html/admin/index.html +40 -0
  327. data/vendor/local/share/groonga/html/admin/js/jquery.flot-0.7.min.js +6 -0
  328. data/vendor/local/share/groonga/html/admin/js/jquery.flot.license.txt +22 -0
  329. data/vendor/local/share/man/ja/man1/groonga.1 +560 -138
  330. data/vendor/local/share/man/man1/groonga.1 +637 -223
  331. metadata +887 -898
  332. data/ext/groonga/Makefile +0 -184
  333. data/ext/groonga/rb-grn-query.c +0 -260
  334. data/test/test-query.rb +0 -22
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8; mode: ruby -*-
2
2
  #
3
- # Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2009-2012 Kouhei Sutou <kou@clear-code.com>
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -168,7 +168,38 @@ relative_binary_dir = File.join("vendor", "local")
168
168
  vendor_dir = File.join(base_dir, relative_vendor_dir)
169
169
  binary_dir = File.join(base_dir, relative_binary_dir)
170
170
 
171
- groonga_win32_i386_p = ENV["GROONGA32"] == "yes"
171
+ groonga_win32_i386_p = ENV["GROONGA64"] != "yes"
172
+
173
+ namespace :win32 do
174
+ namespace :groonga do
175
+ task :download do
176
+ require "open-uri"
177
+ require "rroonga-build"
178
+ groonga_version = RroongaBuild::RequiredGroongaVersion::VERSION.join(".")
179
+ base_name = "groonga-#{groonga_version}-"
180
+ if groonga_win32_i386_p
181
+ base_name << "x86"
182
+ else
183
+ base_name << "x64"
184
+ end
185
+ base_name << ".zip"
186
+ base_url = "http://packages.groonga.org/windows/groonga/"
187
+ Dir.chdir(base_dir) do
188
+ unless File.exist?(base_name)
189
+ open("#{base_url}#{base_name}", "rb") do |zip|
190
+ File.open(base_name, "wb") do |output|
191
+ output.print(zip.read)
192
+ end
193
+ end
194
+ end
195
+ sh("unzip", base_name)
196
+ rm_rf(relative_binary_dir)
197
+ mkdir_p(File.dirname(relative_binary_dir))
198
+ mv(File.basename(base_name, ".*"), relative_binary_dir)
199
+ end
200
+ end
201
+ end
202
+ end
172
203
 
173
204
  Rake::ExtensionTask.new("groonga", spec) do |ext|
174
205
  if groonga_win32_i386_p
data/benchmark/common.rb CHANGED
@@ -35,7 +35,7 @@ def report(index=0)
35
35
  end
36
36
 
37
37
  if index.zero?
38
- puts(" " * (width - 1) + Benchmark::Tms::CAPTION.rstrip + "memory".rjust(14))
38
+ puts(" " * (width - 1) + Benchmark::Tms::CAPTION.rstrip + "memory".rjust(11))
39
39
  end
40
40
  # GC.disable
41
41
  before = memory_usage
@@ -44,6 +44,6 @@ def report(index=0)
44
44
  GC.start
45
45
  size = memory_usage - before
46
46
 
47
- formatted_size = "%10.3f" % size
47
+ formatted_size = "%7.3f" % size
48
48
  puts "#{label.ljust(width)} #{result.to_s.strip} #{formatted_size}MB"
49
49
  end
@@ -3,32 +3,31 @@
3
3
  # This benchmark is based on Tokyo Cabinet's benchmark at
4
4
  # http://alpha.mixi.co.jp/blog/?p=791
5
5
  #
6
- # On my environment at 2009/07/14:
7
- # % for x in {0..9}; do ruby benchmark/read-write-many-small-items.rb $x; done
8
- # user system total real memory
9
- # Hash 0.850000 0.170000 1.020000 ( 1.050703) 46.957MB
10
- # groonga: Hash: memory 1.080000 0.180000 1.260000 ( 1.251981) 30.152MB
11
- # groonga: Trie: memory 1.300000 0.120000 1.420000 ( 1.429549) 22.199MB
12
- # groonga: Hash: file 1.070000 0.190000 1.260000 ( 1.276910) 30.156MB
13
- # groonga: Trie: file 1.280000 0.150000 1.430000 ( 1.423066) 22.203MB
14
- # Localmemcache: file 1.320000 0.150000 1.470000 ( 1.497013) 45.984MB
15
- # TC: Hash: memory 0.940000 0.250000 1.190000 ( 1.248141) 48.758MB
16
- # TC: Tree: memory 0.890000 0.140000 1.030000 ( 1.067693) 37.270MB
17
- # TC: Hash: file 1.740000 2.390000 4.130000 ( 4.141555) 8.848MB
18
- # TC: Tree: file 1.290000 0.180000 1.470000 ( 1.476853) 12.805MB
6
+ # On my environment at 2012/01/25:
7
+ # % for x in {0..8}; do ruby1.9.1 benchmark/read-write-many-small-items.rb $x; done
8
+ # user system total real memory
9
+ # Hash 0.410000 0.000000 0.410000 ( 0.412228) 44.895MB
10
+ # groonga: Hash 0.910000 0.030000 0.940000 ( 0.938278) 38.863MB
11
+ # groonga: PatriciaTrie 1.050000 0.020000 1.070000 ( 1.076237) 34.832MB
12
+ # groonga: DoubleArrayTrie 1.050000 0.040000 1.090000 ( 1.083912) 34.852MB
13
+ # Localmemcache: file 0.610000 0.040000 0.650000 ( 0.641539) 61.441MB
14
+ # TC: Hash: memory 0.470000 0.010000 0.480000 ( 0.477577) 55.910MB
15
+ # TC: Tree: memory 0.430000 0.010000 0.440000 ( 0.441939) 44.484MB
16
+ # TC: Hash: file 0.980000 0.990000 1.970000 ( 1.971581) 17.684MB
17
+ # TC: Tree: file 0.650000 0.030000 0.680000 ( 0.683004) 19.801MB
19
18
  #
20
- # CPU: Intel(R) Core(TM)2 Duo 2.33GHz
21
- # Memory: 2GB
22
- # Ruby: Debian GNU/Linux sid at 2009/07/14:
23
- # ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
24
- # groonga: HEAD at 2009/07/14: fdaf58df5dd0195c10624eabee3e3f522f4af3f9
25
- # Ruby/Groonga: trunk at 2009/07/14: r479
26
- # Localmemcache: HEAD at 2009/07/14: 3121629016344dfd10f7533ca8ec68a0006cca21
27
- # Tokyo Cabinet: 1.4.29
28
- # Tokyo Cabinet Ruby: 1.27
19
+ # CPU: Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz stepping 05
20
+ # Memory: 8GB
21
+ # Ruby: Debian GNU/Linux sid at 2012/01/25:
22
+ # ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
23
+ # groonga: HEAD at 2012/01/25: 07dce043cc8cfbbecbcdc43bf7c6d5c2d085237a
24
+ # rroonga: master at 2012/01/25: 29099bff93377733d81dc2398c3403e1293301dc
25
+ # Localmemcache: 0.4.4
26
+ # Tokyo Cabinet: 1.4.37
27
+ # Tokyo Cabinet Ruby: 1.31
29
28
  #
30
29
  # NOTE:
31
- # * groonga, Localmemcache and Tokyo Cabinet are built with "-O3" option.
30
+ # * groonga, Localmemcache and Tokyo Cabinet are built with "-O2" option.
32
31
  # * Ruby bindings of them are built with "-O2" option.
33
32
 
34
33
  require File.join(File.dirname(__FILE__), "common.rb")
@@ -40,44 +39,54 @@ n.times do |i|
40
39
  values << "%08d" % i
41
40
  end
42
41
 
42
+ ruby_hash = {}
43
43
  item("Hash") do
44
- @hash = {}
45
44
  values.each do |value|
46
- @hash[value] = value
47
- @hash[value]
45
+ ruby_hash[value] = value
46
+ ruby_hash[value]
48
47
  end
49
48
  end
50
49
 
51
50
  begin
52
51
  base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
53
- $LOAD_PATH.unshift(File.join(base_dir, "ext"))
52
+ $LOAD_PATH.unshift(File.join(base_dir, "ext", "groonga"))
54
53
  $LOAD_PATH.unshift(File.join(base_dir, "lib"))
55
54
 
56
55
  require 'groonga'
57
56
  tmp_dir = "/tmp/groonga"
58
57
  FileUtils.rm_rf(tmp_dir)
59
58
  FileUtils.mkdir(tmp_dir)
59
+ Groonga::Context.default.encoding = :none
60
60
  @database = Groonga::Database.create(:path => "#{tmp_dir}/db")
61
+ column_name = "value"
61
62
 
62
- item("groonga: Hash: file") do
63
- @hash = Groonga::Hash.create(:name => "Hash",
64
- :key_type => "ShortText")
65
- column_name = "value"
66
- @column = @hash.define_column(column_name, "ShortText")
63
+ groonga_hash = Groonga::Hash.create(:name => "Hash",
64
+ :key_type => "ShortText")
65
+ groonga_hash.define_column(column_name, "ShortText")
66
+ item("groonga: Hash") do
67
67
  values.each do |value|
68
- @hash.set_column_value(value, column_name, value)
69
- @hash.column_value(value, column_name)
68
+ groonga_hash.set_column_value(value, column_name, value)
69
+ groonga_hash.column_value(value, column_name)
70
70
  end
71
71
  end
72
72
 
73
- item("groonga: Trie: file") do
74
- @trie = Groonga::PatriciaTrie.create(:name => "PatriciaTrie",
75
- :key_type => "ShortText")
76
- column_name = "value"
77
- @column = @trie.define_column(column_name, "ShortText")
73
+ patricia_trie = Groonga::PatriciaTrie.create(:name => "PatriciaTrie",
74
+ :key_type => "ShortText")
75
+ patricia_trie.define_column(column_name, "ShortText")
76
+ item("groonga: PatriciaTrie") do
78
77
  values.each do |value|
79
- @trie.set_column_value(value, column_name, value)
80
- @trie.column_value(value, column_name)
78
+ patricia_trie.set_column_value(value, column_name, value)
79
+ patricia_trie.column_value(value, column_name)
80
+ end
81
+ end
82
+
83
+ double_array_trie = Groonga::DoubleArrayTrie.create(:name => "DoubleArrayTrie",
84
+ :key_type => "ShortText")
85
+ double_array_trie.define_column(column_name, "ShortText")
86
+ item("groonga: DoubleArrayTrie") do
87
+ values.each do |value|
88
+ patricia_trie.set_column_value(value, column_name, value)
89
+ patricia_trie.column_value(value, column_name)
81
90
  end
82
91
  end
83
92
  rescue LoadError
@@ -86,13 +95,13 @@ end
86
95
  begin
87
96
  require 'localmemcache'
88
97
 
98
+ LocalMemCache.drop(:namespace => "read-write-many-small-items",
99
+ :force => true)
100
+ mem_cache = LocalMemCache.new(:namespace => "read-write-many-small-items")
89
101
  item("Localmemcache: file") do
90
- LocalMemCache.drop(:namespace => "read-write-many-small-items",
91
- :force => true)
92
- @db = LocalMemCache.new(:namespace => "read-write-many-small-items")
93
102
  values.each do |value|
94
- @db[value] = value
95
- @db[value]
103
+ mem_cache[value] = value
104
+ mem_cache[value]
96
105
  end
97
106
  end
98
107
  rescue LoadError
@@ -101,41 +110,41 @@ end
101
110
  begin
102
111
  require 'tokyocabinet'
103
112
 
113
+ tc_hash_memory = TokyoCabinet::ADB::new
114
+ tc_hash_memory.open("*#bnum=#{n}#mode=wct#xmsiz=0")
104
115
  item("TC: Hash: memory") do
105
- @db = TokyoCabinet::ADB::new
106
- @db.open("*#bnum=#{n}#mode=wct#xmsiz=0")
107
116
  values.each do |value|
108
- @db.put(value, value)
109
- @db.get(value)
117
+ tc_hash_memory.put(value, value)
118
+ tc_hash_memory.get(value)
110
119
  end
111
120
  end
112
121
 
122
+ tc_tree_memory = TokyoCabinet::ADB::new
123
+ tc_tree_memory.open("+#bnum=#{n}#mode=wct#xmsiz=0")
113
124
  item("TC: Tree: memory") do
114
- @db = TokyoCabinet::ADB::new
115
- @db.open("+#bnum=#{n}#mode=wct#xmsiz=0")
116
125
  values.each do |value|
117
- @db.put(value, value)
118
- @db.get(value)
126
+ tc_tree_memory.put(value, value)
127
+ tc_tree_memory.get(value)
119
128
  end
120
129
  end
121
130
 
122
131
  hash_file = Tempfile.new(["tc-hash", ".tch"])
132
+ tc_hash_file = TokyoCabinet::ADB::new
133
+ tc_hash_file.open("#{hash_file.path}#bnum=#{n}#mode=wct#xmsiz=0")
123
134
  item("TC: Hash: file") do
124
- @db = TokyoCabinet::ADB::new
125
- @db.open("#{hash_file.path}#bnum=#{n}#mode=wct#xmsiz=0")
126
135
  values.each do |value|
127
- @db.put(value, value)
128
- @db.get(value)
136
+ tc_hash_file.put(value, value)
137
+ tc_hash_file.get(value)
129
138
  end
130
139
  end
131
140
 
132
141
  tree_file = Tempfile.new(["tc-tree", ".tcb"])
142
+ tc_tree_file = TokyoCabinet::ADB::new
143
+ tc_tree_file.open("#{tree_file.path}#bnum=#{n}#mode=wct#xmsiz=0")
133
144
  item("TC: Tree: file") do
134
- @db = TokyoCabinet::ADB::new
135
- @db.open("#{tree_file.path}#bnum=#{n}#mode=wct#xmsiz=0")
136
145
  values.each do |value|
137
- @db.put(value, value)
138
- @db.get(value)
146
+ tc_tree_file.put(value, value)
147
+ tc_tree_file.get(value)
139
148
  end
140
149
  end
141
150
  rescue LoadError
@@ -3,32 +3,31 @@
3
3
  # This benchmark is based on Tokyo Cabinet's benchmark at
4
4
  # http://alpha.mixi.co.jp/blog/?p=791
5
5
  #
6
- # On my environment at 2009/07/14:
7
- # % for x in {0..9}; do ruby benchmark/write-many-small-items.rb $x; done
8
- # user system total real memory
9
- # Hash 0.650000 0.130000 0.780000 ( 0.799843) 46.957MB
10
- # groonga: Hash: memory 0.650000 0.130000 0.780000 ( 0.781058) 23.477MB
11
- # groonga: Trie: memory 0.690000 0.180000 0.870000 ( 0.862132) 15.516MB
12
- # groonga: Hash: file 0.660000 0.120000 0.780000 ( 0.780952) 23.480MB
13
- # groonga: Trie: file 0.660000 0.190000 0.850000 ( 0.867515) 15.520MB
14
- # Localmemcache: file 0.900000 0.150000 1.050000 ( 1.052692) 39.312MB
15
- # TC: Hash: memory 0.480000 0.150000 0.630000 ( 0.636297) 42.062MB
16
- # TC: Tree: memory 0.440000 0.150000 0.590000 ( 0.593117) 30.570MB
17
- # TC: Hash: file 1.000000 1.820000 2.820000 ( 2.989515) 2.160MB
18
- # TC: Tree: file 0.720000 0.130000 0.850000 ( 0.877557) 6.102MB
6
+ # On my environment at 2012/01/25:
7
+ # % for x in {0..8}; do ruby1.9.1 benchmark/write-many-small-items.rb $x; done
8
+ # user system total real memory
9
+ # Hash 0.320000 0.030000 0.350000 ( 0.345441) 44.910MB
10
+ # groonga: Hash 0.490000 0.020000 0.510000 ( 0.512336) 23.305MB
11
+ # groonga: PatriciaTrie 0.560000 0.010000 0.570000 ( 0.572077) 19.242MB
12
+ # groonga: DoubleArrayTrie 0.700000 0.020000 0.720000 ( 0.730448) 39.789MB
13
+ # Localmemcache: file 0.510000 0.040000 0.550000 ( 0.549663) 45.898MB
14
+ # TC: Hash: memory 0.270000 0.020000 0.290000 ( 0.292051) 40.148MB
15
+ # TC: Tree: memory 0.220000 0.010000 0.230000 ( 0.229233) 28.727MB
16
+ # TC: Hash: file 0.610000 0.630000 1.240000 ( 1.247094) 2.129MB
17
+ # TC: Tree: file 0.340000 0.040000 0.380000 ( 0.377910) 4.000MB
19
18
  #
20
- # CPU: Intel(R) Core(TM)2 Duo 2.33GHz
21
- # Memory: 2GB
22
- # Ruby: Debian GNU/Linux sid at 2009/07/14:
23
- # ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
24
- # groonga: HEAD at 2009/07/14: fdaf58df5dd0195c10624eabee3e3f522f4af3f9
25
- # Ruby/Groonga: trunk at 2009/07/14: r479
26
- # Localmemcache: HEAD at 2009/07/14: 3121629016344dfd10f7533ca8ec68a0006cca21
27
- # Tokyo Cabinet: 1.4.29
28
- # Tokyo Cabinet Ruby: 1.27
19
+ # CPU: Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz stepping 05
20
+ # Memory: 8GB
21
+ # Ruby: Debian GNU/Linux sid at 2012/01/25:
22
+ # ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
23
+ # groonga: HEAD at 2012/01/25: 07dce043cc8cfbbecbcdc43bf7c6d5c2d085237a
24
+ # rroonga: master at 2012/01/25: 29099bff93377733d81dc2398c3403e1293301dc
25
+ # Localmemcache: 0.4.4
26
+ # Tokyo Cabinet: 1.4.37
27
+ # Tokyo Cabinet Ruby: 1.31
29
28
  #
30
29
  # NOTE:
31
- # * groonga, Localmemcache and Tokyo Cabinet are built with "-O3" option.
30
+ # * groonga, Localmemcache and Tokyo Cabinet are built with "-O2" option.
32
31
  # * Ruby bindings of them are built with "-O2" option.
33
32
 
34
33
  require File.join(File.dirname(__FILE__), "common.rb")
@@ -40,41 +39,50 @@ n.times do |i|
40
39
  values << "%08d" % i
41
40
  end
42
41
 
42
+ ruby_hash = {}
43
43
  item("Hash") do
44
- @hash = {}
45
44
  values.each do |value|
46
- @hash[value] = value
45
+ ruby_hash[value] = value
47
46
  end
48
47
  end
49
48
 
50
49
  begin
51
50
  base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
52
- $LOAD_PATH.unshift(File.join(base_dir, "ext"))
51
+ $LOAD_PATH.unshift(File.join(base_dir, "ext", "groonga"))
53
52
  $LOAD_PATH.unshift(File.join(base_dir, "lib"))
54
53
 
55
54
  require 'groonga'
56
55
  tmp_dir = "/tmp/groonga"
57
56
  FileUtils.rm_rf(tmp_dir)
58
57
  FileUtils.mkdir(tmp_dir)
58
+ Groonga::Context.default.encoding = :none
59
59
  @database = Groonga::Database.create(:path => "#{tmp_dir}/db")
60
+ column_name = "value"
60
61
 
61
- item("groonga: Hash: file") do
62
- @hash = Groonga::Hash.create(:name => "Hash",
63
- :key_type => "ShortText")
64
- column_name = "value"
65
- @column = @hash.define_column(column_name, "ShortText")
62
+ groonga_hash = Groonga::Hash.create(:name => "Hash",
63
+ :key_type => "ShortText")
64
+ groonga_hash.define_column(column_name, "ShortText")
65
+ item("groonga: Hash") do
66
66
  values.each do |value|
67
- @hash.set_column_value(value, column_name, value)
67
+ groonga_hash.set_column_value(value, column_name, value)
68
68
  end
69
69
  end
70
70
 
71
- item("groonga: Trie: file") do
72
- @trie = Groonga::PatriciaTrie.create(:name => "PatriciaTrie",
73
- :key_type => "ShortText")
74
- column_name = "value"
75
- @column = @trie.define_column(column_name, "ShortText")
71
+ patricia_trie = Groonga::PatriciaTrie.create(:name => "PatriciaTrie",
72
+ :key_type => "ShortText")
73
+ patricia_trie.define_column(column_name, "ShortText")
74
+ item("groonga: PatriciaTrie") do
76
75
  values.each do |value|
77
- @trie.set_column_value(value, column_name, value)
76
+ patricia_trie.set_column_value(value, column_name, value)
77
+ end
78
+ end
79
+
80
+ double_array_trie = Groonga::DoubleArrayTrie.create(:name => "DoubleArrayTrie",
81
+ :key_type => "ShortText")
82
+ double_array_trie.define_column(column_name, "ShortText")
83
+ item("groonga: DoubleArrayTrie") do
84
+ values.each do |value|
85
+ double_array_trie.set_column_value(value, column_name, value)
78
86
  end
79
87
  end
80
88
  rescue LoadError
@@ -83,11 +91,11 @@ end
83
91
  begin
84
92
  require 'localmemcache'
85
93
 
94
+ LocalMemCache.drop(:namespace => "write-many-small-items", :force => true)
95
+ mem_cache = LocalMemCache.new(:namespace => "write-many-small-items")
86
96
  item("Localmemcache: file") do
87
- LocalMemCache.drop(:namespace => "write-many-small-items", :force => true)
88
- @db = LocalMemCache.new(:namespace => "write-many-small-items")
89
97
  values.each do |value|
90
- @db[value] = value
98
+ mem_cache[value] = value
91
99
  end
92
100
  end
93
101
  rescue LoadError
@@ -96,37 +104,37 @@ end
96
104
  begin
97
105
  require 'tokyocabinet'
98
106
 
107
+ tc_hash_memory = TokyoCabinet::ADB::new
108
+ tc_hash_memory.open("*#bnum=#{n}#mode=wct#xmsiz=0")
99
109
  item("TC: Hash: memory") do
100
- @db = TokyoCabinet::ADB::new
101
- @db.open("*#bnum=#{n}#mode=wct#xmsiz=0")
102
110
  values.each do |value|
103
- @db.put(value, value)
111
+ tc_hash_memory.put(value, value)
104
112
  end
105
113
  end
106
114
 
115
+ tc_tree_memory = TokyoCabinet::ADB::new
116
+ tc_tree_memory.open("+#bnum=#{n}#mode=wct#xmsiz=0")
107
117
  item("TC: Tree: memory") do
108
- @db = TokyoCabinet::ADB::new
109
- @db.open("+#bnum=#{n}#mode=wct#xmsiz=0")
110
118
  values.each do |value|
111
- @db.put(value, value)
119
+ tc_tree_memory.put(value, value)
112
120
  end
113
121
  end
114
122
 
115
123
  hash_file = Tempfile.new(["tc-hash", ".tch"])
124
+ tc_hash_file = TokyoCabinet::ADB::new
125
+ tc_hash_file.open("#{hash_file.path}#bnum=#{n}#mode=wct#xmsiz=0")
116
126
  item("TC: Hash: file") do
117
- @db = TokyoCabinet::ADB::new
118
- @db.open("#{hash_file.path}#bnum=#{n}#mode=wct#xmsiz=0")
119
127
  values.each do |value|
120
- @db.put(value, value)
128
+ tc_hash_file.put(value, value)
121
129
  end
122
130
  end
123
131
 
124
132
  tree_file = Tempfile.new(["tc-tree", ".tcb"])
133
+ tc_tree_file = TokyoCabinet::ADB::new
134
+ tc_tree_file.open("#{tree_file.path}#bnum=#{n}#mode=wct#xmsiz=0")
125
135
  item("TC: Tree: file") do
126
- @db = TokyoCabinet::ADB::new
127
- @db.open("#{tree_file.path}#bnum=#{n}#mode=wct#xmsiz=0")
128
136
  values.each do |value|
129
- @db.put(value, value)
137
+ tc_tree_file.put(value, value)
130
138
  end
131
139
  end
132
140
  rescue LoadError
@@ -211,13 +211,31 @@ VALUE
211
211
  rb_grn_context_rb_string_encode (grn_ctx *context, VALUE rb_string)
212
212
  {
213
213
  #ifdef HAVE_RUBY_ENCODING_H
214
- rb_encoding *encoding, *to_encode;
214
+ int index, to_index;
215
+ rb_encoding *encoding, *to_encoding;
216
+ grn_encoding context_encoding;
217
+
218
+ context_encoding = context->encoding;
219
+ if (context->encoding == GRN_ENC_DEFAULT)
220
+ context->encoding = grn_get_default_encoding();
221
+ if (context->encoding == GRN_ENC_NONE)
222
+ return rb_string;
223
+
224
+ if (RSTRING_LEN(rb_string) < 0)
225
+ return rb_string;
215
226
 
216
227
  encoding = rb_enc_get(rb_string);
217
- to_encode = rb_grn_encoding_to_ruby_encoding(context->encoding);
218
- if (rb_enc_to_index(encoding) != rb_enc_to_index(to_encode))
219
- rb_string = rb_str_encode(rb_string, rb_enc_from_encoding(to_encode),
220
- 0, Qnil);
228
+ to_encoding = rb_grn_encoding_to_ruby_encoding(context_encoding);
229
+ index = rb_enc_to_index(encoding);
230
+ to_index = rb_enc_to_index(to_encoding);
231
+ if (index == to_index)
232
+ return rb_string;
233
+
234
+ if (rb_enc_asciicompat(to_encoding) && rb_enc_str_asciionly_p(rb_string))
235
+ return rb_string;
236
+
237
+ rb_string = rb_str_encode(rb_string, rb_enc_from_encoding(to_encoding),
238
+ 0, Qnil);
221
239
  #endif
222
240
  return rb_string;
223
241
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; c-file-style: "ruby" -*- */
2
2
  /*
3
- Copyright (C) 2009 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2012 Kouhei Sutou <kou@clear-code.com>
4
4
 
5
5
  This library is free software; you can redistribute it and/or
6
6
  modify it under the terms of the GNU Lesser General Public
@@ -453,11 +453,7 @@ rb_grn_index_column_search (int argc, VALUE *argv, VALUE self)
453
453
 
454
454
  rb_scan_args(argc, argv, "11", &rb_query, &options);
455
455
 
456
- if (CBOOL2RVAL(rb_obj_is_kind_of(rb_query, rb_cGrnQuery))) {
457
- grn_query *_query;
458
- _query = RVAL2GRNQUERY(rb_query);
459
- query = (grn_obj *)_query;
460
- } else if (CBOOL2RVAL(rb_obj_is_kind_of(rb_query, rb_cInteger))) {
456
+ if (CBOOL2RVAL(rb_obj_is_kind_of(rb_query, rb_cInteger))) {
461
457
  grn_id id;
462
458
  id = NUM2UINT(rb_query);
463
459
  GRN_TEXT_SET(context, id_query, &id, sizeof(grn_id));
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; c-file-style: "ruby" -*- */
2
2
  /*
3
- Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2012 Kouhei Sutou <kou@clear-code.com>
4
4
 
5
5
  This library is free software; you can redistribute it and/or
6
6
  modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,36 @@
20
20
 
21
21
  VALUE rb_mGrnOperator;
22
22
 
23
+ grn_operator
24
+ rb_grn_operator_from_ruby_object (VALUE rb_operator)
25
+ {
26
+ grn_operator operator = GRN_OP_OR;
27
+
28
+ if (NIL_P(rb_operator) ||
29
+ rb_grn_equal_option(rb_operator, "or") ||
30
+ rb_grn_equal_option(rb_operator, "||")) {
31
+ operator = GRN_OP_OR;
32
+ } else if (rb_grn_equal_option(rb_operator, "and") ||
33
+ rb_grn_equal_option(rb_operator, "+") ||
34
+ rb_grn_equal_option(rb_operator, "&&")) {
35
+ operator = GRN_OP_AND;
36
+ } else if (rb_grn_equal_option(rb_operator, "but") ||
37
+ rb_grn_equal_option(rb_operator, "not") ||
38
+ rb_grn_equal_option(rb_operator, "-")) {
39
+ operator = GRN_OP_BUT;
40
+ } else if (rb_grn_equal_option(rb_operator, "adjust") ||
41
+ rb_grn_equal_option(rb_operator, ">")) {
42
+ operator = GRN_OP_ADJUST;
43
+ } else {
44
+ rb_raise(rb_eArgError,
45
+ "operator should be one of "
46
+ "[:or, :||, :and, :+, :&&, :but, :not, :-, :adjust, :>]: <%s>",
47
+ rb_grn_inspect(rb_operator));
48
+ }
49
+
50
+ return operator;
51
+ }
52
+
23
53
  void
24
54
  rb_grn_init_operator (VALUE mGrn)
25
55
  {
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; c-file-style: "ruby" -*- */
2
2
  /*
3
- Copyright (C) 2009 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2011 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
@@ -28,6 +28,80 @@ VALUE rb_cGrnVariableSizeColumn;
28
28
  * 可変長データ用のカラム。
29
29
  */
30
30
 
31
+ /*
32
+ * Document-method: compressed?
33
+ *
34
+ * call-seq:
35
+ * column.compressed? -> boolean
36
+ * column.compressed?(type) -> boolean
37
+ *
38
+ * Returns whether the column is compressed or not. If
39
+ * @type@ is specified, it returns whether the column is
40
+ * compressed by @type@ or not.
41
+ *
42
+ * @return [Boolean] whether the column is compressed or not.
43
+ * @param [:zlib, :lzo] type (nil) If @type@ isn't @nil@,
44
+ * it checks whether specified compressed type is used or
45
+ * not.
46
+ * @since 1.3.1
47
+ */
48
+ static VALUE
49
+ rb_grn_variable_size_column_compressed_p (int argc, VALUE *argv, VALUE self)
50
+ {
51
+ RbGrnColumn *rb_grn_column;
52
+ grn_ctx *context = NULL;
53
+ grn_obj *column;
54
+ grn_obj_flags flags;
55
+ VALUE type;
56
+ grn_bool compressed_p = GRN_FALSE;
57
+ grn_bool accept_any_type = GRN_FALSE;
58
+ grn_bool need_zlib_check = GRN_FALSE;
59
+ grn_bool need_lzo_check = GRN_FALSE;
60
+
61
+ rb_scan_args(argc, argv, "01", &type);
62
+
63
+ if (NIL_P(type)) {
64
+ accept_any_type = GRN_TRUE;
65
+ } else {
66
+ if (rb_grn_equal_option(type, "zlib")) {
67
+ need_zlib_check = GRN_TRUE;
68
+ } else if (rb_grn_equal_option(type, "lzo")) {
69
+ need_lzo_check = GRN_TRUE;
70
+ } else {
71
+ rb_raise(rb_eArgError,
72
+ "compressed type should be <:zlib> or <:lzo>: <%s>",
73
+ rb_grn_inspect(type));
74
+ }
75
+ }
76
+
77
+ rb_grn_column = SELF(self);
78
+ rb_grn_object_deconstruct(RB_GRN_OBJECT(rb_grn_column), &column, &context,
79
+ NULL, NULL,
80
+ NULL, NULL);
81
+
82
+ flags = column->header.flags;
83
+ switch (flags & GRN_OBJ_COMPRESS_MASK) {
84
+ case GRN_OBJ_COMPRESS_ZLIB:
85
+ if (accept_any_type || need_zlib_check) {
86
+ grn_obj support_p;
87
+ GRN_BOOL_INIT(&support_p, 0);
88
+ grn_obj_get_info(context, NULL, GRN_INFO_SUPPORT_ZLIB, &support_p);
89
+ compressed_p = GRN_BOOL_VALUE(&support_p);
90
+ }
91
+ break;
92
+ case GRN_OBJ_COMPRESS_LZO:
93
+ if (accept_any_type || need_lzo_check) {
94
+ grn_obj support_p;
95
+ GRN_BOOL_INIT(&support_p, 0);
96
+ grn_obj_get_info(context, NULL, GRN_INFO_SUPPORT_LZO, &support_p);
97
+ compressed_p = GRN_BOOL_VALUE(&support_p);
98
+ }
99
+ break;
100
+ }
101
+
102
+ return CBOOL2RVAL(compressed_p);
103
+ }
104
+
31
105
  /*
32
106
  * Document-method: defrag
33
107
  *
@@ -77,6 +151,8 @@ rb_grn_init_variable_size_column (VALUE mGrn)
77
151
  rb_cGrnVariableSizeColumn =
78
152
  rb_define_class_under(mGrn, "VariableSizeColumn", rb_cGrnColumn);
79
153
 
154
+ rb_define_method(rb_cGrnVariableSizeColumn, "compressed?",
155
+ rb_grn_variable_size_column_compressed_p, -1);
80
156
  rb_define_method(rb_cGrnVariableSizeColumn, "defrag",
81
157
  rb_grn_variable_size_column_defrag, -1);
82
158
  }