rroonga 2.0.2-x86-mingw32 → 2.0.3-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (398) hide show
  1. data/AUTHORS +5 -0
  2. data/Gemfile +1 -12
  3. data/README.textile +73 -0
  4. data/Rakefile +4 -57
  5. data/bin/grndump +11 -1
  6. data/ext/groonga/extconf.rb +125 -54
  7. data/ext/groonga/rb-grn-context.c +25 -7
  8. data/ext/groonga/rb-grn-database.c +25 -0
  9. data/ext/groonga/rb-grn-object.c +19 -7
  10. data/ext/groonga/rb-grn-table.c +8 -10
  11. data/ext/groonga/rb-grn.h +9 -2
  12. data/lib/1.8/groonga.so +0 -0
  13. data/lib/1.9/groonga.so +0 -0
  14. data/lib/groonga/dumper.rb +2 -2
  15. data/lib/groonga/expression-builder.rb +33 -18
  16. data/rroonga-build.rb +1 -1
  17. data/vendor/local/bin/groonga-benchmark.exe +0 -0
  18. data/vendor/local/bin/groonga.exe +0 -0
  19. data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
  20. data/vendor/local/bin/libgroonga-0.dll +0 -0
  21. data/vendor/local/bin/libmecab-1.dll +0 -0
  22. data/vendor/local/bin/libmsgpack-3.dll +0 -0
  23. data/vendor/local/bin/libmsgpackc-2.dll +0 -0
  24. data/vendor/local/bin/libstdc++-6.dll +0 -0
  25. data/vendor/local/bin/mecab-config +0 -0
  26. data/vendor/local/bin/mecab.exe +0 -0
  27. data/vendor/local/include/groonga/groonga.h +5 -5
  28. data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
  29. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
  30. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
  31. data/vendor/local/lib/groonga/plugins/suggest/suggest.la +0 -0
  32. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.a +0 -0
  33. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll +0 -0
  34. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll.a +0 -0
  35. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.la +0 -0
  36. data/vendor/local/lib/libgroonga.a +0 -0
  37. data/vendor/local/lib/libgroonga.dll.a +0 -0
  38. data/vendor/local/lib/libgroonga.la +0 -0
  39. data/vendor/local/lib/libmecab.a +0 -0
  40. data/vendor/local/lib/libmecab.dll.a +0 -0
  41. data/vendor/local/lib/libmecab.la +0 -0
  42. data/vendor/local/lib/libmsgpack.a +0 -0
  43. data/vendor/local/lib/libmsgpack.dll.a +0 -0
  44. data/vendor/local/lib/libmsgpack.la +0 -0
  45. data/vendor/local/lib/libmsgpackc.a +0 -0
  46. data/vendor/local/lib/libmsgpackc.dll.a +0 -0
  47. data/vendor/local/lib/libmsgpackc.la +0 -0
  48. data/vendor/local/lib/pkgconfig/groonga.pc +4 -4
  49. data/vendor/local/libexec/mecab/mecab-cost-train.exe +0 -0
  50. data/vendor/local/libexec/mecab/mecab-dict-gen.exe +0 -0
  51. data/vendor/local/libexec/mecab/mecab-dict-index.exe +0 -0
  52. data/vendor/local/libexec/mecab/mecab-system-eval.exe +0 -0
  53. data/vendor/local/libexec/mecab/mecab-test-gen.exe +0 -0
  54. data/vendor/local/share/doc/groonga/en/html/.buildinfo +1 -1
  55. data/vendor/local/share/doc/groonga/en/html/_sources/commands/select.txt +349 -109
  56. data/vendor/local/share/doc/groonga/en/html/_sources/install.txt +41 -10
  57. data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +71 -0
  58. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/data.txt +1 -1
  59. data/vendor/local/share/doc/groonga/en/html/_static/jquery.js +154 -4
  60. data/vendor/local/share/doc/groonga/en/html/_static/underscore.js +21 -29
  61. data/vendor/local/share/doc/groonga/en/html/characteristic.html +5 -5
  62. data/vendor/local/share/doc/groonga/en/html/command_version.html +5 -5
  63. data/vendor/local/share/doc/groonga/en/html/commands/cache_limit.html +5 -5
  64. data/vendor/local/share/doc/groonga/en/html/commands/check.html +5 -5
  65. data/vendor/local/share/doc/groonga/en/html/commands/clearlock.html +5 -5
  66. data/vendor/local/share/doc/groonga/en/html/commands/column_create.html +5 -5
  67. data/vendor/local/share/doc/groonga/en/html/commands/column_list.html +5 -5
  68. data/vendor/local/share/doc/groonga/en/html/commands/column_remove.html +5 -5
  69. data/vendor/local/share/doc/groonga/en/html/commands/define_selector.html +5 -5
  70. data/vendor/local/share/doc/groonga/en/html/commands/defrag.html +5 -5
  71. data/vendor/local/share/doc/groonga/en/html/commands/delete.html +5 -5
  72. data/vendor/local/share/doc/groonga/en/html/commands/dump.html +5 -5
  73. data/vendor/local/share/doc/groonga/en/html/commands/load.html +5 -5
  74. data/vendor/local/share/doc/groonga/en/html/commands/log_level.html +5 -5
  75. data/vendor/local/share/doc/groonga/en/html/commands/log_put.html +5 -5
  76. data/vendor/local/share/doc/groonga/en/html/commands/log_reopen.html +5 -5
  77. data/vendor/local/share/doc/groonga/en/html/commands/quit.html +5 -5
  78. data/vendor/local/share/doc/groonga/en/html/commands/select.html +683 -162
  79. data/vendor/local/share/doc/groonga/en/html/commands/shutdown.html +5 -5
  80. data/vendor/local/share/doc/groonga/en/html/commands/status.html +5 -5
  81. data/vendor/local/share/doc/groonga/en/html/commands/suggest.html +170 -12
  82. data/vendor/local/share/doc/groonga/en/html/commands/table_create.html +5 -5
  83. data/vendor/local/share/doc/groonga/en/html/commands/table_list.html +5 -5
  84. data/vendor/local/share/doc/groonga/en/html/commands/table_remove.html +5 -5
  85. data/vendor/local/share/doc/groonga/en/html/commands/view_add.html +5 -5
  86. data/vendor/local/share/doc/groonga/en/html/commands.html +5 -5
  87. data/vendor/local/share/doc/groonga/en/html/community.html +5 -5
  88. data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +5 -5
  89. data/vendor/local/share/doc/groonga/en/html/contribution/development/document.html +5 -5
  90. data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +5 -5
  91. data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +5 -5
  92. data/vendor/local/share/doc/groonga/en/html/contribution/development.html +5 -5
  93. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +5 -5
  94. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +5 -5
  95. data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +5 -5
  96. data/vendor/local/share/doc/groonga/en/html/contribution/report.html +5 -5
  97. data/vendor/local/share/doc/groonga/en/html/contribution.html +5 -5
  98. data/vendor/local/share/doc/groonga/en/html/executables/grnslap.html +5 -5
  99. data/vendor/local/share/doc/groonga/en/html/executables/grntest.html +5 -5
  100. data/vendor/local/share/doc/groonga/en/html/executables/groonga-http.html +5 -5
  101. data/vendor/local/share/doc/groonga/en/html/executables/groonga-suggest-create-dataset.html +5 -5
  102. data/vendor/local/share/doc/groonga/en/html/executables/groonga.html +5 -5
  103. data/vendor/local/share/doc/groonga/en/html/executables.html +5 -5
  104. data/vendor/local/share/doc/groonga/en/html/expr.html +5 -5
  105. data/vendor/local/share/doc/groonga/en/html/functions/edit_distance.html +5 -5
  106. data/vendor/local/share/doc/groonga/en/html/functions/geo_distance.html +5 -5
  107. data/vendor/local/share/doc/groonga/en/html/functions/geo_in_circle.html +5 -5
  108. data/vendor/local/share/doc/groonga/en/html/functions/geo_in_rectangle.html +5 -5
  109. data/vendor/local/share/doc/groonga/en/html/functions/now.html +5 -5
  110. data/vendor/local/share/doc/groonga/en/html/functions/rand.html +5 -5
  111. data/vendor/local/share/doc/groonga/en/html/functions.html +5 -5
  112. data/vendor/local/share/doc/groonga/en/html/genindex.html +5 -5
  113. data/vendor/local/share/doc/groonga/en/html/geolocation_search.html +5 -5
  114. data/vendor/local/share/doc/groonga/en/html/index.html +23 -16
  115. data/vendor/local/share/doc/groonga/en/html/indexing.html +95 -14
  116. data/vendor/local/share/doc/groonga/en/html/install.html +67 -37
  117. data/vendor/local/share/doc/groonga/en/html/limitations.html +9 -9
  118. data/vendor/local/share/doc/groonga/en/html/log.html +5 -5
  119. data/vendor/local/share/doc/groonga/en/html/news/0.x.html +5 -5
  120. data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +5 -5
  121. data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +5 -5
  122. data/vendor/local/share/doc/groonga/en/html/news/1.2.x.html +5 -5
  123. data/vendor/local/share/doc/groonga/en/html/news/senna.html +5 -5
  124. data/vendor/local/share/doc/groonga/en/html/news.html +161 -25
  125. data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
  126. data/vendor/local/share/doc/groonga/en/html/output.html +5 -5
  127. data/vendor/local/share/doc/groonga/en/html/pseudo_column.html +5 -5
  128. data/vendor/local/share/doc/groonga/en/html/reference.html +5 -5
  129. data/vendor/local/share/doc/groonga/en/html/search.html +5 -5
  130. data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
  131. data/vendor/local/share/doc/groonga/en/html/spec/search.html +22 -22
  132. data/vendor/local/share/doc/groonga/en/html/spec.html +13 -11
  133. data/vendor/local/share/doc/groonga/en/html/suggest/completion.html +33 -6
  134. data/vendor/local/share/doc/groonga/en/html/suggest/correction.html +33 -6
  135. data/vendor/local/share/doc/groonga/en/html/suggest/introduction.html +5 -5
  136. data/vendor/local/share/doc/groonga/en/html/suggest/suggestion.html +37 -6
  137. data/vendor/local/share/doc/groonga/en/html/suggest/tutorial.html +5 -5
  138. data/vendor/local/share/doc/groonga/en/html/suggest.html +5 -5
  139. data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
  140. data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +5 -5
  141. data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +293 -29
  142. data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +5 -5
  143. data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +340 -27
  144. data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +5 -5
  145. data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +5 -5
  146. data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +282 -24
  147. data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +524 -15
  148. data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +103 -8
  149. data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +128 -13
  150. data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +155 -17
  151. data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +5 -5
  152. data/vendor/local/share/doc/groonga/en/html/tutorial.html +5 -5
  153. data/vendor/local/share/doc/groonga/en/html/type.html +5 -5
  154. data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
  155. data/vendor/local/share/doc/groonga/ja/html/_sources/commands/select.txt +349 -109
  156. data/vendor/local/share/doc/groonga/ja/html/_sources/install.txt +41 -10
  157. data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +71 -0
  158. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/data.txt +1 -1
  159. data/vendor/local/share/doc/groonga/ja/html/_static/jquery.js +154 -4
  160. data/vendor/local/share/doc/groonga/ja/html/_static/underscore.js +21 -29
  161. data/vendor/local/share/doc/groonga/ja/html/characteristic.html +5 -5
  162. data/vendor/local/share/doc/groonga/ja/html/command_version.html +5 -5
  163. data/vendor/local/share/doc/groonga/ja/html/commands/cache_limit.html +5 -5
  164. data/vendor/local/share/doc/groonga/ja/html/commands/check.html +5 -5
  165. data/vendor/local/share/doc/groonga/ja/html/commands/clearlock.html +5 -5
  166. data/vendor/local/share/doc/groonga/ja/html/commands/column_create.html +5 -5
  167. data/vendor/local/share/doc/groonga/ja/html/commands/column_list.html +5 -5
  168. data/vendor/local/share/doc/groonga/ja/html/commands/column_remove.html +5 -5
  169. data/vendor/local/share/doc/groonga/ja/html/commands/define_selector.html +5 -5
  170. data/vendor/local/share/doc/groonga/ja/html/commands/defrag.html +5 -5
  171. data/vendor/local/share/doc/groonga/ja/html/commands/delete.html +5 -5
  172. data/vendor/local/share/doc/groonga/ja/html/commands/dump.html +5 -5
  173. data/vendor/local/share/doc/groonga/ja/html/commands/load.html +5 -5
  174. data/vendor/local/share/doc/groonga/ja/html/commands/log_level.html +5 -5
  175. data/vendor/local/share/doc/groonga/ja/html/commands/log_put.html +5 -5
  176. data/vendor/local/share/doc/groonga/ja/html/commands/log_reopen.html +5 -5
  177. data/vendor/local/share/doc/groonga/ja/html/commands/quit.html +5 -5
  178. data/vendor/local/share/doc/groonga/ja/html/commands/select.html +601 -162
  179. data/vendor/local/share/doc/groonga/ja/html/commands/shutdown.html +5 -5
  180. data/vendor/local/share/doc/groonga/ja/html/commands/status.html +5 -5
  181. data/vendor/local/share/doc/groonga/ja/html/commands/suggest.html +170 -12
  182. data/vendor/local/share/doc/groonga/ja/html/commands/table_create.html +5 -5
  183. data/vendor/local/share/doc/groonga/ja/html/commands/table_list.html +5 -5
  184. data/vendor/local/share/doc/groonga/ja/html/commands/table_remove.html +5 -5
  185. data/vendor/local/share/doc/groonga/ja/html/commands/view_add.html +5 -5
  186. data/vendor/local/share/doc/groonga/ja/html/commands.html +5 -5
  187. data/vendor/local/share/doc/groonga/ja/html/community.html +5 -5
  188. data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +5 -5
  189. data/vendor/local/share/doc/groonga/ja/html/contribution/development/document.html +5 -5
  190. data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +5 -5
  191. data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +5 -5
  192. data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +5 -5
  193. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +5 -5
  194. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +5 -5
  195. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +5 -5
  196. data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +5 -5
  197. data/vendor/local/share/doc/groonga/ja/html/contribution.html +5 -5
  198. data/vendor/local/share/doc/groonga/ja/html/executables/grnslap.html +5 -5
  199. data/vendor/local/share/doc/groonga/ja/html/executables/grntest.html +5 -5
  200. data/vendor/local/share/doc/groonga/ja/html/executables/groonga-http.html +5 -5
  201. data/vendor/local/share/doc/groonga/ja/html/executables/groonga-suggest-create-dataset.html +5 -5
  202. data/vendor/local/share/doc/groonga/ja/html/executables/groonga.html +5 -5
  203. data/vendor/local/share/doc/groonga/ja/html/executables.html +5 -5
  204. data/vendor/local/share/doc/groonga/ja/html/expr.html +5 -5
  205. data/vendor/local/share/doc/groonga/ja/html/functions/edit_distance.html +5 -5
  206. data/vendor/local/share/doc/groonga/ja/html/functions/geo_distance.html +5 -5
  207. data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_circle.html +5 -5
  208. data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_rectangle.html +5 -5
  209. data/vendor/local/share/doc/groonga/ja/html/functions/now.html +5 -5
  210. data/vendor/local/share/doc/groonga/ja/html/functions/rand.html +5 -5
  211. data/vendor/local/share/doc/groonga/ja/html/functions.html +5 -5
  212. data/vendor/local/share/doc/groonga/ja/html/genindex.html +5 -5
  213. data/vendor/local/share/doc/groonga/ja/html/geolocation_search.html +5 -5
  214. data/vendor/local/share/doc/groonga/ja/html/index.html +23 -16
  215. data/vendor/local/share/doc/groonga/ja/html/indexing.html +95 -14
  216. data/vendor/local/share/doc/groonga/ja/html/install.html +66 -37
  217. data/vendor/local/share/doc/groonga/ja/html/limitations.html +9 -9
  218. data/vendor/local/share/doc/groonga/ja/html/log.html +5 -5
  219. data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +5 -5
  220. data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +5 -5
  221. data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +5 -5
  222. data/vendor/local/share/doc/groonga/ja/html/news/1.2.x.html +5 -5
  223. data/vendor/local/share/doc/groonga/ja/html/news/senna.html +5 -5
  224. data/vendor/local/share/doc/groonga/ja/html/news.html +147 -25
  225. data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
  226. data/vendor/local/share/doc/groonga/ja/html/output.html +5 -5
  227. data/vendor/local/share/doc/groonga/ja/html/pseudo_column.html +5 -5
  228. data/vendor/local/share/doc/groonga/ja/html/reference.html +5 -5
  229. data/vendor/local/share/doc/groonga/ja/html/search.html +5 -5
  230. data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
  231. data/vendor/local/share/doc/groonga/ja/html/spec/search.html +22 -22
  232. data/vendor/local/share/doc/groonga/ja/html/spec.html +13 -11
  233. data/vendor/local/share/doc/groonga/ja/html/suggest/completion.html +33 -6
  234. data/vendor/local/share/doc/groonga/ja/html/suggest/correction.html +33 -6
  235. data/vendor/local/share/doc/groonga/ja/html/suggest/introduction.html +5 -5
  236. data/vendor/local/share/doc/groonga/ja/html/suggest/suggestion.html +37 -6
  237. data/vendor/local/share/doc/groonga/ja/html/suggest/tutorial.html +5 -5
  238. data/vendor/local/share/doc/groonga/ja/html/suggest.html +5 -5
  239. data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
  240. data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +5 -5
  241. data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +292 -28
  242. data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +5 -5
  243. data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +340 -27
  244. data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +5 -5
  245. data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +5 -5
  246. data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +282 -24
  247. data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +524 -15
  248. data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +103 -8
  249. data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +128 -13
  250. data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +155 -17
  251. data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +5 -5
  252. data/vendor/local/share/doc/groonga/ja/html/tutorial.html +5 -5
  253. data/vendor/local/share/doc/groonga/ja/html/type.html +5 -5
  254. data/vendor/local/share/doc/groonga/source/commands/select.txt +349 -109
  255. data/vendor/local/share/doc/groonga/source/commands/suggest-completion.log +28 -1
  256. data/vendor/local/share/doc/groonga/source/commands/suggest-correction.log +28 -1
  257. data/vendor/local/share/doc/groonga/source/commands/suggest-learn-completion.log +1 -1
  258. data/vendor/local/share/doc/groonga/source/commands/suggest-learn-correction.log +1 -1
  259. data/vendor/local/share/doc/groonga/source/commands/suggest-learn-suggestion.log +1 -1
  260. data/vendor/local/share/doc/groonga/source/commands/suggest-mixed.log +74 -1
  261. data/vendor/local/share/doc/groonga/source/commands/suggest-suggestion.log +32 -1
  262. data/vendor/local/share/doc/groonga/source/conf.py +3 -3
  263. data/vendor/local/share/doc/groonga/source/example/completion-1.log +28 -1
  264. data/vendor/local/share/doc/groonga/source/example/correction-1.log +28 -1
  265. data/vendor/local/share/doc/groonga/source/example/suggestion-1.log +32 -1
  266. data/vendor/local/share/doc/groonga/source/example/tutorial/data-1.log +1 -1
  267. data/vendor/local/share/doc/groonga/source/example/tutorial/data-2.log +38 -3
  268. data/vendor/local/share/doc/groonga/source/example/tutorial/data-3.log +46 -4
  269. data/vendor/local/share/doc/groonga/source/example/tutorial/data-4.log +38 -3
  270. data/vendor/local/share/doc/groonga/source/example/tutorial/data-5.log +38 -3
  271. data/vendor/local/share/doc/groonga/source/example/tutorial/data-6.log +38 -3
  272. data/vendor/local/share/doc/groonga/source/example/tutorial/data-7.log +40 -3
  273. data/vendor/local/share/doc/groonga/source/example/tutorial/data-8.log +48 -3
  274. data/vendor/local/share/doc/groonga/source/example/tutorial/index-1.log +6 -6
  275. data/vendor/local/share/doc/groonga/source/example/tutorial/index-2.log +100 -3
  276. data/vendor/local/share/doc/groonga/source/example/tutorial/index-3.log +5 -5
  277. data/vendor/local/share/doc/groonga/source/example/tutorial/index-4.log +80 -2
  278. data/vendor/local/share/doc/groonga/source/example/tutorial/index-5.log +75 -1
  279. data/vendor/local/share/doc/groonga/source/example/tutorial/index-6.log +31 -4
  280. data/vendor/local/share/doc/groonga/source/example/tutorial/index-7.log +38 -1
  281. data/vendor/local/share/doc/groonga/source/example/tutorial/match_columns-1.log +7 -7
  282. data/vendor/local/share/doc/groonga/source/example/tutorial/match_columns-2.log +132 -3
  283. data/vendor/local/share/doc/groonga/source/example/tutorial/match_columns-3.log +6 -6
  284. data/vendor/local/share/doc/groonga/source/example/tutorial/match_columns-4.log +132 -3
  285. data/vendor/local/share/doc/groonga/source/example/tutorial/micro_blog-1.log +32 -1
  286. data/vendor/local/share/doc/groonga/source/example/tutorial/micro_blog-10.log +95 -1
  287. data/vendor/local/share/doc/groonga/source/example/tutorial/micro_blog-2.log +32 -1
  288. data/vendor/local/share/doc/groonga/source/example/tutorial/micro_blog-3.log +32 -1
  289. data/vendor/local/share/doc/groonga/source/example/tutorial/micro_blog-4.log +86 -1
  290. data/vendor/local/share/doc/groonga/source/example/tutorial/micro_blog-5.log +32 -1
  291. data/vendor/local/share/doc/groonga/source/example/tutorial/micro_blog-6.log +70 -1
  292. data/vendor/local/share/doc/groonga/source/example/tutorial/micro_blog-7.log +51 -1
  293. data/vendor/local/share/doc/groonga/source/example/tutorial/micro_blog-8.log +55 -1
  294. data/vendor/local/share/doc/groonga/source/example/tutorial/micro_blog-9.log +34 -1
  295. data/vendor/local/share/doc/groonga/source/example/tutorial/network-1.log +18 -1
  296. data/vendor/local/share/doc/groonga/source/example/tutorial/network-3.log +80 -2
  297. data/vendor/local/share/doc/groonga/source/example/tutorial/patricia_trie-1.log +34 -3
  298. data/vendor/local/share/doc/groonga/source/example/tutorial/patricia_trie-2.log +89 -5
  299. data/vendor/local/share/doc/groonga/source/example/tutorial/query_expansion-1.log +8 -8
  300. data/vendor/local/share/doc/groonga/source/example/tutorial/query_expansion-2.log +66 -2
  301. data/vendor/local/share/doc/groonga/source/example/tutorial/query_expansion-3.log +76 -2
  302. data/vendor/local/share/doc/groonga/source/install.txt +41 -10
  303. data/vendor/local/share/doc/groonga/source/news.txt +71 -0
  304. data/vendor/local/share/doc/groonga/source/tutorial/data.txt +1 -1
  305. data/vendor/local/share/groonga/examples/dictionary/edict/edict-import.sh +0 -0
  306. data/vendor/local/share/groonga/examples/dictionary/edict/edict2grn.rb +1 -1
  307. data/vendor/local/share/groonga/examples/dictionary/eijiro/eijiro-import.sh +0 -0
  308. data/vendor/local/share/groonga/examples/dictionary/eijiro/eijiro2grn.rb +1 -1
  309. data/vendor/local/share/groonga/examples/dictionary/gene95/gene-import.sh +0 -0
  310. data/vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb +1 -1
  311. data/vendor/local/share/groonga/examples/dictionary/init-db.sh +0 -0
  312. data/vendor/local/share/groonga/examples/dictionary/jmdict/jmdict.rb +1 -1
  313. data/vendor/local/share/groonga/html/admin/css/{admin.css → groonga-admin.css} +5 -4
  314. data/vendor/local/share/groonga/html/admin/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  315. data/vendor/local/share/groonga/html/admin/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
  316. data/vendor/local/share/groonga/html/admin/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  317. data/vendor/local/share/groonga/html/admin/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  318. data/vendor/local/share/groonga/html/admin/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  319. data/vendor/local/share/groonga/html/admin/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  320. data/vendor/local/share/groonga/html/admin/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  321. data/vendor/local/share/groonga/html/admin/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  322. data/vendor/local/share/groonga/html/admin/css/{ui-lightness/images/ui-icons_ffd27a_256x240.png → redmond/images/ui-icons_217bc0_256x240.png} +0 -0
  323. data/vendor/local/share/groonga/html/admin/css/{ui-lightness/images/ui-icons_222222_256x240.png → redmond/images/ui-icons_2e83ff_256x240.png} +0 -0
  324. data/vendor/local/share/groonga/html/admin/css/{ui-lightness/images/ui-icons_228ef1_256x240.png → redmond/images/ui-icons_469bdd_256x240.png} +0 -0
  325. data/vendor/local/share/groonga/html/admin/css/redmond/images/ui-icons_6da8d5_256x240.png +0 -0
  326. data/vendor/local/share/groonga/html/admin/css/redmond/images/ui-icons_cd0a0a_256x240.png +0 -0
  327. data/vendor/local/share/groonga/html/admin/css/{ui-lightness/images/ui-icons_ef8c08_256x240.png → redmond/images/ui-icons_d8e7f3_256x240.png} +0 -0
  328. data/vendor/local/share/groonga/html/admin/css/redmond/images/ui-icons_f9bd01_256x240.png +0 -0
  329. data/vendor/local/share/groonga/html/admin/css/{ui-lightness/jquery-ui-1.8.1.custom.css → redmond/jquery-ui-1.8.18.custom.css} +169 -90
  330. data/vendor/local/share/groonga/html/admin/images/groonga.svg +121 -0
  331. data/vendor/local/share/groonga/html/admin/index.html +44 -1145
  332. data/vendor/local/share/groonga/html/admin/js/groonga-admin.js +1354 -0
  333. data/vendor/local/share/groonga/html/admin/js/jquery-1.7.2.min.js +4 -0
  334. data/vendor/local/share/groonga/html/admin/js/jquery-ui-1.8.18.custom.min.js +356 -0
  335. data/vendor/local/share/man/ja/man1/groonga.1 +2813 -331
  336. data/vendor/local/share/man/man1/groonga.1 +2898 -337
  337. data/vendor/local/share/mecab/dic/naist-jdic/sys.dic +0 -0
  338. data/vendor/local/share/mecab/dic/naist-jdic/unk.dic +0 -0
  339. metadata +988 -921
  340. data/test/groonga-test-utils.rb +0 -139
  341. data/test/run-test.rb +0 -60
  342. data/test/test-accessor.rb +0 -36
  343. data/test/test-array.rb +0 -123
  344. data/test/test-column.rb +0 -350
  345. data/test/test-command-select.rb +0 -147
  346. data/test/test-context.rb +0 -130
  347. data/test/test-database-dumper.rb +0 -259
  348. data/test/test-database.rb +0 -148
  349. data/test/test-double-array-trie.rb +0 -164
  350. data/test/test-encoding.rb +0 -33
  351. data/test/test-exception.rb +0 -96
  352. data/test/test-expression-builder.rb +0 -269
  353. data/test/test-expression.rb +0 -134
  354. data/test/test-fix-size-column.rb +0 -77
  355. data/test/test-gqtp.rb +0 -70
  356. data/test/test-hash.rb +0 -344
  357. data/test/test-index-column.rb +0 -180
  358. data/test/test-index-cursor.rb +0 -93
  359. data/test/test-logger.rb +0 -37
  360. data/test/test-pagination.rb +0 -249
  361. data/test/test-patricia-trie.rb +0 -415
  362. data/test/test-plugin.rb +0 -35
  363. data/test/test-procedure.rb +0 -37
  364. data/test/test-query-log.rb +0 -258
  365. data/test/test-record.rb +0 -569
  366. data/test/test-remote.rb +0 -63
  367. data/test/test-schema-create-table.rb +0 -267
  368. data/test/test-schema-dumper.rb +0 -235
  369. data/test/test-schema-type.rb +0 -208
  370. data/test/test-schema-view.rb +0 -90
  371. data/test/test-schema.rb +0 -886
  372. data/test/test-snippet.rb +0 -130
  373. data/test/test-table-cursor.rb +0 -187
  374. data/test/test-table-dumper.rb +0 -83
  375. data/test/test-table-offset-and-limit.rb +0 -100
  376. data/test/test-table-select-mecab.rb +0 -80
  377. data/test/test-table-select-normalize.rb +0 -57
  378. data/test/test-table-select-weight.rb +0 -123
  379. data/test/test-table-select.rb +0 -191
  380. data/test/test-table.rb +0 -675
  381. data/test/test-type.rb +0 -79
  382. data/test/test-variable-size-column.rb +0 -147
  383. data/test/test-variable.rb +0 -28
  384. data/test/test-vector-column.rb +0 -76
  385. data/test/test-version.rb +0 -61
  386. data/test/test-view.rb +0 -72
  387. data/vendor/local/share/groonga/html/admin/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  388. data/vendor/local/share/groonga/html/admin/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  389. data/vendor/local/share/groonga/html/admin/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  390. data/vendor/local/share/groonga/html/admin/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  391. data/vendor/local/share/groonga/html/admin/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  392. data/vendor/local/share/groonga/html/admin/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  393. data/vendor/local/share/groonga/html/admin/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  394. data/vendor/local/share/groonga/html/admin/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  395. data/vendor/local/share/groonga/html/admin/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  396. data/vendor/local/share/groonga/html/admin/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  397. data/vendor/local/share/groonga/html/admin/js/jquery-1.4.2.min.js +0 -154
  398. data/vendor/local/share/groonga/html/admin/js/jquery-ui-1.8.1.custom.min.js +0 -756
