[Groonga-commit] droonga/droonga.org at 6ecef62 [gh-pages] Add fulltext index to taiyaki database

Back to archive index

Yoji Shidara null+****@clear*****
Wed Aug 28 14:14:44 JST 2013


Yoji Shidara	2013-08-28 14:14:44 +0900 (Wed, 28 Aug 2013)

  New Revision: 6ecef625afad8f558803fa96b1eed9ef39c833c9
  https://github.com/droonga/droonga.org/commit/6ecef625afad8f558803fa96b1eed9ef39c833c9

  Message:
    Add fulltext index to taiyaki database

  Modified files:
    tutorial/index.md

  Modified: tutorial/index.md (+59 -1)
===================================================================
--- tutorial/index.md    2013-08-21 17:36:44 +0900 (e9cf747)
+++ tutorial/index.md    2013-08-28 14:14:44 +0900 (3803f68)
@@ -107,9 +107,67 @@ TODO: なぜこの手順が必要なの?
     $ cd backend
     $ mkdir taiyaki
 
-TODO: ddl.grn と shops.grn をつくる http://www.clear-code.com/blog/2011/9/13.html
+例として、たい焼き屋を検索できるデータベースを作成しましょう。
+[groongaで高速な位置情報検索](http://www.clear-code.com/blog/2011/9/13.html) に出てくるたいやき屋データをもとに、店名で全文検索ができるように変更を加えた以下のデータを利用します。
+
+ddl.grn:
+
+    table_create Shops TABLE_HASH_KEY ShortText
+    column_create Shops location COLUMN_SCALAR WGS84GeoPoint
+
+    table_create Locations TABLE_PAT_KEY WGS84GeoPoint
+    column_create Locations shop COLUMN_INDEX Shops location
+
+    table_create Term TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+    column_create Term shops__key COLUMN_INDEX|WITH_POSITION Shops _key
+
+shop.ddl:
+
+    load --table Shops
+    [
+    ["_key", "location"],
+    ["根津のたいやき", "35.720253,139.762573"],
+    ["たい焼 カタオカ", "35.712521,139.715591"],
+    ["そばたいやき空", "35.683712,139.659088"],
+    ["車", "35.721516,139.706207"],
+    ["広瀬屋", "35.714844,139.685608"],
+    ["さざれ", "35.714653,139.685043"],
+    ["おめで鯛焼き本舗錦糸町東急店", "35.700516,139.817154"],
+    ["尾長屋 錦糸町店", "35.698254,139.81105"],
+    ["たいやき工房白家 阿佐ヶ谷店", "35.705517,139.638611"],
+    ["たいやき本舗 藤家 阿佐ヶ谷店", "35.703938,139.637115"],
+    ["みよし", "35.644539,139.537323"],
+    ["寿々屋 菓子", "35.628922,139.695755"],
+    ["たい焼き / たつみや", "35.665501,139.638657"],
+    ["たい焼き鉄次 大丸東京店", "35.680912,139.76857"],
+    ["吾妻屋", "35.700817,139.647598"],
+    ["ほんま門", "35.722736,139.652573"],
+    ["浪花家", "35.730061,139.796234"],
+    ["代官山たい焼き黒鯛", "35.650345,139.704834"],
+    ["たいやき神田達磨 八重洲店", "35.681461,139.770599"],
+    ["柳屋 たい焼き", "35.685341,139.783981"],
+    ["たい焼き写楽", "35.716969,139.794846"],
+    ["たかね 和菓子", "35.698601,139.560913"],
+    ["たい焼き ちよだ", "35.642601,139.652817"],
+    ["ダ・カーポ", "35.627346,139.727356"],
+    ["松島屋", "35.640556,139.737381"],
+    ["銀座 かずや", "35.673508,139.760895"],
+    ["ふるや古賀音庵 和菓子", "35.680603,139.676071"],
+    ["蜂の家 自由が丘本店", "35.608021,139.668106"],
+    ["薄皮たい焼き あづきちゃん", "35.64151,139.673203"],
+    ["横浜 くりこ庵 浅草店", "35.712013,139.796829"],
+    ["夢ある街のたいやき屋さん戸越銀座店", "35.616199,139.712524"],
+    ["何故屋", "35.609039,139.665833"],
+    ["築地 さのきや", "35.66592,139.770721"],
+    ["しげ田", "35.672626,139.780273"],
+    ["にしみや 甘味処", "35.671825,139.774628"],
+    ["たいやきひいらぎ", "35.647701,139.711517"]
+    ]
+
 TODO: groonga の実行形式にパスを通すなどする (apt で groonga 入れた方がいいかも)
 
+ddl.grn と shops.grn をデータベースに読み込みます。
+
     $ groonga -n taiyaki/db < ddl.grn
     $ groonga taiyaki/db < shops.grn
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index