Skip to content

Commit

Permalink
Merge branch 'master' of github.com:groonga/groonga
Browse files Browse the repository at this point in the history
  • Loading branch information
daijiro committed Sep 8, 2010
2 parents cf85262 + 86aa372 commit 9f6134a
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 151 deletions.
4 changes: 2 additions & 2 deletions doc/ja/source/commands/select.txt
Expand Up @@ -116,7 +116,7 @@ a - b

ソートキーとなるカラム名のリストをカンマ(',')区切りで指定します。::

[-]カラム名1 [-]カラム名2 [-]カラム名3...
[-]カラム名1, [-]カラム名2, [-]カラム名3, ...

カラム名1の値でソートし、値が同一である場合はカラム名2でソート、と順次比較を行いソートします。カラム名の前に - を付加した場合は降順にソートします。付加しない場合には昇順にソートします。

Expand All @@ -126,7 +126,7 @@ a - b

出力するカラム名のリストをカンマ(',')区切りで指定します。

アスタリスク('*')を指定すると、全てのカラムが指定されたものとみなされます。または、script形式のgrn_expr文字列を指定します。 (デフォルトは、'_id \*')
アスタリスク('*')を指定すると、全てのカラムが指定されたものとみなされます。または、script形式のgrn_expr文字列を指定します。 (デフォルトは、'_id, _key, \*')

``offset``

Expand Down
2 changes: 1 addition & 1 deletion doc/ja/source/tutorial/tutorial01.txt
Expand Up @@ -24,7 +24,7 @@ groongaのインストール前にMeCab (http://mecab.sourceforge.net/)をイン
http://groonga.org/download/よりtar.gzファイルを取得し、
インストール先の環境にファイルを展開して、 ::

./configure --prefix=/usr && make && sudo make install
./configure --prefix=/usr --localstatedir=/var && make && sudo make install

のように実行することでインストールできます。

Expand Down
7 changes: 4 additions & 3 deletions lib/db.c
Expand Up @@ -3756,11 +3756,12 @@ grn_obj_is_persistent(grn_ctx *ctx, grn_obj *obj)
GRN_BOOL_SET(ctx, dest, value_ < -DBL_EPSILON || DBL_EPSILON < value_);\
}

#define DEGREE_ACCURACY 10000000

#define DEGREE2MSEC(degree)\
(((int)degree * 60 * 60 * 1000) +\
(((int)(degree * 100) % 100) * 60 * 1000) +\
(((int)(degree * 10000) % 100) * 1000) +\
((int)(degree * 10000000) % 1000))
(((int)(degree * DEGREE_ACCURACY) % DEGREE_ACCURACY) * 60 / DEGREE_ACCURACY * 60 * 1000) +\
(((int)(degree * DEGREE_ACCURACY) % DEGREE_ACCURACY) * 60 % DEGREE_ACCURACY * 60 / 10000))

grn_rc
grn_obj_cast(grn_ctx *ctx, grn_obj *src, grn_obj *dest, int addp)
Expand Down
4 changes: 2 additions & 2 deletions lib/proc.c
Expand Up @@ -41,9 +41,9 @@ const char *grn_document_root = NULL;
/**** procs ****/

#define DEFAULT_LIMIT 10
#define DEFAULT_OUTPUT_COLUMNS "_id _key _value *"
#define DEFAULT_OUTPUT_COLUMNS "_id, _key, *"
#define DEFAULT_DRILLDOWN_LIMIT 10
#define DEFAULT_DRILLDOWN_OUTPUT_COLUMNS "_key _nsubrecs"
#define DEFAULT_DRILLDOWN_OUTPUT_COLUMNS "_key, _nsubrecs"

#define LAP(msg,num) {\
uint64_t et;\
Expand Down
12 changes: 6 additions & 6 deletions test/unit/core/test-cast-basic.c
Expand Up @@ -291,8 +291,8 @@ test_text_to_geo_point_in_degree(void)
grn_obj_reinit(&context, &dest, GRN_DB_WGS84_GEO_POINT, 0);
cast_text("35.6954581363924x139.564207350021");
GRN_GEO_POINT_VALUE(&dest, takane_latitude, takane_longitude);
cut_assert_equal_int(130194581, takane_latitude);
cut_assert_equal_int(503802073, takane_longitude);
cut_assert_equal_int(128503649, takane_latitude);
cut_assert_equal_int(502431146, takane_longitude);
}