data/test/test-table.rb DELETED
@@ -1,675 +0,0 @@
1
- # Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
2
- #
3
- # This library is free software; you can redistribute it and/or
4
- # modify it under the terms of the GNU Lesser General Public
5
- # License version 2.1 as published by the Free Software Foundation.
6
- #
7
- # This library is distributed in the hope that it will be useful,
8
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10
- # Lesser General Public License for more details.
11
- #
12
- # You should have received a copy of the GNU Lesser General Public
13
- # License along with this library; if not, write to the Free Software
14
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
-
16
- class TableTest < Test::Unit::TestCase
17
- include GroongaTestUtils
18
-
19
- setup :setup_database
20
-
21
- def test_create
22
- table_path = @tables_dir + "bookmarks"
23
- assert_not_predicate(table_path, :exist?)
24
- table = Groonga::PatriciaTrie.create(:name => "Bookmarks",
25
- :path => table_path.to_s)
26
- assert_equal("Bookmarks", table.name)
27
- assert_predicate(table_path, :exist?)
28
- end
29
-
30
- def test_temporary
31
- table = Groonga::PatriciaTrie.create
32
- assert_nil(table.name)
33
- assert_predicate(table, :temporary?)
34
- assert_not_predicate(table, :persistent?)
35
- assert_equal([], @tables_dir.children)
36
- end
37
-
38
- def test_define_column
39
- table_path = @tables_dir + "bookmarks"
40
- table = Groonga::Hash.create(:name => "Bookmarks",
41
- :path => table_path.to_s)
42
- column = table.define_column("name", "Text")
43
- assert_equal("Bookmarks.name", column.name)
44
- assert_equal(column, table.column("name"))
45
- end
46
-
47
- def test_temporary_table_define_column_default_persistent
48
- table = Groonga::Hash.create
49
- assert_raise(Groonga::InvalidArgument) do
50
- table.define_column("name", "ShortText")
51
- end
52
- end
53
-
54
- def test_temporary_table_define_index_column_default_persistent
55
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
56
- terms = Groonga::Hash.create
57
- assert_raise(Groonga::InvalidArgument) do
58
- terms.define_index_column("url", bookmarks)
59
- end
60
- end
61
-
62
- def test_define_column_default_persistent
63
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
64
- real_name = bookmarks.define_column("real_name", "ShortText")
65
- assert_predicate(real_name, :persistent?)
66
- end
67
-
68
- def test_define_column_not_persistent
69
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
70
- real_name = bookmarks.define_column("real_name", "ShortText",
71
- :persistent => false)
72
- assert_predicate(real_name, :temporary?)
73
- end
74
-
75
- def test_define_column_not_persistent_and_path
76
- column_path = @tables_dir + "bookmakrs.real_name.column"
77
-
78
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
79
- message = "should not pass :path if :persistent is false: <#{column_path}>"
80
- assert_raise(ArgumentError.new(message)) do
81
- bookmarks.define_column("real_name", "ShortText",
82
- :path => column_path.to_s,
83
- :persistent => false)
84
- end
85
- end
86
-
87
- def test_define_index_column_default_persistent
88
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
89
- terms = Groonga::Hash.create(:name => "Terms")
90
- real_name = terms.define_index_column("real_name", bookmarks)
91
- assert_predicate(real_name, :persistent?)
92
- end
93
-
94
- def test_define_index_column_not_persistent
95
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
96
- terms = Groonga::Hash.create(:name => "Terms")
97
- real_name = terms.define_index_column("real_name", bookmarks,
98
- :persistent => false)
99
- assert_predicate(real_name, :temporary?)
100
- end
101
-
102
- def test_define_index_column_not_persistent_and_path
103
- column_path = @tables_dir + "bookmakrs.real_name.column"
104
-
105
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
106
- terms = Groonga::Hash.create(:name => "Terms")
107
- message = "should not pass :path if :persistent is false: <#{column_path}>"
108
- assert_raise(ArgumentError.new(message)) do
109
- terms.define_index_column("real_name", bookmarks,
110
- :path => column_path.to_s,
111
- :persistent => false)
112
- end
113
- end
114
-
115
- def test_define_index_column
116
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
117
- bookmarks.define_column("content", "Text")
118
- terms = Groonga::Hash.create(:name => "Terms")
119
- terms.default_tokenizer = "TokenBigram"
120
- index = terms.define_index_column("content_index", bookmarks,
121
- :with_section => true,
122
- :source => "Bookmarks.content")
123
- bookmarks.add("google", :content => "Search engine")
124
- assert_equal(["google"],
125
- index.search("engine").collect {|record| record.key.key})
126
- end
127
-
128
- def test_column_nonexistent
129
- table_path = @tables_dir + "bookmarks"
130
- table = Groonga::Hash.create(:name => "Bookmarks",
131
- :path => table_path.to_s)
132
- assert_nil(table.column("nonexistent"))
133
- end
134
-
135
- def test_set_value
136
- table_path = @tables_dir + "bookmarks"
137
- bookmarks = Groonga::Hash.create(:name => "Bookmarks",
138
- :value_type => "Int32",
139
- :path => table_path.to_s)
140
- comment_column_path = @columns_dir + "comment"
141
- bookmarks_comment =
142
- bookmarks.define_column("comment", "ShortText",
143
- :type => "scalar",
144
- :path => comment_column_path.to_s)
145
- groonga = bookmarks.add("groonga")
146
- groonga.value = 29
147
- bookmarks_comment[groonga.id] = "fulltext search engine"
148
-
149
- assert_equal([29, "fulltext search engine"],
150
- [groonga.value, bookmarks_comment[groonga.id]])
151
- end
152
-
153
- def test_array_set
154
- bookmarks = Groonga::Hash.create(:name => "Bookmarks",
155
- :value_type => "Int32")
156
- bookmarks.set_value("groonga", 29)
157
-
158
- values = bookmarks.records.collect do |record|
159
- record.value
160
- end
161
- assert_equal([29], values)
162
- end
163
-
164
- def test_add_without_name
165
- users_path = @tables_dir + "users"
166
- users = Groonga::Array.create(:name => "Users",
167
- :path => users_path.to_s)
168
- name_column_path = @columns_dir + "name"
169
- users_name = users.define_column("name", "ShortText",
170
- :path => name_column_path.to_s)
171
- morita = users.add
172
- users_name[morita.id] = "morita"
173
- assert_equal("morita", users_name[morita.id])
174
- end
175
-
176
- def test_add_by_id
177
- users_path = @tables_dir + "users"
178
- users = Groonga::Hash.create(:name => "Users",
179
- :path => users_path.to_s)
180
-
181
- bookmarks_path = @tables_dir + "bookmarks"
182
- bookmarks = Groonga::Hash.create(:name => "Bookmarks",
183
- :key_type => users,
184
- :value_type => "Int32",
185
- :path => bookmarks_path.to_s)
186
- morita = users.add("morita")
187
- groonga = bookmarks.add(morita.id)
188
- groonga.value = 29
189
- assert_equal(29, groonga.value)
190
- end
191
-
192
- def test_columns
193
- bookmarks_path = @tables_dir + "bookmarks"
194
- bookmarks = Groonga::Array.create(:name => "Bookmarks",
195
- :path => bookmarks_path.to_s)
196
-
197
- uri_column = bookmarks.define_column("uri", "ShortText")
198
- comment_column = bookmarks.define_column("comment", "Text")
199
- assert_equal([uri_column.name, comment_column.name].sort,
200
- bookmarks.columns.collect {|column| column.name}.sort)
201
- end
202
-
203
- def test_column_by_symbol
204
- bookmarks_path = @tables_dir + "bookmarks"
205
- bookmarks = Groonga::Array.create(:name => "Bookmarks",
206
- :path => bookmarks_path.to_s)
207
-
208
- uri_column = bookmarks.define_column("uri", "Text")
209
- assert_equal(uri_column, bookmarks.column(:uri))
210
- end
211
-
212
- def test_size
213
- bookmarks_path = @tables_dir + "bookmarks"
214
- bookmarks = Groonga::Array.create(:name => "Bookmarks",
215
- :path => bookmarks_path.to_s)
216
-
217
- assert_equal(0, bookmarks.size)
218
-
219
- bookmarks.add
220
- bookmarks.add
221
- bookmarks.add
222
-
223
- assert_equal(3, bookmarks.size)
224
- end
225
-
226
- def test_empty?
227
- bookmarks_path = @tables_dir + "bookmarks"
228
- bookmarks = Groonga::Array.create(:name => "Bookmarks",
229
- :path => bookmarks_path.to_s)
230
-
231
- assert_predicate(bookmarks, :empty?)
232
- bookmarks.add
233
- assert_not_predicate(bookmarks, :empty?)
234
- end
235
-
236
- def test_path
237
- bookmarks_path = @tables_dir + "bookmarks"
238
- bookmarks = Groonga::Array.create(:name => "Bookmarks",
239
- :path => bookmarks_path.to_s)
240
- assert_equal(bookmarks_path.to_s, bookmarks.path)
241
- end
242
-
243
- def test_time_column
244
- bookmarks_path = @tables_dir + "bookmarks"
245
- bookmarks = Groonga::Array.create(:name => "Bookmarks",
246
- :path => bookmarks_path.to_s)
247
- bookmarks.define_column("created_at", "Time")
248
-
249
- bookmark = bookmarks.add
250
- now = Time.now
251
- bookmark["created_at"] = now
252
- assert_equal(now.to_a,
253
- bookmark["created_at"].to_a)
254
- end
255
-
256
- def test_delete
257
- bookmarks_path = @tables_dir + "bookmarks"
258
- bookmarks = Groonga::Array.create(:name => "Bookmarks",
259
- :path => bookmarks_path.to_s)
260
-
261
- bookmark_records = []
262
- bookmark_records << bookmarks.add
263
- bookmark_records << bookmarks.add
264
- bookmark_records << bookmarks.add
265
-
266
- assert_equal(3, bookmarks.size)
267
- bookmarks.delete(bookmark_records[1].id)
268
- assert_equal(2, bookmarks.size)
269
- end
270
-
271
- def test_remove
272
- bookmarks_path = @tables_dir + "bookmarks"
273
- bookmarks = Groonga::Array.create(:name => "Bookmarks",
274
- :path => bookmarks_path.to_s)
275
- assert_predicate(bookmarks_path, :exist?)
276
- bookmarks.remove
277
- assert_not_predicate(bookmarks_path, :exist?)
278
- end
279
-
280
- def test_temporary_add
281
- table = Groonga::Hash.create(:key_type => "ShortText")
282
- assert_equal(0, table.size)
283
- table.add("key")
284
- assert_equal(1, table.size)
285
- end
286
-
287
- def test_each
288
- users = Groonga::Array.create(:name => "Users")
289
- users.define_column("name", "ShortText")
290
-
291
- names = ["daijiro", "gunyarakun", "yu"]
292
- names.each do |name|
293
- user = users.add
294
- user["name"] = name
295
- end
296
-
297
- assert_equal(names.sort, users.collect {|user| user["name"]}.sort)
298
- end
299
-
300
- def test_truncate
301
- users = Groonga::Array.create(:name => "Users")
302
- users.add
303
- users.add
304
- users.add
305
- assert_equal(3, users.size)
306
- assert_nothing_raised do
307
- users.truncate
308
- end
309
- assert_equal(0, users.size)
310
- end
311
-
312
- def test_sort
313
- bookmarks = create_bookmarks
314
- add_shuffled_ids(bookmarks)
315
-
316
- results = bookmarks.sort([
317
- {
318
- :key => "id",
319
- :order => :descending,
320
- },
321
- ],
322
- :limit => 20)
323
- assert_equal((180..199).to_a.reverse,
324
- results.collect {|record| record["id"]})
325
- end
326
-
327
- def test_sort_simple
328
- bookmarks = create_bookmarks
329
- add_shuffled_ids(bookmarks)
330
-
331
- results = bookmarks.sort(["id"], :limit => 20)
332
- assert_equal((100..119).to_a,
333
- results.collect {|record| record["id"]})
334
- end
335
-
336
- def test_sort_by_array
337
- bookmarks = create_bookmarks
338
- add_shuffled_ids(bookmarks)
339
-
340
- results = bookmarks.sort([["id", "descending"]], :limit => 20)
341
- assert_equal((180..199).to_a.reverse,
342
- results.collect {|record| record["id"]})
343
- end
344
-
345
- def test_sort_without_limit_and_offset
346
- bookmarks = create_bookmarks
347
- add_shuffled_ids(bookmarks)
348
-
349
- results = bookmarks.sort([{:key => "id", :order => :descending}])
350
- assert_equal((100..199).to_a.reverse,
351
- results.collect {|record| record["id"]})
352
- end
353
-
354
- def test_sort_with_limit
355
- bookmarks = create_bookmarks
356
- add_shuffled_ids(bookmarks)
357
-
358
- results = bookmarks.sort([{:key => "id", :order => :descending}],
359
- :limit => 20)
360
- assert_equal((180..199).to_a.reverse,
361
- results.collect {|record| record["id"]})
362
- end
363
-
364
- def test_sort_with_offset
365
- bookmarks = create_bookmarks
366
- add_shuffled_ids(bookmarks)
367
-
368
- results = bookmarks.sort([{:key => "id", :order => :descending}],
369
- :offset => 20)
370
- assert_equal((100..179).to_a.reverse,
371
- results.collect {|record| record["id"]})
372
- end
373
-
374
- def test_sort_with_limit_and_offset
375
- bookmarks = create_bookmarks
376
- add_shuffled_ids(bookmarks)
377
-
378
- results = bookmarks.sort([{:key => "id", :order => :descending}],
379
- :limit => 20, :offset => 20)
380
- assert_equal((160..179).to_a.reverse,
381
- results.collect {|record| record["id"]})
382
- end
383
-
384
- def test_sort_with_nonexistent_key
385
- bookmarks = create_bookmarks
386
- add_shuffled_ids(bookmarks)
387
- message = "no such column: <\"nonexistent\">: <#{bookmarks.inspect}>"
388
- assert_raise(Groonga::NoSuchColumn.new(message)) do
389
- bookmarks.sort([{:key => "nonexistent", :order => :descending}])
390
- end
391
- end
392
-
393
- def test_sort_with_nonexistent_value
394
- bookmarks = create_bookmarks
395
- bookmarks.define_column("uri", "ShortText")
396
- empty1 = bookmarks.add
397
- groonga = bookmarks.add(:uri => "http://groonga.org/")
398
- empty2 = bookmarks.add
399
- assert_equal([groonga, empty1, empty2],
400
- bookmarks.sort([{:key => "uri", :order => :descending}]))
401
- end
402
-
403
- def test_group
404
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
405
- bookmarks.define_column("title", "Text")
406
- comments = Groonga::Array.create(:name => "Comments")
407
- comments.define_column("bookmark", bookmarks)
408
- comments.define_column("content", "Text")
409
- comments.define_column("issued", "Int32")
410
-
411
- groonga = bookmarks.add("http://groonga.org/", :title => "groonga")
412
- ruby = bookmarks.add("http://ruby-lang.org/", :title => "Ruby")
413
-
414
- now = Time.now.to_i
415
- comments.add(:bookmark => groonga,
416
- :content => "full-text search",
417
- :issued => now)
418
- comments.add(:bookmark => groonga,
419
- :content => "column store",
420
- :issued => now)
421
- comments.add(:bookmark => ruby,
422
- :content => "object oriented script language",
423
- :issued => now)
424
-
425
- records = comments.select do |record|
426
- record["issued"] > 0
427
- end
428
- assert_equal([[2, "groonga", "http://groonga.org/"],
429
- [1, "Ruby", "http://ruby-lang.org/"]],
430
- records.group(".bookmark").collect do |record|
431
- bookmark = record.key
432
- [record.n_sub_records,
433
- bookmark["title"],
434
- bookmark.key]
435
- end)
436
- assert_equal([[2, "groonga", "http://groonga.org/"],
437
- [1, "Ruby", "http://ruby-lang.org/"]],
438
- records.group(%w".bookmark").collect do |record|
439
- bookmark = record.key
440
- [record.n_sub_records,
441
- bookmark["title"],
442
- bookmark.key]
443
- end)
444
- end
445
-
446
- def test_group_with_unknown_key
447
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
448
- message = "unknown group key: <\"nonexistent\">: <#{bookmarks.inspect}>"
449
- assert_raise(ArgumentError.new(message)) do
450
- bookmarks.group("nonexistent")
451
- end
452
- end
453
-
454
- def test_union!
455
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
456
- bookmarks.define_column("title", "ShortText")
457
-
458
- bookmarks.add("http://groonga.org/", :title => "groonga")
459
- bookmarks.add("http://ruby-lang.org/", :title => "Ruby")
460
-
461
- ruby_bookmarks = bookmarks.select {|record| record["title"] == "Ruby"}
462
- groonga_bookmarks = bookmarks.select {|record| record["title"] == "groonga"}
463
- assert_equal(["Ruby", "groonga"],
464
- ruby_bookmarks.union!(groonga_bookmarks).collect do |record|
465
- record[".title"]
466
- end)
467
- end
468
-
469
- def test_intersection!
470
- bookmarks = Groonga::Hash.create(:name => "bookmarks")
471
- bookmarks.define_column("title", "ShortText")
472
-
473
- bookmarks.add("http://groonga.org/", :title => "groonga")
474
- bookmarks.add("http://ruby-lang.org/", :title => "Ruby")
475
-
476
- ruby_bookmarks = bookmarks.select {|record| record["title"] == "Ruby"}
477
- all_bookmarks = bookmarks.select
478
- assert_equal(["Ruby"],
479
- ruby_bookmarks.intersection!(all_bookmarks).collect do |record|
480
- record[".title"]
481
- end)
482
- end
483
-
484
- def test_difference!
485
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
486
- bookmarks.define_column("title", "ShortText")
487
-
488
- bookmarks.add("http://groonga.org/", :title => "groonga")
489
- bookmarks.add("http://ruby-lang.org/", :title => "Ruby")
490
-
491
- ruby_bookmarks = bookmarks.select {|record| record["title"] == "Ruby"}
492
- all_bookmarks = bookmarks.select
493
- assert_equal(["groonga"],
494
- all_bookmarks.difference!(ruby_bookmarks).collect do |record|
495
- record[".title"]
496
- end)
497
- end
498
-
499
- def test_merge!
500
- bookmarks = Groonga::Hash.create(:name => "Bookmarks")
501
- bookmarks.define_column("title", "ShortText")
502
-
503
- bookmarks.add("http://groonga.org/", :title => "groonga")
504
- bookmarks.add("http://ruby-lang.org/", :title => "Ruby")
505
-
506
- ruby_bookmarks = bookmarks.select {|record| (record["title"] == "Ruby") &
507
- (record["title"] == "Ruby") }
508
- all_bookmarks = bookmarks.select
509
- assert_equal([["groonga", 1], ["Ruby", 2]],
510
- all_bookmarks.merge!(ruby_bookmarks).collect do |record|
511
- [record[".title"], record.score]
512
- end)
513
- end
514
-
515
- def test_lock
516
- bookmarks = Groonga::Array.create(:name => "Bookmarks")
517
- assert_not_predicate(bookmarks, :locked?)
518
- bookmarks.lock
519
- assert_predicate(bookmarks, :locked?)
520
- bookmarks.unlock
521
- assert_not_predicate(bookmarks, :locked?)
522
- end
523
-
524
- def test_lock_failed
525
- bookmarks = Groonga::Array.create(:name => "Bookmarks")
526
- bookmarks.lock
527
- assert_raise(Groonga::ResourceDeadlockAvoided) do
528
- bookmarks.lock
529
- end
530
- end
531
-
532
- def test_lock_block
533
- bookmarks = Groonga::Array.create(:name => "Bookmarks")
534
- assert_not_predicate(bookmarks, :locked?)
535
- bookmarks.lock do
536
- assert_predicate(bookmarks, :locked?)
537
- end
538
- assert_not_predicate(bookmarks, :locked?)
539
- end
540
-
541
- def test_clear_lock
542
- bookmarks = Groonga::Array.create(:name => "Bookmarks")
543
- assert_not_predicate(bookmarks, :locked?)
544
- bookmarks.lock
545
- assert_predicate(bookmarks, :locked?)
546
- bookmarks.clear_lock
547
- assert_not_predicate(bookmarks, :locked?)
548
- end
549
-
550
- def test_auto_record_register
551
- users = Groonga::Hash.create(:name => "Users",
552
- :key_type => "ShortText")
553
- books = Groonga::Hash.create(:name => "Books",
554
- :key_type => "ShortText")
555
- users.define_column("book", "Books")
556
-
557
- assert_equal([], books.select.collect {|book| book.key})
558
- users.add("ryoqun", :book => "XP")
559
- assert_equal([books["XP"]],
560
- books.select.collect {|book| book.key})
561
- end
562
-
563
- def test_get_common_prefix_column
564
- users = Groonga::Array.create(:name => "Users")
565
- users.define_column("name_kana", "ShortText")
566
- name = users.define_column("name", "ShortText")
567
-
568
- assert_equal(name, users.column("name"))
569
- end
570
-
571
- def test_empty_reference_column_value
572
- users = Groonga::Hash.create(:name => "Users",
573
- :key_type => "ShortText")
574
- books = Groonga::Hash.create(:name => "Books",
575
- :key_type => "ShortText")
576
- users.define_column("book", books)
577
- users.add("morita", :book => "")
578
- assert_equal({"_id" => 1, "_key" => "morita", "book" => nil},
579
- users["morita"].attributes)
580
- end
581
-
582
- def test_have_column
583
- users = Groonga::Hash.create(:name => "Users",
584
- :key_type => "ShortText")
585
- users.define_column("name", "ShortText")
586
- assert_true(users.have_column?("name"), "name")
587
- assert_false(users.have_column?("description"), "description")
588
- end
589
-
590
- def test_have_column_id
591
- users = Groonga::Array.create(:name => "Users")
592
- assert_true(users.have_column?(:_id))
593
- end
594
-
595
- def test_have_column_key_hash
596
- users = Groonga::Hash.create(:name => "Users",
597
- :key_type => "ShortText")
598
- assert_true(users.have_column?(:_key))
599
- end
600
-
601
- def test_have_column_key_array
602
- users = Groonga::Array.create(:name => "Users")
603
- assert_false(users.have_column?(:_key))
604
- end
605
-
606
- def test_have_column_value_hash_with_value_type
607
- users = Groonga::Hash.create(:name => "Users",
608
- :key_type => "ShortText",
609
- :value_type => "Int32")
610
- assert_true(users.have_column?(:_value))
611
- end
612
-
613
- def test_have_column_value_hash_without_value_type
614
- users = Groonga::Hash.create(:name => "Users",
615
- :key_type => "ShortText")
616
- assert_false(users.have_column?(:_value))
617
- end
618
-
619
- def test_have_column_value_array
620
- users = Groonga::Array.create(:name => "Users")
621
- assert_false(users.have_column?(:_value))
622
- end
623
-
624
- def test_have_column_nsubrecs_existent
625
- users = Groonga::Hash.create(:name => "Users",
626
- :key_type => "ShortText")
627
- assert_true(users.select.have_column?(:_nsubrecs))
628
- end
629
-
630
- def test_have_column_nsubrecs_nonexistent
631
- users = Groonga::Hash.create(:name => "Users",
632
- :key_type => "ShortText")
633
- assert_false(users.have_column?(:_nsubrecs))
634
- end
635
-
636
- def test_have_column_score_existent
637
- users = Groonga::Hash.create(:name => "Users",
638
- :key_type => "ShortText")
639
- assert_true(users.select.have_column?(:_score))
640
- end
641
-
642
- def test_have_column_score_nonexistent
643
- users = Groonga::Hash.create(:name => "Users",
644
- :key_type => "ShortText")
645
- assert_false(users.have_column?(:_score))
646
- end
647
-
648
- def test_exist?
649
- users = Groonga::Hash.create(:name => "Users")
650
- morita = users.add("morita")
651
- assert_true(users.exist?(morita.id))
652
- assert_false(users.exist?(morita.id + 1))
653
- end
654
-
655
- def test_builtin?
656
- bookmarks = Groonga::PatriciaTrie.create(:name => "Bookmarks")
657
- assert_not_predicate(bookmarks, :builtin?)
658
- end
659
-
660
- private
661
- def create_bookmarks
662
- bookmarks = Groonga::Array.create(:name => "Bookmarks")
663
- bookmarks.define_column("id", "Int32")
664
- bookmarks
665
- end
666
-
667
- def add_shuffled_ids(bookmarks)
668
- srand(Time.now.to_i)
669
- (0...100).to_a.shuffle.each do |i|
670
- bookmark = bookmarks.add
671
- bookmark["id"] = i + 100
672
- end
673
- bookmarks
674
- end
675
- end