[Groonga-commit] groonga/groonga at d45842a [master] Embed fuzzy arguments

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Feb 5 17:27:18 JST 2016


Kouhei Sutou	2016-02-05 17:27:18 +0900 (Fri, 05 Feb 2016)

  New Revision: d45842af0d273234646165a483724fcc5f51fa63
  https://github.com/groonga/groonga/commit/d45842af0d273234646165a483724fcc5f51fa63

  Message:
    Embed fuzzy arguments

  Modified files:
    include/groonga/groonga.h
    lib/db.c
    lib/grn_ii.h
    lib/ii.c
    lib/proc.c

  Modified: include/groonga/groonga.h (+1 -1)
===================================================================
--- include/groonga/groonga.h    2016-02-05 17:23:45 +0900 (998a96f)
+++ include/groonga/groonga.h    2016-02-05 17:27:18 +0900 (55e384f)
@@ -957,7 +957,7 @@ struct _grn_search_optarg {
   grn_obj *scorer;
   grn_obj *scorer_args_expr;
   unsigned int scorer_args_expr_offset;
-  grn_fuzzy_optarg *fuzzy;
+  grn_fuzzy_optarg fuzzy;
 };
 
 GRN_API grn_rc grn_obj_search(grn_ctx *ctx, grn_obj *obj, grn_obj *query,

  Modified: lib/db.c (+1 -1)
===================================================================
--- lib/db.c    2016-02-05 17:23:45 +0900 (316838c)
+++ lib/db.c    2016-02-05 17:27:18 +0900 (56e2c07)
@@ -3462,7 +3462,7 @@ grn_obj_search(grn_ctx *ctx, grn_obj *obj, grn_obj *query,
           }
           if (optarg && optarg->mode == GRN_OP_FUZZY) {
             rc = grn_table_fuzzy_search(ctx, obj, key, key_size,
-                                        optarg->fuzzy, res);
+                                        &(optarg->fuzzy), res);
           } else {
             rc = grn_table_search(ctx, obj, key, key_size, mode, res, op);
           }

  Modified: lib/grn_ii.h (+1 -1)
===================================================================
--- lib/grn_ii.h    2016-02-05 17:23:45 +0900 (9c5c104)
+++ lib/grn_ii.h    2016-02-05 17:27:18 +0900 (432abac)
@@ -143,7 +143,7 @@ struct _grn_select_optarg {
   grn_obj *scorer;
   grn_obj *scorer_args_expr;
   unsigned int scorer_args_expr_offset;
-  grn_fuzzy_optarg *fuzzy;
+  grn_fuzzy_optarg fuzzy;
 };
 
 GRN_API grn_rc grn_ii_column_update(grn_ctx *ctx, grn_ii *ii, grn_id id,

  Modified: lib/ii.c (+2 -2)
===================================================================
--- lib/ii.c    2016-02-05 17:23:45 +0900 (5fc0eb5)
+++ lib/ii.c    2016-02-05 17:27:18 +0900 (1756ea1)
@@ -6572,7 +6572,7 @@ grn_ii_select(grn_ctx *ctx, grn_ii *ii,
     return GRN_NO_MEMORY_AVAILABLE;
   }
   if (mode == GRN_OP_FUZZY) {
-    if (token_info_build_fuzzy(ctx, lexicon, ii, string, string_len, tis, &n, &only_skip_token, mode, optarg->fuzzy) || !n) { goto exit; }
+    if (token_info_build_fuzzy(ctx, lexicon, ii, string, string_len, tis, &n, &only_skip_token, mode, &(optarg->fuzzy)) || !n) { goto exit; }
   } else {
     if (token_info_build(ctx, lexicon, ii, string, string_len, tis, &n, &only_skip_token, mode) || !n) { goto exit; }
   }
@@ -6884,7 +6884,7 @@ grn_ii_estimate_size_for_query(grn_ctx *ctx, grn_ii *ii,
   case GRN_OP_FUZZY :
     rc = token_info_build_fuzzy(ctx, lexicon, ii, query, query_len,
                                 tis, &n_tis, &only_skip_token, mode,
-                                optarg->fuzzy);
+                                &(optarg->fuzzy));
     break;
   default :
     rc = token_info_build(ctx, lexicon, ii, query, query_len,

  Modified: lib/proc.c (+4 -6)
===================================================================
--- lib/proc.c    2016-02-05 17:23:45 +0900 (b729f34)
+++ lib/proc.c    2016-02-05 17:27:18 +0900 (b9b9685)
@@ -7127,7 +7127,6 @@ selector_fuzzy_search(grn_ctx *ctx, grn_obj *table, grn_obj *index,
     goto exit;
   } else {
     grn_search_optarg options;
-    grn_fuzzy_optarg args;
     options.mode = GRN_OP_FUZZY;
     options.similarity_threshold = 0;
     options.max_interval = 0;
@@ -7136,11 +7135,10 @@ selector_fuzzy_search(grn_ctx *ctx, grn_obj *table, grn_obj *index,
     options.proc = NULL;
     options.max_size = 0;
     options.scorer = NULL;
-    args.prefix_match_size = prefix_match_size;
-    args.max_distance = max_distance;
-    args.max_expansion = max_expansion;
-    args.flags = flags;
-    options.fuzzy = &args;
+    options.fuzzy.prefix_match_size = prefix_match_size;
+    options.fuzzy.max_distance = max_distance;
+    options.fuzzy.max_expansion = max_expansion;
+    options.fuzzy.flags = flags;
     grn_obj_search(ctx, target, query, res, op, &options);
   }
 
-------------- next part --------------
HTML����������������������������...
Download 



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