void
Expand All @@ -303,8 +303,8 @@ test_text_to_geo_point_in_degree_comma(void)
grn_obj_reinit(&context, &dest, GRN_DB_WGS84_GEO_POINT, 0);
cast_text("35.6954581363924,139.564207350021");
GRN_GEO_POINT_VALUE(&dest, takane_latitude, takane_longitude);
cut_assert_equal_int(130194581, takane_latitude);
cut_assert_equal_int(503802073, takane_longitude);
cut_assert_equal_int(128503649, takane_latitude);
cut_assert_equal_int(502431146, takane_longitude);
}

void
Expand All @@ -324,7 +324,7 @@ test_text_to_geo_point_mixed(void)
grn_obj_reinit(&context, &dest, GRN_DB_WGS84_GEO_POINT, 0);
cast_text("35.6954581363924x503802073");
GRN_GEO_POINT_VALUE(&dest, takane_latitude, takane_longitude);
cut_assert_equal_int(130194581, takane_latitude);
cut_assert_equal_int(128503649, takane_latitude);
cut_assert_equal_int(503802073, takane_longitude);
}

Expand All @@ -336,7 +336,7 @@ test_text_to_geo_point_mixed_comma(void)
grn_obj_reinit(&context, &dest, GRN_DB_WGS84_GEO_POINT, 0);
cast_text("35.6954581363924,503802073");
GRN_GEO_POINT_VALUE(&dest, takane_latitude, takane_longitude);
cut_assert_equal_int(130194581, takane_latitude);
cut_assert_equal_int(128503649, takane_latitude);
cut_assert_equal_int(503802073, takane_longitude);
}

Expand Down
16 changes: 8 additions & 8 deletions test/unit/core/test-inspect.c
Expand Up @@ -352,10 +352,10 @@ test_geo_point_tokyo(void)
geo_point_tokyo = grn_obj_open(context, GRN_BULK, 0, GRN_DB_TOKYO_GEO_POINT);
GRN_GEO_POINT_SET(context, geo_point_tokyo, takane_latitude, takane_longitude);
inspected = grn_inspect(context, NULL, geo_point_tokyo);
cut_assert_equal_string("[(130194581,503802073) "
"((36, 9, 54, 581),(139, 56, 42, 73)) "
"[00000001 01111110 10100000 00011101 "
"10010110 11100000 11010011 01100011]]",
cut_assert_equal_string("[(128503649,502431146) "
"((35, 41, 43, 649),(139, 33, 51, 146)) "
"[00000001 01111011 11011101 10000100 "
"10110101 11111011 01101100 01000110]]",
inspected_string());
}

Expand All @@ -370,10 +370,10 @@ test_geo_point_wgs84(void)
geo_point_wgs84 = grn_obj_open(context, GRN_BULK, 0, GRN_DB_WGS84_GEO_POINT);
GRN_GEO_POINT_SET(context, geo_point_wgs84, takane_latitude, takane_longitude);
inspected = grn_inspect(context, NULL, geo_point_wgs84);
cut_assert_equal_string("[(130226900,503769900) "
"((36, 10, 26, 900),(139, 56, 9, 900)) "
"[00000001 01111110 10100000 00011110 "
"01010110 11001101 10100110 01110000]]",
cut_assert_equal_string("[(128515283,502419564) "
"((35, 41, 55, 283),(139, 33, 39, 564)) "
"[00000001 01111011 11011101 10000100 "
"10111011 10100000 10110110 01011010]]",
inspected_string());
}

