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/ext/groonga/rb-grn.h CHANGED
@@ -1,6 +1,6 @@
1
1
  /* -*- 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
@@ -72,7 +72,7 @@ RB_GRN_BEGIN_DECLS
72
72
 
73
73
  #define RB_GRN_MAJOR_VERSION 1
74
74
  #define RB_GRN_MINOR_VERSION 3
75
- #define RB_GRN_MICRO_VERSION 0
75
+ #define RB_GRN_MICRO_VERSION 1
76
76
 
77
77
  #define RB_GRN_QUERY_DEFAULT_MAX_EXPRESSIONS 32
78
78
 
@@ -227,7 +227,6 @@ RB_GRN_VAR VALUE rb_cGrnAccessor;
227
227
  RB_GRN_VAR VALUE rb_cGrnViewAccessor;
228
228
  RB_GRN_VAR VALUE rb_cGrnRecord;
229
229
  RB_GRN_VAR VALUE rb_cGrnViewRecord;
230
- RB_GRN_VAR VALUE rb_cGrnQuery;
231
230
  RB_GRN_VAR VALUE rb_cGrnLogger;
232
231
  RB_GRN_VAR VALUE rb_cGrnSnippet;
233
232
  RB_GRN_VAR VALUE rb_cGrnVariable;
@@ -270,7 +269,6 @@ void rb_grn_init_accessor (VALUE mGrn);
270
269
  void rb_grn_init_view_accessor (VALUE mGrn);
271
270
  void rb_grn_init_record (VALUE mGrn);
272
271
  void rb_grn_init_view_record (VALUE mGrn);
273
- void rb_grn_init_query (VALUE mGrn);
274
272
  void rb_grn_init_variable (VALUE mGrn);
275
273
  void rb_grn_init_operator (VALUE mGrn);
276
274
  void rb_grn_init_expression (VALUE mGrn);
@@ -555,9 +553,6 @@ VALUE rb_grn_column_expression_builder_build
555
553
  #define GRNACCESSOR2RVAL(context, accessor, owner) \
556
554
  (rb_grn_accessor_to_ruby_object(context, accessor, owner))
557
555
 
558
- #define RVAL2GRNQUERY(object) (rb_grn_query_from_ruby_object(object))
559
- #define GRNQUERY2RVAL(context, column)(rb_grn_query_to_ruby_object(context, column))
560
-
561
556
  #define RVAL2GRNOPERATOR(object) (rb_grn_operator_from_ruby_object(object))
562
557
 
563
558
  #define RVAL2GRNLOGGER(object) (rb_grn_logger_from_ruby_object(object))
@@ -665,10 +660,6 @@ VALUE rb_grn_index_cursor_to_ruby_object (grn_ctx *context,
665
660
  grn_obj *cursor,
666
661
  grn_bool owner);
667
662
 
668
- grn_query *rb_grn_query_from_ruby_object (VALUE object);
669
- VALUE rb_grn_query_to_ruby_object (grn_ctx *context,
670
- grn_query *query);
671
-
672
663
  grn_operator rb_grn_operator_from_ruby_object (VALUE object);
673
664
 
674
665
  grn_logger_info *
@@ -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
@@ -138,7 +138,6 @@ Init_groonga (void)
138
138
  rb_grn_init_view_accessor(mGrn);
139
139
  rb_grn_init_record(mGrn);
140
140
  rb_grn_init_view_record(mGrn);
141
- rb_grn_init_query(mGrn);
142
141
  rb_grn_init_variable(mGrn);
143
142
  rb_grn_init_operator(mGrn);
144
143
  rb_grn_init_expression(mGrn);
data/lib/1.8/groonga.so CHANGED
Binary file
data/lib/1.9/groonga.so CHANGED
Binary file
@@ -0,0 +1,169 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License version 2.1 as published by the Free Software Foundation.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
+
18
+ module Groonga
19
+ module Command
20
+ class Builder
21
+ class << self
22
+ def escape_value(value)
23
+ escaped_value = value.to_s.gsub(/"/, '\\"')
24
+ "\"#{escaped_value}\""
25
+ end
26
+ end
27
+
28
+ attr_reader :command, :arguments
29
+ def initialize(command, arguments={})
30
+ @command = command
31
+ @arguments = arguments
32
+ end
33
+
34
+ def [](key)
35
+ @arguments[key]
36
+ end
37
+
38
+ def []=(key, value)
39
+ @arguments[key] = value
40
+ end
41
+
42
+ def build
43
+ query = "#{@command} "
44
+ @arguments.each do |key, value|
45
+ value = value.join(", ") if value.is_a?(::Array)
46
+ escaped_value = self.class.escape_value(value)
47
+ query << " --#{key} #{escaped_value}"
48
+ end
49
+ query
50
+ end
51
+ end
52
+
53
+ class Select
54
+ def initialize(context, table, options)
55
+ @context = context
56
+ @table = table
57
+ @options = normalize_options(options)
58
+ end
59
+
60
+ def exec
61
+ request_id = @context.send(query)
62
+ loop do
63
+ response_id, result = @context.receive
64
+ if request_id == response_id
65
+ drill_down_keys = @options["drilldown"]
66
+ if drill_down_keys.is_a?(String)
67
+ drill_down_keys = drill_down_keys.split(/(?:\s+|\s*,\s*)/)
68
+ end
69
+ return Result.parse(result, drill_down_keys)
70
+ end
71
+ # raise if request_id < response_id
72
+ end
73
+ end
74
+
75
+ private
76
+ def normalize_options(options)
77
+ normalized_options = {}
78
+ options.each do |key, value|
79
+ normalized_options[normalize_option_name(key)] = value
80
+ end
81
+ normalized_options
82
+ end
83
+
84
+ def normalize_option_name(name)
85
+ name = name.to_s.gsub(/-/, "_").gsub(/drill_down/, "drilldown")
86
+ name.gsub(/sort_by/, 'sortby')
87
+ end
88
+
89
+ def query
90
+ if @table.is_a?(String)
91
+ table_name = @table
92
+ else
93
+ table_name = @table.name
94
+ end
95
+ builder = Builder.new("select", @options.merge(:table => table_name))
96
+ builder.build
97
+ end
98
+
99
+ class Result < Struct.new(:n_hits, :columns, :values, :drill_down)
100
+ class << self
101
+ def parse(json, drill_down_keys)
102
+ select_result, *drill_down_results = JSON.parse(json)
103
+ result = new
104
+ n_hits, columns, values = extract_result(select_result)
105
+ result.n_hits = n_hits
106
+ result.columns = columns
107
+ result.values = values
108
+ if drill_down_results
109
+ result.drill_down = parse_drill_down_results(drill_down_results,
110
+ drill_down_keys)
111
+ end
112
+ result
113
+ end
114
+
115
+ def create_records(columns, values)
116
+ records = []
117
+ values.each do |value|
118
+ record = {}
119
+ columns.each_with_index do |(name, type), i|
120
+ record[name] = convert_value(value[i], type)
121
+ end
122
+ records << record
123
+ end
124
+ records
125
+ end
126
+
127
+ private
128
+ def parse_drill_down_results(results, keys)
129
+ named_results = {}
130
+ results.each_with_index do |drill_down, i|
131
+ n_hits, columns, values = extract_result(drill_down)
132
+ drill_down_result = DrillDownResult.new
133
+ drill_down_result.n_hits = n_hits
134
+ drill_down_result.columns = columns
135
+ drill_down_result.values = values
136
+ named_results[keys[i]] = drill_down_result
137
+ end
138
+ named_results
139
+ end
140
+
141
+ def extract_result(result)
142
+ meta_data, columns, *values = result
143
+ n_hits, = meta_data
144
+ [n_hits, columns, values]
145
+ end
146
+
147
+ def convert_value(value, type)
148
+ case type
149
+ when "Time"
150
+ Time.at(value)
151
+ else
152
+ value
153
+ end
154
+ end
155
+ end
156
+
157
+ def records
158
+ @records ||= self.class.create_records(columns, values)
159
+ end
160
+
161
+ class DrillDownResult < Struct.new(:n_hits, :columns, :values)
162
+ def records
163
+ @records ||= Result.create_records(columns, values)
164
+ end
165
+ end
166
+ end
167
+ end
168
+ end
169
+ end
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2010-2011 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2010-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
@@ -15,6 +15,8 @@
15
15
  # License along with this library; if not, write to the Free Software
16
16
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
17
 
18
+ require "groonga/command"
19
+
18
20
  module Groonga
19
21
  class Context
20
22
  # _path_ にある既存のデータベースを開く。ブロックを指定した場
@@ -70,130 +72,8 @@ module Groonga
70
72
  # @option options [Array] XXX TODO
71
73
  # TODO
72
74
  def select(table, options={})
73
- select = SelectCommand.new(self, table, options)
75
+ select = Command::Select.new(self, table, options)
74
76
  select.exec
75
77
  end
76
-
77
- class SelectResult < Struct.new(:n_hits, :columns, :values,
78
- :drill_down)
79
- class << self
80
- def parse(json, drill_down_keys)
81
- select_result, *drill_down_results = JSON.parse(json)
82
- result = new
83
- n_hits, columns, values = extract_result(select_result)
84
- result.n_hits = n_hits
85
- result.columns = columns
86
- result.values = values
87
- if drill_down_results
88
- result.drill_down = parse_drill_down_results(drill_down_results,
89
- drill_down_keys)
90
- end
91
- result
92
- end
93
-
94
- def create_records(columns, values)
95
- records = []
96
- values.each do |value|
97
- record = {}
98
- columns.each_with_index do |(name, type), i|
99
- record[name] = convert_value(value[i], type)
100
- end
101
- records << record
102
- end
103
- records
104
- end
105
-
106
- private
107
- def parse_drill_down_results(results, keys)
108
- named_results = {}
109
- results.each_with_index do |drill_down, i|
110
- n_hits, columns, values = extract_result(drill_down)
111
- drill_down_result = DrillDownResult.new
112
- drill_down_result.n_hits = n_hits
113
- drill_down_result.columns = columns
114
- drill_down_result.values = values
115
- named_results[keys[i]] = drill_down_result
116
- end
117
- named_results
118
- end
119
-
120
- def extract_result(result)
121
- meta_data, columns, *values = result
122
- n_hits, = meta_data
123
- [n_hits, columns, values]
124
- end
125
-
126
- def convert_value(value, type)
127
- case type
128
- when "Time"
129
- Time.at(value)
130
- else
131
- value
132
- end
133
- end
134
- end
135
-
136
- def records
137
- @records ||= self.class.create_records(columns, values)
138
- end
139
-
140
- class DrillDownResult < Struct.new(:n_hits, :columns, :values)
141
- def records
142
- @records ||= SelectResult.create_records(columns, values)
143
- end
144
- end
145
- end
146
-
147
- class SelectCommand
148
- def initialize(context, table, options)
149
- @context = context
150
- @table = table
151
- @options = normalize_options(options)
152
- end
153
-
154
- def exec
155
- request_id = @context.send(query)
156
- loop do
157
- response_id, result = @context.receive
158
- if request_id == response_id
159
- drill_down_keys = @options["drilldown"]
160
- if drill_down_keys.is_a?(String)
161
- drill_down_keys = drill_down_keys.split(/(?:\s+|\s*,\s*)/)
162
- end
163
- return SelectResult.parse(result, drill_down_keys)
164
- end
165
- # raise if request_id < response_id
166
- end
167
- end
168
-
169
- private
170
- def normalize_options(options)
171
- normalized_options = {}
172
- options.each do |key, value|
173
- normalized_options[normalize_option_name(key)] = value
174
- end
175
- normalized_options
176
- end
177
-
178
- def normalize_option_name(name)
179
- name = name.to_s.gsub(/-/, "_").gsub(/drill_down/, "drilldown")
180
- name.gsub(/sort_by/, 'sortby')
181
- end
182
-
183
- def query
184
- if @table.is_a?(String)
185
- table_name = @table
186
- else
187
- table_name = @table.name
188
- end
189
- _query = "select #{table_name}"
190
- @options.each do |key, value|
191
- value = value.join(", ") if value.is_a?(::Array)
192
- escaped_value = value.to_s.gsub(/"/, '\\"')
193
- _query << " --#{key} \"#{escaped_value}\""
194
- end
195
- _query
196
- end
197
- end
198
78
  end
199
79
  end
@@ -302,14 +302,12 @@ module Groonga
302
302
  def column_method(column)
303
303
  range = column.range
304
304
  case range.name
305
- when "Int32"
306
- "integer32"
307
- when "Int64"
308
- "integer64"
309
- when "UInt32"
310
- "unsigned_integer32"
311
- when "UInt64"
312
- "unsigned_integer64"
305
+ when "Bool"
306
+ "boolean"
307
+ when /\AInt(8|16|32|64)\z/
308
+ "integer#{$1}"
309
+ when /\AUInt(8|16|32|64)\z/
310
+ "unsigned_integer#{$1}"
313
311
  when "Float"
314
312
  "float"
315
313
  when "Time"
@@ -320,6 +318,10 @@ module Groonga
320
318
  "text"
321
319
  when "LongText"
322
320
  "long_text"
321
+ when "TokyoGeoPoint"
322
+ "tokyo_geo_point"
323
+ when "WGS84GeoPoint"
324
+ "wgs84_geo_point"
323
325
  else
324
326
  raise ArgumentError, "unsupported column: #{column.inspect}"
325
327
  end
@@ -161,6 +161,13 @@ module Groonga
161
161
  self["_score"]
162
162
  end
163
163
 
164
+ # Sets score. Score column exists only search result table.
165
+ #
166
+ # @param [Integer] new_score The new score.
167
+ def score=(new_score)
168
+ self["_score"] = new_score
169
+ end
170
+
164
171
  # Groonga::Record#scoreが利用できる場合は +true+ を
165
172
  # 返す。
166
173
  def support_score?
@@ -516,6 +516,10 @@ module Groonga
516
516
  "text" => "Text",
517
517
  "binary" => "LongText",
518
518
  "long_text" => "LongText",
519
+ "int8" => "Int8",
520
+ "integer8" => "Int8",
521
+ "int16" => "Int16",
522
+ "integer16" => "Int16",
519
523
  "int" => "Int32",
520
524
  "integer" => "Int32",
521
525
  "int32" => "Int32",
@@ -523,6 +527,10 @@ module Groonga
523
527
  "decimal" => "Int64",
524
528
  "int64" => "Int64",
525
529
  "integer64" => "Int64",
530
+ "uint8" => "UInt8",
531
+ "unsigned_integer8" => "UInt8",
532
+ "uint16" => "UInt16",
533
+ "unsigned_integer16" => "UInt16",
526
534
  "uint" => "UInt32",
527
535
  "unsigned_integer" => "UInt32",
528
536
  "uint32" => "UInt32",
@@ -535,6 +543,9 @@ module Groonga
535
543
  "time" => "Time",
536
544
  "date" => "Time",
537
545
  "boolean" => "Bool",
546
+ "tokyo_geo_point" => "TokyoGeoPoint",
547
+ "geo_point" => "WGS84GeoPoint",
548
+ "wgs84_geo_point" => "WGS84GeoPoint",
538
549
  "delimit" => "TokenDelimit",
539
550
  "token_delimit" => "TokenDelimit",
540
551
  "unigram" => "TokenUnigram",
@@ -1158,6 +1169,28 @@ module Groonga
1158
1169
  self
1159
1170
  end
1160
1171
 
1172
+ # Defines a 8 bit signed integer column named @name@.
1173
+ #
1174
+ # @param [String or Symbol] name the column name
1175
+ # @param [Hash] options ({}) the options
1176
+ # @see Groonga::Schema::TableDefinition#column for
1177
+ # available @options@.
1178
+ def integer8(name, options={})
1179
+ column(name, "Int8", options)
1180
+ end
1181
+ alias_method :int8, :integer8
1182
+
1183
+ # Defines a 16 bit signed integer column named @name@.
1184
+ #
1185
+ # @param [String or Symbol] name the column name
1186
+ # @param [Hash] options ({}) the options
1187
+ # @see Groonga::Schema::TableDefinition#column for
1188
+ # available @options@.
1189
+ def integer16(name, options={})
1190
+ column(name, "Int16", options)
1191
+ end
1192
+ alias_method :int16, :integer16
1193
+
1161
1194
  # 名前が _name_ の32bit符号付き整数のカラムを作成する。
1162
1195
  #
1163
1196
  # _options_ に指定可能な値は
@@ -1177,6 +1210,28 @@ module Groonga
1177
1210
  end
1178
1211
  alias_method :int64, :integer64
1179
1212
 
1213
+ # Defines a 8 bit unsigned integer column named @name@.
1214
+ #
1215
+ # @param [String or Symbol] name the column name
1216
+ # @param [Hash] options ({}) the options
1217
+ # @see Groonga::Schema::TableDefinition#column for
1218
+ # available @options@.
1219
+ def unsigned_integer8(name, options={})
1220
+ column(name, "UInt8", options)
1221
+ end
1222
+ alias_method :uint8, :unsigned_integer8
1223
+
1224
+ # Defines a 16 bit unsigned integer column named @name@.
1225
+ #
1226
+ # @param [String or Symbol] name the column name
1227
+ # @param [Hash] options ({}) the options
1228
+ # @see Groonga::Schema::TableDefinition#column for
1229
+ # available @options@.
1230
+ def unsigned_integer16(name, options={})
1231
+ column(name, "UInt16", options)
1232
+ end
1233
+ alias_method :uint16, :unsigned_integer16
1234
+
1180
1235
  # 名前が _name_ の32bit符号なし整数のカラムを作成する。
1181
1236
  #
1182
1237
  # _options_ に指定可能な値は
@@ -1272,6 +1327,40 @@ module Groonga
1272
1327
  end
1273
1328
  alias_method :bool, :boolean
1274
1329
 
1330
+ # Defines a 8 bit signed integer column named @name@.
1331
+ #
1332
+ # @param [String or Symbol] name the column name
1333
+ # @param [Hash] options ({}) the options
1334
+ # @see Groonga::Schema::TableDefinition#column for
1335
+ # available @options@.
1336
+ def integer8(name, options={})
1337
+ column(name, "Int8", options)
1338
+ end
1339
+ alias_method :int8, :integer8
1340
+
1341
+ # Defines a geo point in Tokyo geodetic system column
1342
+ # named @name@.
1343
+ #
1344
+ # @param [String or Symbol] name the column name
1345
+ # @param [Hash] options ({}) the options
1346
+ # @see Groonga::Schema::TableDefinition#column for
1347
+ # available @options@.
1348
+ def tokyo_geo_point(name, options={})
1349
+ column(name, "TokyoGeoPoint", options)
1350
+ end
1351
+
1352
+ # Defines a geo point in WGS 84 (World Geodetic System) column
1353
+ # named @name@.
1354
+ #
1355
+ # @param [String or Symbol] name the column name
1356
+ # @param [Hash] options ({}) the options
1357
+ # @see Groonga::Schema::TableDefinition#column for
1358
+ # available @options@.
1359
+ def wgs84_geo_point(name, options={})
1360
+ column(name, "WGS84GeoPoint", options)
1361
+ end
1362
+ alias_method :geo_point, :wgs84_geo_point
1363
+
1275
1364
  # @private
1276
1365
  def [](name, definition_class=nil)
1277
1366
  @definitions.find do |definition|
@@ -1651,23 +1740,25 @@ module Groonga
1651
1740
  end
1652
1741
  end
1653
1742
  table.define_column(@name,
1654
- normalize_type(context),
1743
+ resolved_type(context),
1655
1744
  options)
1656
1745
  end
1657
1746
 
1658
1747
  private
1659
- def normalize_type(context)
1748
+ def resolved_type(context)
1749
+ return @type if @type.is_a?(Groonga::Object)
1660
1750
  if @type.respond_to?(:call)
1661
- resolved_type = @type.call(context)
1751
+ resolved_type_name = @type.call(context)
1662
1752
  else
1663
- resolved_type = @type
1753
+ resolved_type_name = @type
1664
1754
  end
1665
- Schema.normalize_type(resolved_type, :context => context)
1755
+ normalized_type_name = Schema.normalize_type(resolved_type_name,
1756
+ :context => context)
1757
+ context[normalized_type_name]
1666
1758
  end
1667
1759
 
1668
1760
  def same_column?(context, column)
1669
- # TODO: should check column type and other options.
1670
- column.range == context[normalize_type(context)]
1761
+ column.range == resolved_type(context)
1671
1762
  end
1672
1763
 
1673
1764
  def define_options(context, table)
data/rroonga-build.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env 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
@@ -18,8 +18,8 @@
18
18
  module RroongaBuild
19
19
  module RequiredGroongaVersion
20
20
  MAJOR = 1
21
- MINOR = 2
22
- MICRO = 8
21
+ MINOR = 3
22
+ MICRO = 0
23
23
  VERSION = [MAJOR, MINOR, MICRO]
24
24
  end
25
25
 
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2010 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2010-2012 Kouhei Sutou <kou@clear-code.com>
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -13,7 +13,7 @@
13
13
  # License along with this library; if not, write to the Free Software
14
14
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
15
 
16
- class ContextSelectTest < Test::Unit::TestCase
16
+ class CommandSelectTest < Test::Unit::TestCase
17
17
  include GroongaTestUtils
18
18
 
19
19
  setup :setup_database
@@ -100,7 +100,7 @@ class ContextSelectTest < Test::Unit::TestCase
100
100
 
101
101
  def test_drill_down_with_no_hit
102
102
  result = context.select(@users,
103
- :filter => "_key == \"no hit\"",
103
+ :filter => "_key == \"no\\ hit\"",
104
104
  :output_columns => ["_key"],
105
105
  :drill_down => ["_key", "book"],
106
106
  :drill_down_output_columns => "_key",
data/test/test-record.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2009-2012 Kouhei Sutou <kou@clear-code.com>
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -233,6 +233,23 @@ class RecordTest < Test::Unit::TestCase
233
233
  end)
234
234
  end
235
235
 
236
+ def test_score=
237
+ groonga = @bookmarks.add
238
+ groonga["content"] = "full text search search search engine."
239
+
240
+ google = @bookmarks.add
241
+ google["content"] = "Web search engine."
242
+
243
+ results = @bookmarks_content_index.search("search")
244
+ results.each do |record|
245
+ record.score *= 10
246
+ end
247
+ assert_equal([[groonga.id, 30], [google.id, 10]],
248
+ results.collect do |record|
249
+ [record.id, record.score]
250
+ end)
251
+ end
252
+
236
253
  def test_increment!
237
254
  groonga = @bookmarks.add
238
255
  assert_equal(0, groonga["rate"])