YUKI Hiroshi
null+****@clear*****
Wed Nov 19 18:44:19 JST 2014
YUKI Hiroshi 2014-11-19 18:44:19 +0900 (Wed, 19 Nov 2014) New Revision: 7a21bb6c5315cca9d6a8c26cc602270f0b197fe6 https://github.com/droonga/droonga.org/commit/7a21bb6c5315cca9d6a8c26cc602270f0b197fe6 Message: Add steps to confirm results of column_list. Now the limitation "do not run table_list and column_list commands until the schema is completed" goes away. Modified files: tutorial/1.0.8/groonga/index.md Modified: tutorial/1.0.8/groonga/index.md (+307 -27) =================================================================== --- tutorial/1.0.8/groonga/index.md 2014-11-19 18:37:40 +0900 (e2538af) +++ tutorial/1.0.8/groonga/index.md 2014-11-19 18:44:19 +0900 (544f006) @@ -286,11 +286,129 @@ $ curl "$endpoint/d/table_create?name=Store&flags=TABLE_PAT_KEY&key_type=ShortTe ] ~~~ - Note that you have to specify the host, one of Droonga nodes with active droonga-http-server, in your Droonga cluster. In other words, you can use any favorite node in the cluster as an endpoint. All requests will be distributed to suitable nodes in the cluster. +OK, now the table has been created successfully. +Let's see it by the `table_list` command: + +~~~ +$ curl "$endpoint/d/table_list" | jq "." +[ + [ + 0, + 1401358908.9126804, + 0.001600027084350586 + ], + [ + [ + [ + "id", + "UInt32" + ], + [ + "name", + "ShortText" + ], + [ + "path", + "ShortText" + ], + [ + "flags", + "ShortText" + ], + [ + "domain", + "ShortText" + ], + [ + "range", + "ShortText" + ], + [ + "default_tokenizer", + "ShortText" + ], + [ + "normalizer", + "ShortText" + ] + ], + [ + 256, + "Store", + "/home/vagrant/droonga/000/db.0000100", + "TABLE_PAT_KEY|PERSISTENT", + "ShortText", + null, + null, + null + ] + ] +] +~~~ + +Because it is a cluster, another endpoint returns same result. + +~~~ +$ curl "http://node1:10041/d/table_list" | jq "." +[ + [ + 0, + 1401358908.9126804, + 0.001600027084350586 + ], + [ + [ + [ + "id", + "UInt32" + ], + [ + "name", + "ShortText" + ], + [ + "path", + "ShortText" + ], + [ + "flags", + "ShortText" + ], + [ + "domain", + "ShortText" + ], + [ + "range", + "ShortText" + ], + [ + "default_tokenizer", + "ShortText" + ], + [ + "normalizer", + "ShortText" + ] + ], + [ + 256, + "Store", + "/home/vagrant/droonga/000/db.0000100", + "TABLE_PAT_KEY|PERSISTENT", + "ShortText", + null, + null, + null + ] + ] +] +~~~ + Next, create new columns `name` and `location` to the `Store` table by the `column_create` command, like: ~~~ @@ -355,20 +473,15 @@ $ curl "$endpoint/d/column_create?table=Location&name=store&flags=COLUMN_INDEX&t ] ~~~ -*IMPORTANT NOTE*: Don't run `table_list` or `column_list` before the table is completely created. -Otherwise indexes can be broken. -This is a known issue on the version {{ site.droonga_version }}, and it will be fixed in a future release. - -OK, now the table has been created successfully. -Let's see it by the `table_list` command: +Let's confirm results: ~~~ $ curl "$endpoint/d/table_list" | jq "." [ [ 0, - 1401358908.9126804, - 0.001600027084350586 + 1416390011.7194495, + 0.0015704631805419922 ], [ [ @@ -406,28 +519,43 @@ $ curl "$endpoint/d/table_list" | jq "." ] ], [ + 261, + "Location", + "/home/droonga-engine/droonga/databases/000/db.0000105", + "TABLE_PAT_KEY|PERSISTENT", + "WGS84GeoPoint", + null, + null, + null + ], + [ 256, "Store", - "/home/vagrant/droonga/000/db.0000100", + "/home/droonga-engine/droonga/databases/000/db.0000100", "TABLE_PAT_KEY|PERSISTENT", "ShortText", null, null, null + ], + [ + 259, + "Term", + "/home/droonga-engine/droonga/databases/000/db.0000103", + "TABLE_PAT_KEY|PERSISTENT", + "ShortText", + null, + "TokenBigram", + "NormalizerAuto" ] ] ] -~~~ - -Because it is a cluster, another endpoint returns same result. - -~~~ -$ curl "http://node1:10041/d/table_list" | jq "." +$ curl "$endpoint/d/column_list?table=Store" | jq "." [ [ 0, - 1401358908.9126804, - 0.001600027084350586 + 1416390069.515929, + 0.001077413558959961 ], [ [ @@ -444,6 +572,10 @@ $ curl "http://node1:10041/d/table_list" | jq "." "ShortText" ], [ + "type", + "ShortText" + ], + [ "flags", "ShortText" ], @@ -456,23 +588,171 @@ $ curl "http://node1:10041/d/table_list" | jq "." "ShortText" ], [ - "default_tokenizer", + "source", + "ShortText" + ] + ], + [ + 256, + "_key", + "", + "", + "COLUMN_SCALAR", + "Store", + "ShortText", + [] + ], + [ + 258, + "location", + "/home/droonga-engine/droonga/databases/000/db.0000102", + "fix", + "COLUMN_SCALAR", + "Store", + "WGS84GeoPoint", + [] + ], + [ + 257, + "name", + "/home/droonga-engine/droonga/databases/000/db.0000101", + "var", + "COLUMN_SCALAR", + "Store", + "ShortText", + [] + ] + ] +] +$ curl "$endpoint/d/column_list?table=Term" | jq "." +[ + [ + 0, + 1416390110.143951, + 0.0013172626495361328 + ], + [ + [ + [ + "id", + "UInt32" + ], + [ + "name", "ShortText" ], [ - "normalizer", + "path", + "ShortText" + ], + [ + "type", + "ShortText" + ], + [ + "flags", + "ShortText" + ], + [ + "domain", + "ShortText" + ], + [ + "range", + "ShortText" + ], + [ + "source", "ShortText" ] ], [ - 256, - "Store", - "/home/vagrant/droonga/000/db.0000100", - "TABLE_PAT_KEY|PERSISTENT", + 259, + "_key", + "", + "", + "COLUMN_SCALAR", + "Term", "ShortText", - null, - null, - null + [] + ], + [ + 260, + "store_name", + "/home/droonga-engine/droonga/databases/000/db.0000104", + "index", + "COLUMN_INDEX|WITH_POSITION", + "Term", + "Store", + [ + "name" + ] + ] + ] +] +$ curl "$endpoint/d/column_list?table=Location" | jq "." +[ + [ + 0, + 1416390163.0140722, + 0.0009713172912597656 + ], + [ + [ + [ + "id", + "UInt32" + ], + [ + "name", + "ShortText" + ], + [ + "path", + "ShortText" + ], + [ + "type", + "ShortText" + ], + [ + "flags", + "ShortText" + ], + [ + "domain", + "ShortText" + ], + [ + "range", + "ShortText" + ], + [ + "source", + "ShortText" + ] + ], + [ + 261, + "_key", + "", + "", + "COLUMN_SCALAR", + "Location", + "WGS84GeoPoint", + [] + ], + [ + 262, + "store", + "/home/droonga-engine/droonga/databases/000/db.0000106", + "index", + "COLUMN_INDEX", + "Location", + "Store", + [ + "location" + ] ] ] ] -------------- next part -------------- HTML����������������������������...下載