Expand Down
2 changes: 2 additions & 0 deletions test/unit/fixtures/story/taiyaki/ddl.grn
Expand Up @@ -17,6 +17,8 @@ column_create Shops tags COLUMN_VECTOR Tags
column_create Shops location COLUMN_SCALAR WGS84GeoPoint
column_create Shops latitude COLUMN_SCALAR Int32
column_create Shops longitude COLUMN_SCALAR Int32
column_create Shops latitude_in_degree COLUMN_SCALAR Float
column_create Shops longitude_in_degree COLUMN_SCALAR FLoat
column_create Shops categories COLUMN_VECTOR Categories
column_create Shops area COLUMN_SCALAR Areas

Expand Down
72 changes: 36 additions & 36 deletions test/unit/fixtures/story/taiyaki/shops.grn
@@ -1,39 +1,39 @@
load --table Shops
[
{"_key":"nezu-no-taiyaki",name:"根津のたいやき","latitude":130322053,"longitude":504985073,"location":"130322053x504985073",tags:["たいやき","天然"],area:"area0005"},
{"_key":"taiyaki-kataoka",name:"たい焼 カタオカ","latitude":130285021,"longitude":504715091,"location":"130285021x504715091",tags:["たいやき"]},
{"_key":"soba-taiyaki-ku",name:"そばたいやき空","latitude":130117012,"longitude":504390088,"location":"130117012x504390088",tags:["たいやき"]},
{"_key":"kuruma",name:"車","latitude":130335016,"longitude":504662007,"location":"130335016x504662007",tags:["たいやき"]},
{"_key":"hirose-ya",name:"広瀬屋","latitude":130308044,"longitude":504536008,"location":"130308044x504536008",tags:["たいやき"]},
{"_key":"sazare",name:"さざれ","latitude":130306053,"longitude":504530043,"location":"130306053x504530043",tags:["たいやき"]},
{"_key":"omede-taiyaki",name:"おめで鯛焼き本舗錦糸町東急店","latitude":130205016,"longitude":505331054,"location":"130205016x505331054",tags:["たいやき"]},
{"_key":"onaga-ya",name:"尾長屋 錦糸町店","latitude":130222054,"longitude":505270050,"location":"130222054x505270050",tags:["たいやき","白"]},
{"_key":"shiro-ya",name:"たいやき工房白家 阿佐ヶ谷店","latitude":130255017,"longitude":504266011,"location":"130255017x504266011",tags:["たいやき","白"]},
{"_key":"fuji-ya",name:"たいやき本舗 藤家 阿佐ヶ谷店","latitude":130239038,"longitude":504251015,"location":"130239038x504251015",tags:["たいやき","白"]},
{"_key":"miyoshi",name:"みよし","latitude":129885039,"longitude":503653023,"location":"129885039x503653023",tags:["たいやき"]},
{"_key":"juju-ya",name:"寿々屋 菓子","latitude":129809022,"longitude":504597055,"location":"129809022x504597055",tags:["たいやき"]},
{"_key":"tatsumi-ya",name:"たい焼き \/ たつみや","latitude":130015001,"longitude":504266057,"location":"130015001x504266057",tags:["たいやき"]},
{"_key":"tetsuji",name:"たい焼き鉄次 大丸東京店","latitude":130089012,"longitude":505045070,"location":"130089012x505045070",tags:["たいやき"],categories:["category0003","category0001"]},
{"_key":"gazuma-ya",name:"吾妻屋","latitude":130208017,"longitude":504315098,"location":"130208017x504315098",tags:["たいやき"]},
{"_key":"honma-mon",name:"ほんま門","latitude":130347036,"longitude":504325073,"location":"130347036x504325073",tags:["たこやき"],area:"area0014"},
{"_key":"naniwa-ya",name:"浪花家","latitude":130380061,"longitude":505202034,"location":"130380061x505202034",tags:["たいやき","天然"]},
{"_key":"kuro-dai",name:"代官山たい焼き黒鯛","latitude":129903045,"longitude":504648034,"location":"129903045x504648034",tags:["たいやき"]},
{"_key":"daruma",name:"たいやき神田達磨 八重洲店","latitude":130094061,"longitude":505025099,"location":"130094061x505025099",tags:["たいやき"]},
{"_key":"yanagi-ya",name:"柳屋 たい焼き","latitude":130133052,"longitude":505120058,"location":"130133052x505120058",tags:["たいやき","天然"],area:"area0002"},
{"_key":"sharaku",name:"たい焼き写楽","latitude":130329069,"longitude":505188046,"location":"130329069x505188046",tags:["たいやき","天然"]},
{"_key":"takane",name:"たかね 和菓子","latitude":130226001,"longitude":503769013,"location":"130226001x503769013",tags:["たいやき","天然","和菓子"]},
{"_key":"chiyoda",name:"たい焼き ちよだ","latitude":129866001,"longitude":504328017,"location":"129866001x504328017",tags:["たいやき"]},
{"_key":"da-ka-po",name:"ダ・カーポ","latitude":129786048,"longitude":504792049,"location":"129786048x504792049",tags:["たいやき","カレー"]},
{"_key":"matsushima-ya",name:"松島屋","latitude":129845056,"longitude":504853081,"location":"129845056x504853081",tags:["和菓子"],categories:["和食"]},
{"_key":"kazuya",name:"銀座 かずや","latitude":130055008,"longitude":504968095,"location":"130055008x504968095",tags:["和菓子"],categories:["和食"]},
{"_key":"furuya-kogane-an",name:"ふるや古賀音庵 和菓子","latitude":130086003,"longitude":504480071,"location":"130086003x504480071",tags:["和菓子"],categories:["和食"]},
{"_key":"hachi-no-ie",name:"蜂の家 自由が丘本店","latitude":129680021,"longitude":504441006,"location":"129680021x504441006",tags:["和菓子"],categories:["和食"]},
{"_key":"azuki-chan",name:"薄皮たい焼き あづきちゃん","latitude":129855010,"longitude":504452003,"location":"129855010x504452003",tags:["たいやき"]},
{"_key":"kuriko-an",name:"横浜 くりこ庵 浅草店","latitude":130280013,"longitude":505208029,"location":"130280013x505208029",tags:["たいやき"]},
{"_key":"yume-no-aru-machi-no-taiyaki-ya-san",name:"夢ある街のたいやき屋さん戸越銀座店","latitude":129721099,"longitude":504685024,"location":"129721099x504685024",tags:["たいやき"]},
{"_key":"naze-ya",name:"何故屋","latitude":129690039,"longitude":504418033,"location":"129690039x504418033",tags:["たいやき"]},
{"_key":"sanoki-ya",name:"築地 さのきや","latitude":130019020,"longitude":505027021,"location":"130019020x505027021",tags:["たいやき","マグロ"],categories:"",area:"area0002"},
{"_key":"shigeta",name:"しげ田","latitude":130046026,"longitude":505082073,"location":"130046026x505082073",tags:["たいやき","和菓子"],area:"area0002"},
{"_key":"nishimi-ya",name:"にしみや 甘味処","latitude":130038025,"longitude":505066028,"location":"130038025x505066028",tags:["たいやき","おでん"]},
{"_key":"hiiragi",name:"たいやきひいらぎ","latitude":129917001,"longitude":504675017,"location":"129917001x504675017",tags:["たいやき"],area:"area0013"}
{"_key":"nezu-no-taiyaki",name:"根津のたいやき","latitude":128592911,"longitude":503145263,"location":"128592911x503145263","latitude_in_degree":35.720253,"longitude_in_degree":139.762573,tags:["たいやき","天然"],area:"area0005"},
{"_key":"taiyaki-kataoka",name:"たい焼 カタオカ","latitude":128565076,"longitude":502976128,"location":"128565076x502976128","latitude_in_degree":35.712521,"longitude_in_degree":139.715591,tags:["たいやき"]},
{"_key":"soba-taiyaki-ku",name:"そばたいやき空","latitude":128461363,"longitude":502772717,"location":"128461363x502772717","latitude_in_degree":35.683712,"longitude_in_degree":139.659088,tags:["たいやき"]},
{"_key":"kuruma",name:"車","latitude":128597458,"longitude":502942345,"location":"128597458x502942345","latitude_in_degree":35.721516,"longitude_in_degree":139.706207,tags:["たいやき"]},
{"_key":"hirose-ya",name:"広瀬屋","latitude":128573438,"longitude":502868189,"location":"128573438x502868189","latitude_in_degree":35.714844,"longitude_in_degree":139.685608,tags:["たいやき"]},
{"_key":"sazare",name:"さざれ","latitude":128572751,"longitude":502866155,"location":"128572751x502866155","latitude_in_degree":35.714653,"longitude_in_degree":139.685043,tags:["たいやき"]},
{"_key":"omede-taiyaki",name:"おめで鯛焼き本舗錦糸町東急店","latitude":128521858,"longitude":503341754,"location":"128521858x503341754","latitude_in_degree":35.700516,"longitude_in_degree":139.817154,tags:["たいやき"]},
{"_key":"onaga-ya",name:"尾長屋 錦糸町店","latitude":128513714,"longitude":503319780,"location":"128513714x503319780","latitude_in_degree":35.698254,"longitude_in_degree":139.811050,tags:["たいやき","白"]},
{"_key":"shiro-ya",name:"たいやき工房白家 阿佐ヶ谷店","latitude":128539861,"longitude":502699000,"location":"128539861x502699000","latitude_in_degree":35.705517,"longitude_in_degree":139.638611,tags:["たいやき","白"]},
{"_key":"fuji-ya",name:"たいやき本舗 藤家 阿佐ヶ谷店","latitude":128534177,"longitude":502693614,"location":"128534177x502693614","latitude_in_degree":35.703938,"longitude_in_degree":139.637115,tags:["たいやき","白"]},
{"_key":"miyoshi",name:"みよし","latitude":128320340,"longitude":502334363,"location":"128320340x502334363","latitude_in_degree":35.644539,"longitude_in_degree":139.537323,tags:["たいやき"]},
{"_key":"juju-ya",name:"寿々屋 菓子","latitude":128264119,"longitude":502904718,"location":"128264119x502904718","latitude_in_degree":35.628922,"longitude_in_degree":139.695755,tags:["たいやき"]},
{"_key":"tatsumi-ya",name:"たい焼き \/ たつみや","latitude":128395804,"longitude":502699165,"location":"128395804x502699165","latitude_in_degree":35.665501,"longitude_in_degree":139.638657,tags:["たいやき"]},
{"_key":"tetsuji",name:"たい焼き鉄次 大丸東京店","latitude":128451283,"longitude":503166852,"location":"128451283x503166852","latitude_in_degree":35.680912,"longitude_in_degree":139.768570,tags:["たいやき"],categories:["category0003","category0001"]},
{"_key":"gazuma-ya",name:"吾妻屋","latitude":128522941,"longitude":502731353,"location":"128522941x502731353","latitude_in_degree":35.700817,"longitude_in_degree":139.647598,tags:["たいやき"]},
{"_key":"honma-mon",name:"ほんま門","latitude":128601850,"longitude":502749263,"location":"128601850x502749263","latitude_in_degree":35.722736,"longitude_in_degree":139.652573,tags:["たこやき"],area:"area0014"},
{"_key":"naniwa-ya",name:"浪花家","latitude":128628220,"longitude":503266442,"location":"128628220x503266442","latitude_in_degree":35.730061,"longitude_in_degree":139.796234,tags:["たいやき","天然"]},
{"_key":"kuro-dai",name:"代官山たい焼き黒鯛","latitude":128341242,"longitude":502937402,"location":"128341242x502937402","latitude_in_degree":35.650345,"longitude_in_degree":139.704834,tags:["たいやき"]},
{"_key":"daruma",name:"たいやき神田達磨 八重洲店","latitude":128453260,"longitude":503174156,"location":"128453260x503174156","latitude_in_degree":35.681461,"longitude_in_degree":139.770599,tags:["たいやき"]},
{"_key":"yanagi-ya",name:"柳屋 たい焼き","latitude":128467228,"longitude":503222332,"location":"128467228x503222332","latitude_in_degree":35.685341,"longitude_in_degree":139.783981,tags:["たいやき","天然"],area:"area0002"},
{"_key":"sharaku",name:"たい焼き写楽","latitude":128581088,"longitude":503261446,"location":"128581088x503261446","latitude_in_degree":35.716969,"longitude_in_degree":139.794846,tags:["たいやき","天然"]},
{"_key":"takane",name:"たかね 和菓子","latitude":128514964,"longitude":502419287,"location":"128514964x502419287","latitude_in_degree":35.698601,"longitude_in_degree":139.560913,tags:["たいやき","天然","和菓子"]},
{"_key":"chiyoda",name:"たい焼き ちよだ","latitude":128313364,"longitude":502750141,"location":"128313364x502750141","latitude_in_degree":35.642601,"longitude_in_degree":139.652817,tags:["たいやき"]},
{"_key":"da-ka-po",name:"ダ・カーポ","latitude":128258446,"longitude":503018482,"location":"128258446x503018482","latitude_in_degree":35.627346,"longitude_in_degree":139.727356,tags:["たいやき","カレー"]},
{"_key":"matsushima-ya",name:"松島屋","latitude":128306002,"longitude":503054572,"location":"128306002x503054572","latitude_in_degree":35.640556,"longitude_in_degree":139.737381,tags:["和菓子"],categories:["和食"]},
{"_key":"kazuya",name:"銀座 かずや","latitude":128424629,"longitude":503139222,"location":"128424629x503139222","latitude_in_degree":35.673508,"longitude_in_degree":139.760895,tags:["和菓子"],categories:["和食"]},
{"_key":"furuya-kogane-an",name:"ふるや古賀音庵 和菓子","latitude":128450171,"longitude":502833856,"location":"128450171x502833856","latitude_in_degree":35.680603,"longitude_in_degree":139.676071,tags:["和菓子"],categories:["和食"]},
{"_key":"hachi-no-ie",name:"蜂の家 自由が丘本店","latitude":128188876,"longitude":502805182,"location":"128188876x502805182","latitude_in_degree":35.608021,"longitude_in_degree":139.668106,tags:["和菓子"],categories:["和食"]},
{"_key":"azuki-chan",name:"薄皮たい焼き あづきちゃん","latitude":128309436,"longitude":502823531,"location":"128309436x502823531","latitude_in_degree":35.641510,"longitude_in_degree":139.673203,tags:["たいやき"]},
{"_key":"kuriko-an",name:"横浜 くりこ庵 浅草店","latitude":128563247,"longitude":503268584,"location":"128563247x503268584","latitude_in_degree":35.712013,"longitude_in_degree":139.796829,tags:["たいやき"]},
{"_key":"yume-no-aru-machi-no-taiyaki-ya-san",name:"夢ある街のたいやき屋さん戸越銀座店","latitude":128218316,"longitude":502965086,"location":"128218316x502965086","latitude_in_degree":35.616199,"longitude_in_degree":139.712524,tags:["たいやき"]},
{"_key":"naze-ya",name:"何故屋","latitude":128192540,"longitude":502796999,"location":"128192540x502796999","latitude_in_degree":35.609039,"longitude_in_degree":139.665833,tags:["たいやき"]},
{"_key":"sanoki-ya",name:"築地 さのきや","latitude":128397312,"longitude":503174596,"location":"128397312x503174596","latitude_in_degree":35.665920,"longitude_in_degree":139.770721,tags:["たいやき","マグロ"],categories:"",area:"area0002"},
{"_key":"shigeta",name:"しげ田","latitude":128421454,"longitude":503208983,"location":"128421454x503208983","latitude_in_degree":35.672626,"longitude_in_degree":139.780273,tags:["たいやき","和菓子"],area:"area0002"},
{"_key":"nishimi-ya",name:"にしみや 甘味処","latitude":128418570,"longitude":503188661,"location":"128418570x503188661","latitude_in_degree":35.671825,"longitude_in_degree":139.774628,tags:["たいやき","おでん"]},
{"_key":"hiiragi",name:"たいやきひいらぎ","latitude":128331724,"longitude":502961461,"location":"128331724x502961461","latitude_in_degree":35.647701,"longitude_in_degree":139.711517,tags:["たいやき"],area:"area0013"}
]

0 comments on commit 9f6134a

Please sign in to comment.