Kouhei Sutou
null+****@clear*****
Sun Apr 3 23:50:55 JST 2016
Kouhei Sutou 2016-04-03 23:50:55 +0900 (Sun, 03 Apr 2016) New Revision: faf65ebab2bda37288b3cd1485e2c40fa3e2eb65 https://github.com/groonga/groonga/commit/faf65ebab2bda37288b3cd1485e2c40fa3e2eb65 Message: Support sequential search fallback for selector If selector without index returns GRN_FUNCTION_NOT_IMPLEMENTED rc, the condition is executed as sequential search. Modified files: lib/expr.c lib/geo.c test/command/suite/select/filter/geo_in_circle/approximate_type/default/no_index.expected test/command/suite/select/filter/geo_in_circle/no_index/north_east.expected test/command/suite/select/filter/geo_in_circle/no_index/north_east.test Modified: lib/expr.c (+5 -1) =================================================================== --- lib/expr.c 2016-04-03 11:31:19 +0900 (2ba600e) +++ lib/expr.c 2016-04-03 23:50:55 +0900 (a37502a) @@ -6276,7 +6276,11 @@ grn_table_select_index(grn_ctx *ctx, grn_obj *table, scan_info *si, rc = proc->selector(ctx, table, NULL, si->nargs, si->args, res, si->logical_op); if (rc) { - /* TODO: report error */ + if (rc == GRN_FUNCTION_NOT_IMPLEMENTED) { + ERRCLR(ctx); + } else { + /* TODO: report error */ + } } else { processed = GRN_TRUE; } Modified: lib/geo.c (+1 -1) =================================================================== --- lib/geo.c 2016-04-03 11:31:19 +0900 (c868a1d) +++ lib/geo.c 2016-04-03 23:50:55 +0900 (90eb309) @@ -808,7 +808,7 @@ grn_selector_geo_in_circle(grn_ctx *ctx, grn_obj *table, grn_obj *index, point_column = args[1]; column_name_size = grn_obj_name(ctx, point_column, column_name, GRN_TABLE_MAX_KEY_SIZE); - ERR(GRN_INVALID_ARGUMENT, + ERR(GRN_FUNCTION_NOT_IMPLEMENTED, "geo_in_circle(): index for <%.*s> is missing", column_name_size, column_name); return ctx->rc; Modified: test/command/suite/select/filter/geo_in_circle/approximate_type/default/no_index.expected (+63 -1) =================================================================== --- test/command/suite/select/filter/geo_in_circle/approximate_type/default/no_index.expected 2016-04-03 11:31:19 +0900 (1cebde3) +++ test/command/suite/select/filter/geo_in_circle/approximate_type/default/no_index.expected 2016-04-03 23:50:55 +0900 (2c6e27e) @@ -1,5 +1,67 @@ column_remove Locations shop [[0,0.0,0.0],true] select Shops --sortby '+_score, +name' --output_columns 'name, _score, location' --filter 'geo_in_circle(location, "128429532x503148672", 3000)' --scorer '_score = geo_distance(location, "128429532x503148672") * 1000' -[[[-22,0.0,0.0],"geo_in_circle(): index for <Shops.location> is missing"],[]] +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 7 + ], + [ + [ + "name", + "ShortText" + ], + [ + "_score", + "Int32" + ], + [ + "location", + "WGS84GeoPoint" + ] + ], + [ + "銀座 かずや", + 280743, + "128424629x503139222" + ], + [ + "たい焼き鉄次 大丸東京店", + 810303, + "128451283x503166852" + ], + [ + "たいやき神田達磨 八重洲店", + 970517, + "128453260x503174156" + ], + [ + "にしみや 甘味処", + 1056698, + "128418570x503188661" + ], + [ + "築地 さのきや", + 1186376, + "128397312x503174596" + ], + [ + "しげ田", + 1530425, + "128421454x503208983" + ], + [ + "柳屋 たい焼き", + 2179591, + "128467228x503222332" + ] + ] + ] +] #|e| geo_in_circle(): index for <Shops.location> is missing Modified: test/command/suite/select/filter/geo_in_circle/no_index/north_east.expected (+4 -1) =================================================================== --- test/command/suite/select/filter/geo_in_circle/no_index/north_east.expected 2016-04-03 11:31:19 +0900 (88d1578) +++ test/command/suite/select/filter/geo_in_circle/no_index/north_east.expected 2016-04-03 23:50:55 +0900 (dfe2125) @@ -1,4 +1,6 @@ -select LandMarks --sortby '_id' --output_columns 'point' --limit -1 --filter 'geo_in_circle(point, "11x11", "11x1") > 0' +table_remove Points +[[0,0.0,0.0],true] +select LandMarks --sortby '_id' --output_columns 'point' --limit -1 --filter 'geo_in_circle(point, "11x11", "11x1")' [ [ 0, @@ -946,3 +948,4 @@ select LandMarks --sortby '_id' --output_columns 'point' --limit -1 --filter ' ] ] ] +#|e| geo_in_circle(): index for <LandMarks.point> is missing Modified: test/command/suite/select/filter/geo_in_circle/no_index/north_east.test (+3 -1) =================================================================== --- test/command/suite/select/filter/geo_in_circle/no_index/north_east.test 2016-04-03 11:31:19 +0900 (a271b27) +++ test/command/suite/select/filter/geo_in_circle/no_index/north_east.test 2016-04-03 23:50:55 +0900 (1eb5123) @@ -1,4 +1,6 @@ #@include fixture/geo/in_circle/north_east.grn +table_remove Points + select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \ - --filter 'geo_in_circle(point, "11x11", "11x1") > 0' + --filter 'geo_in_circle(point, "11x11", "11x1")' -------------- next part -------------- HTML����������������������������...다운로드