[Groonga-commit] groonga/groonga at 178fe02 [master] proc_fuzzy_search: use object literal arguments

Back to archive index

naoa null+****@clear*****
Thu Feb 18 00:53:18 JST 2016


naoa	2016-02-18 00:53:18 +0900 (Thu, 18 Feb 2016)

  New Revision: 178fe0235af9cb4a82767c9a8654108fd89b7165
  https://github.com/groonga/groonga/commit/178fe0235af9cb4a82767c9a8654108fd89b7165

  Merged 4d60980: Merge pull request #480 from naoa/support-object-literal

  Message:
    proc_fuzzy_search: use object literal arguments

  Modified files:
    lib/proc/proc_fuzzy_search.c
    test/command/suite/select/function/fuzzy_search/index/and.expected
    test/command/suite/select/function/fuzzy_search/index/and.test
    test/command/suite/select/function/fuzzy_search/index/hash.expected
    test/command/suite/select/function/fuzzy_search/index/hash.test
    test/command/suite/select/function/fuzzy_search/index/index.expected
    test/command/suite/select/function/fuzzy_search/index/index.test
    test/command/suite/select/function/fuzzy_search/index/index_column.expected
    test/command/suite/select/function/fuzzy_search/index/index_column.test
    test/command/suite/select/function/fuzzy_search/index/index_with_tokenizer.expected
    test/command/suite/select/function/fuzzy_search/index/index_with_tokenizer.test
    test/command/suite/select/function/fuzzy_search/index/or.expected
    test/command/suite/select/function/fuzzy_search/index/or.test
    test/command/suite/select/function/fuzzy_search/index/vector.expected
    test/command/suite/select/function/fuzzy_search/index/vector.test
    test/command/suite/select/function/fuzzy_search/pat/max_distance.expected
    test/command/suite/select/function/fuzzy_search/pat/max_distance.test
    test/command/suite/select/function/fuzzy_search/pat/max_expansion.expected
    test/command/suite/select/function/fuzzy_search/pat/max_expansion.test
    test/command/suite/select/function/fuzzy_search/pat/pat.expected
    test/command/suite/select/function/fuzzy_search/pat/pat.test
    test/command/suite/select/function/fuzzy_search/pat/prefix_length.expected
    test/command/suite/select/function/fuzzy_search/pat/prefix_length.test
    test/command/suite/select/function/fuzzy_search/pat/prefix_length_ja.expected
    test/command/suite/select/function/fuzzy_search/pat/prefix_length_ja.test
    test/command/suite/select/function/fuzzy_search/pat/transposition.expected
    test/command/suite/select/function/fuzzy_search/pat/transposition.test
    test/command/suite/select/function/fuzzy_search/sequential/and.expected
    test/command/suite/select/function/fuzzy_search/sequential/and.test
    test/command/suite/select/function/fuzzy_search/sequential/max_distance.expected
    test/command/suite/select/function/fuzzy_search/sequential/max_distance.test
    test/command/suite/select/function/fuzzy_search/sequential/max_expansion.expected
    test/command/suite/select/function/fuzzy_search/sequential/max_expansion.test
    test/command/suite/select/function/fuzzy_search/sequential/prefix_length.expected
    test/command/suite/select/function/fuzzy_search/sequential/prefix_length.test
    test/command/suite/select/function/fuzzy_search/sequential/prefix_length_ja.expected
    test/command/suite/select/function/fuzzy_search/sequential/prefix_length_ja.test
    test/command/suite/select/function/fuzzy_search/sequential/reference.expected
    test/command/suite/select/function/fuzzy_search/sequential/reference.test
    test/command/suite/select/function/fuzzy_search/sequential/reference_vector.expected
    test/command/suite/select/function/fuzzy_search/sequential/reference_vector.test
    test/command/suite/select/function/fuzzy_search/sequential/text.expected
    test/command/suite/select/function/fuzzy_search/sequential/text.test
    test/command/suite/select/function/fuzzy_search/sequential/transposition.expected
    test/command/suite/select/function/fuzzy_search/sequential/transposition.test
    test/command/suite/select/function/fuzzy_search/sequential/vector.expected
    test/command/suite/select/function/fuzzy_search/sequential/vector.test

  Modified: lib/proc/proc_fuzzy_search.c (+43 -12)
===================================================================
--- lib/proc/proc_fuzzy_search.c    2016-02-18 00:51:29 +0900 (4001e57)
+++ lib/proc/proc_fuzzy_search.c    2016-02-18 00:53:18 +0900 (8e16ce9)
@@ -296,6 +296,7 @@ selector_fuzzy_search(grn_ctx *ctx, grn_obj *table, grn_obj *index,
   grn_obj *target = NULL;
   grn_obj *obj;
   grn_obj *query;
+  grn_obj *hash_args_ptr;
   uint32_t max_distance = 1;
   uint32_t prefix_length = 0;
   uint32_t prefix_match_size = 0;
@@ -313,19 +314,49 @@ selector_fuzzy_search(grn_ctx *ctx, grn_obj *table, grn_obj *index,
   obj = args[1];
   query = args[2];
 
-  if (nargs >= 4) {
-    max_distance = GRN_UINT32_VALUE(args[3]);
-  }
-  if (nargs >= 5) {
-    prefix_length = GRN_UINT32_VALUE(args[4]);
-  }
-  if (nargs >= 6) {
-    max_expansion = GRN_UINT32_VALUE(args[5]);
-  }
-  if (nargs == 7) {
-    if (GRN_BOOL_VALUE(args[6])) {
-      flags |= GRN_TABLE_FUZZY_SEARCH_WITH_TRANSPOSITION;
+  if (nargs == 4) {
+    grn_obj *hash;
+    grn_hash_cursor *cursor;
+    void *key, *value;
+    int key_size, value_size;
+    hash_args_ptr = args[3];
+    if (hash_args_ptr->header.type == GRN_PTR) {
+      hash = GRN_PTR_VALUE(hash_args_ptr);
+    }
+    if (hash->header.type != GRN_TABLE_HASH_KEY) {
+      GRN_PLUGIN_ERROR(ctx, GRN_INVALID_ARGUMENT,
+                       "fuzzy_search(): 3rd argument must be object literal: <%.*s>",
+                       (int)GRN_TEXT_LEN(args[3]), GRN_TEXT_VALUE(args[3]));
+      goto exit;
+    }
+    hash = GRN_PTR_VALUE(hash_args_ptr);
+
+    if (!(cursor = grn_hash_cursor_open(ctx, (grn_hash *)hash, NULL, 0, NULL, 0, 0, -1, 0))) {
+      GRN_PLUGIN_ERROR(ctx, GRN_NO_MEMORY_AVAILABLE,
+                       "fuzzy_search(): couldn't open cursor");
+      goto exit;
+    }
+    while (grn_hash_cursor_next(ctx, cursor) != GRN_ID_NIL) {
+      value_size = grn_hash_cursor_get_key_value(ctx, cursor, &key, &key_size, &value);
+
+      if (key_size == 12 && !memcmp(key, "max_distance", 12)) {
+        max_distance = *(uint32_t *)value;
+      } else if (key_size == 13 && !memcmp(key, "prefix_length", 13)) {
+        prefix_length = *(uint32_t *)value;
+      } else if (key_size == 13 && !memcmp(key, "max_expansion", 13)) {
+        max_expansion = *(uint32_t *)value;
+      } else if (key_size == 18 && !memcmp(key, "with_transposition", 18)) {
+        if (*(grn_bool *)value) {
+          flags |= GRN_TABLE_FUZZY_SEARCH_WITH_TRANSPOSITION;
+        }
+      } else {
+        GRN_PLUGIN_ERROR(ctx, GRN_INVALID_ARGUMENT, "invalid option name: %.*s",
+                         key_size, (char *)key);
+        grn_hash_cursor_close(ctx, cursor);
+        goto exit;
+      }
     }
+    grn_hash_cursor_close(ctx, cursor);
   }
 
   if (index) {

  Modified: test/command/suite/select/function/fuzzy_search/index/and.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/and.expected    2016-02-18 00:51:29 +0900 (7aadd7f)
+++ test/command/suite/select/function/fuzzy_search/index/and.expected    2016-02-18 00:53:18 +0900 (575d7ea)
@@ -13,5 +13,5 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'name @^ "T" && fuzzy_search(name, "To", 1)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'name @^ "T" && fuzzy_search(name, "To")'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [[0,0.0,0.0],[[[1],[["name","ShortText"],["_score","Int32"]],["Tom",2]]]]

  Modified: test/command/suite/select/function/fuzzy_search/index/and.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/and.test    2016-02-18 00:51:29 +0900 (5c7d5a0)
+++ test/command/suite/select/function/fuzzy_search/index/and.test    2016-02-18 00:53:18 +0900 (efbc494)
@@ -11,6 +11,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Users --filter 'name @^ "T" && fuzzy_search(name, "To", 1)' \
+select Users --filter 'name @^ "T" && fuzzy_search(name, "To")' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/index/hash.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/hash.expected    2016-02-18 00:51:29 +0900 (ec46aff)
+++ test/command/suite/select/function/fuzzy_search/index/hash.expected    2016-02-18 00:53:18 +0900 (fa2d88b)
@@ -13,7 +13,7 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'fuzzy_search(name, "Tom", 1)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "Tom")'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/index/hash.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/hash.test    2016-02-18 00:51:29 +0900 (29ba7a5)
+++ test/command/suite/select/function/fuzzy_search/index/hash.test    2016-02-18 00:53:18 +0900 (e978c4e)
@@ -11,6 +11,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Users --filter 'fuzzy_search(name, "Tom", 1)' \
+select Users --filter 'fuzzy_search(name, "Tom")' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/index/index.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/index.expected    2016-02-18 00:51:29 +0900 (05d7426)
+++ test/command/suite/select/function/fuzzy_search/index/index.expected    2016-02-18 00:53:18 +0900 (360cb80)
@@ -14,7 +14,7 @@ load --table Users
 {"name": "Tom"}
 ]
 [[0,0.0,0.0],4]
-select Users --filter 'fuzzy_search(name, "Tom", 1)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "Tom")'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/index/index.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/index.test    2016-02-18 00:51:29 +0900 (ee0b845)
+++ test/command/suite/select/function/fuzzy_search/index/index.test    2016-02-18 00:53:18 +0900 (8014da0)
@@ -12,6 +12,6 @@ load --table Users
 {"name": "Tom"}
 ]
 
-select Users --filter 'fuzzy_search(name, "Tom", 1)' \
+select Users --filter 'fuzzy_search(name, "Tom")' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/index/index_column.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/index_column.expected    2016-02-18 00:51:29 +0900 (1b2c507)
+++ test/command/suite/select/function/fuzzy_search/index/index_column.expected    2016-02-18 00:53:18 +0900 (8751264)
@@ -13,7 +13,7 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'fuzzy_search(Tags.tag, "Tom", 1)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(Tags.tag, "Tom")'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/index/index_column.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/index_column.test    2016-02-18 00:51:29 +0900 (50d4a0f)
+++ test/command/suite/select/function/fuzzy_search/index/index_column.test    2016-02-18 00:53:18 +0900 (ed261dc)
@@ -11,6 +11,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Users --filter 'fuzzy_search(Tags.tag, "Tom", 1)' \
+select Users --filter 'fuzzy_search(Tags.tag, "Tom")' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/index/index_with_tokenizer.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/index_with_tokenizer.expected    2016-02-18 00:51:29 +0900 (f069a99)
+++ test/command/suite/select/function/fuzzy_search/index/index_with_tokenizer.expected    2016-02-18 00:53:18 +0900 (1787ad2)
@@ -14,7 +14,7 @@ load --table Users
 {"name": "Tom Yamad"}
 ]
 [[0,0.0,0.0],4]
-select Users --filter 'fuzzy_search(name, "Tom Yamad", 1)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "Tom Yamad")'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/index/index_with_tokenizer.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/index_with_tokenizer.test    2016-02-18 00:51:29 +0900 (431438b)
+++ test/command/suite/select/function/fuzzy_search/index/index_with_tokenizer.test    2016-02-18 00:53:18 +0900 (6a1494f)
@@ -12,6 +12,6 @@ load --table Users
 {"name": "Tom Yamad"}
 ]
 
-select Users --filter 'fuzzy_search(name, "Tom Yamad", 1)' \
+select Users --filter 'fuzzy_search(name, "Tom Yamad")' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/index/or.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/or.expected    2016-02-18 00:51:29 +0900 (929f6eb)
+++ test/command/suite/select/function/fuzzy_search/index/or.expected    2016-02-18 00:53:18 +0900 (90d25ac)
@@ -13,7 +13,7 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'name @^ "T" || fuzzy_search(name, "Ke", 1)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'name @^ "T" || fuzzy_search(name, "Ke")'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/index/or.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/or.test    2016-02-18 00:51:29 +0900 (a795b27)
+++ test/command/suite/select/function/fuzzy_search/index/or.test    2016-02-18 00:53:18 +0900 (3f091af)
@@ -11,6 +11,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Users --filter 'name @^ "T" || fuzzy_search(name, "Ke", 1)' \
+select Users --filter 'name @^ "T" || fuzzy_search(name, "Ke")' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/index/vector.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/vector.expected    2016-02-18 00:51:29 +0900 (d9cc0ca)
+++ test/command/suite/select/function/fuzzy_search/index/vector.expected    2016-02-18 00:53:18 +0900 (6f82ab3)
@@ -15,7 +15,7 @@ load --table Users
 {"name": ["Ken"]}
 ]
 [[0,0.0,0.0],5]
-select Users --filter 'fuzzy_search(name, "Tom", 2)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "Tom", {"max_distance": 2})'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/index/vector.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/index/vector.test    2016-02-18 00:51:29 +0900 (e9b6ecd)
+++ test/command/suite/select/function/fuzzy_search/index/vector.test    2016-02-18 00:53:18 +0900 (fc00eb2)
@@ -13,6 +13,6 @@ load --table Users
 {"name": ["Ken"]}
 ]
 
-select Users --filter 'fuzzy_search(name, "Tom", 2)' \
+select Users --filter 'fuzzy_search(name, "Tom", {"max_distance": 2})' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/pat/max_distance.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/max_distance.expected    2016-02-18 00:51:29 +0900 (fc844eb)
+++ test/command/suite/select/function/fuzzy_search/pat/max_distance.expected    2016-02-18 00:53:18 +0900 (cc82321)
@@ -13,7 +13,7 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Tags --filter 'fuzzy_search(_key, "To", 2)'   --output_columns '_key, _score'   --match_escalation_threshold -1
+select Tags --filter 'fuzzy_search(_key, "To", {"max_distance": 2})'   --output_columns '_key, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/pat/max_distance.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/max_distance.test    2016-02-18 00:51:29 +0900 (2971d78)
+++ test/command/suite/select/function/fuzzy_search/pat/max_distance.test    2016-02-18 00:53:18 +0900 (7b2bdc9)
@@ -11,6 +11,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Tags --filter 'fuzzy_search(_key, "To", 2)' \
+select Tags --filter 'fuzzy_search(_key, "To", {"max_distance": 2})' \
   --output_columns '_key, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/pat/max_expansion.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/max_expansion.expected    2016-02-18 00:51:29 +0900 (5bfc810)
+++ test/command/suite/select/function/fuzzy_search/pat/max_expansion.expected    2016-02-18 00:53:18 +0900 (a5da1ab)
@@ -13,5 +13,5 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Tags --filter 'fuzzy_search(_key, "To", 2, 0, 1)'   --output_columns '_key, _score'   --match_escalation_threshold -1
+select Tags --filter 'fuzzy_search(_key, "To", {"max_distance": 2, "max_expansion": 1})'   --output_columns '_key, _score'   --match_escalation_threshold -1
 [[0,0.0,0.0],[[[1],[["_key","ShortText"],["_score","Int32"]],["Tom",2]]]]

  Modified: test/command/suite/select/function/fuzzy_search/pat/max_expansion.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/max_expansion.test    2016-02-18 00:51:29 +0900 (14f5f4e1)
+++ test/command/suite/select/function/fuzzy_search/pat/max_expansion.test    2016-02-18 00:53:18 +0900 (d8ea7ea)
@@ -11,6 +11,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Tags --filter 'fuzzy_search(_key, "To", 2, 0, 1)' \
+select Tags --filter 'fuzzy_search(_key, "To", {"max_distance": 2, "max_expansion": 1})' \
   --output_columns '_key, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/pat/pat.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/pat.expected    2016-02-18 00:51:29 +0900 (41c531f)
+++ test/command/suite/select/function/fuzzy_search/pat/pat.expected    2016-02-18 00:53:18 +0900 (49a8dcf)
@@ -13,7 +13,7 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Tags --filter 'fuzzy_search(_key, "Tom", 1)'   --output_columns '_key, _score'   --match_escalation_threshold -1
+select Tags --filter 'fuzzy_search(_key, "Tom")'   --output_columns '_key, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/pat/pat.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/pat.test    2016-02-18 00:51:29 +0900 (5487475)
+++ test/command/suite/select/function/fuzzy_search/pat/pat.test    2016-02-18 00:53:18 +0900 (513aa9a)
@@ -11,6 +11,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Tags --filter 'fuzzy_search(_key, "Tom", 1)' \
+select Tags --filter 'fuzzy_search(_key, "Tom")' \
   --output_columns '_key, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/pat/prefix_length.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/prefix_length.expected    2016-02-18 00:51:29 +0900 (18df7a4)
+++ test/command/suite/select/function/fuzzy_search/pat/prefix_length.expected    2016-02-18 00:53:18 +0900 (17ba597)
@@ -13,7 +13,7 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Tags --filter 'fuzzy_search(_key, "To", 5, 1)'   --output_columns '_key, _score'   --match_escalation_threshold -1
+select Tags --filter 'fuzzy_search(_key, "To", {"max_distance": 5, "prefix_length": 1})'   --output_columns '_key, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/pat/prefix_length.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/prefix_length.test    2016-02-18 00:51:29 +0900 (d757302)
+++ test/command/suite/select/function/fuzzy_search/pat/prefix_length.test    2016-02-18 00:53:18 +0900 (c739a40)
@@ -11,6 +11,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Tags --filter 'fuzzy_search(_key, "To", 5, 1)' \
+select Tags --filter 'fuzzy_search(_key, "To", {"max_distance": 5, "prefix_length": 1})' \
   --output_columns '_key, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/pat/prefix_length_ja.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/prefix_length_ja.expected    2016-02-18 00:51:29 +0900 (191afa7)
+++ test/command/suite/select/function/fuzzy_search/pat/prefix_length_ja.expected    2016-02-18 00:53:18 +0900 (5de02cb)
@@ -13,7 +13,7 @@ load --table Users
 {"name": "けん"}
 ]
 [[0,0.0,0.0],3]
-select Tags --filter 'fuzzy_search(_key, "とむ", 5, 1)'   --output_columns '_key, _score'   --match_escalation_threshold -1
+select Tags --filter 'fuzzy_search(_key, "とむ", {"max_distance": 5, "prefix_length": 1})'   --output_columns '_key, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/pat/prefix_length_ja.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/prefix_length_ja.test    2016-02-18 00:51:29 +0900 (47929ba)
+++ test/command/suite/select/function/fuzzy_search/pat/prefix_length_ja.test    2016-02-18 00:53:18 +0900 (e10ee93)
@@ -11,6 +11,6 @@ load --table Users
 {"name": "けん"}
 ]
 
-select Tags --filter 'fuzzy_search(_key, "とむ", 5, 1)' \
+select Tags --filter 'fuzzy_search(_key, "とむ", {"max_distance": 5, "prefix_length": 1})' \
   --output_columns '_key, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/pat/transposition.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/transposition.expected    2016-02-18 00:51:29 +0900 (7f8b18d)
+++ test/command/suite/select/function/fuzzy_search/pat/transposition.expected    2016-02-18 00:53:18 +0900 (257b26a)
@@ -13,7 +13,7 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Tags --filter 'fuzzy_search(_key, "Toym", 1, 0, 0, true)'   --output_columns '_key, _score'   --match_escalation_threshold -1
+select Tags --filter 'fuzzy_search(_key, "Toym", {"with_transposition": true})'   --output_columns '_key, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/pat/transposition.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/pat/transposition.test    2016-02-18 00:51:29 +0900 (24c241e)
+++ test/command/suite/select/function/fuzzy_search/pat/transposition.test    2016-02-18 00:53:18 +0900 (5b4e9c1)
@@ -11,6 +11,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Tags --filter 'fuzzy_search(_key, "Toym", 1, 0, 0, true)' \
+select Tags --filter 'fuzzy_search(_key, "Toym", {"with_transposition": true})' \
   --output_columns '_key, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/sequential/and.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/and.expected    2016-02-18 00:51:29 +0900 (964cb6c)
+++ test/command/suite/select/function/fuzzy_search/sequential/and.expected    2016-02-18 00:53:18 +0900 (6a6dd3f)
@@ -9,5 +9,5 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'name @^ "T" && fuzzy_search(name, "To", 1)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'name @^ "T" && fuzzy_search(name, "To")'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [[0,0.0,0.0],[[[1],[["name","ShortText"],["_score","Int32"]],["Tom",2]]]]

  Modified: test/command/suite/select/function/fuzzy_search/sequential/and.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/and.test    2016-02-18 00:51:29 +0900 (f74d6ab)
+++ test/command/suite/select/function/fuzzy_search/sequential/and.test    2016-02-18 00:53:18 +0900 (c64ff31)
@@ -8,6 +8,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Users --filter 'name @^ "T" && fuzzy_search(name, "To", 1)' \
+select Users --filter 'name @^ "T" && fuzzy_search(name, "To")' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/sequential/max_distance.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/max_distance.expected    2016-02-18 00:51:29 +0900 (a4c1cfd)
+++ test/command/suite/select/function/fuzzy_search/sequential/max_distance.expected    2016-02-18 00:53:18 +0900 (2d72dc5)
@@ -9,7 +9,7 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'fuzzy_search(name, "To", 2)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "To", {"max_distance": 2})'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/sequential/max_distance.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/max_distance.test    2016-02-18 00:51:29 +0900 (a55430e)
+++ test/command/suite/select/function/fuzzy_search/sequential/max_distance.test    2016-02-18 00:53:18 +0900 (5774e20)
@@ -8,6 +8,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Users --filter 'fuzzy_search(name, "To", 2)' \
+select Users --filter 'fuzzy_search(name, "To", {"max_distance": 2})' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/sequential/max_expansion.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/max_expansion.expected    2016-02-18 00:51:29 +0900 (dd4bedb)
+++ test/command/suite/select/function/fuzzy_search/sequential/max_expansion.expected    2016-02-18 00:53:18 +0900 (ee9b450)
@@ -9,5 +9,5 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'fuzzy_search(name, "To", 2, 0, 1)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "To", {"max_distance": 2, "max_expansion": 1})'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [[0,0.0,0.0],[[[1],[["name","ShortText"],["_score","Int32"]],["Tom",2]]]]

  Modified: test/command/suite/select/function/fuzzy_search/sequential/max_expansion.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/max_expansion.test    2016-02-18 00:51:29 +0900 (3b0b59a)
+++ test/command/suite/select/function/fuzzy_search/sequential/max_expansion.test    2016-02-18 00:53:18 +0900 (10bb484)
@@ -8,6 +8,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Users --filter 'fuzzy_search(name, "To", 2, 0, 1)' \
+select Users --filter 'fuzzy_search(name, "To", {"max_distance": 2, "max_expansion": 1})' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/sequential/prefix_length.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/prefix_length.expected    2016-02-18 00:51:29 +0900 (8213bd8)
+++ test/command/suite/select/function/fuzzy_search/sequential/prefix_length.expected    2016-02-18 00:53:18 +0900 (5d4769f)
@@ -9,7 +9,7 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'fuzzy_search(name, "To", 5, 1)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "To", {"max_distance": 5, "prefix_length": 1})'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/sequential/prefix_length.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/prefix_length.test    2016-02-18 00:51:29 +0900 (ea1cd5e)
+++ test/command/suite/select/function/fuzzy_search/sequential/prefix_length.test    2016-02-18 00:53:18 +0900 (c0dfc4c)
@@ -8,6 +8,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Users --filter 'fuzzy_search(name, "To", 5, 1)' \
+select Users --filter 'fuzzy_search(name, "To", {"max_distance": 5, "prefix_length": 1})' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/sequential/prefix_length_ja.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/prefix_length_ja.expected    2016-02-18 00:51:29 +0900 (bdf80bb)
+++ test/command/suite/select/function/fuzzy_search/sequential/prefix_length_ja.expected    2016-02-18 00:53:18 +0900 (b6dbefb)
@@ -9,7 +9,7 @@ load --table Users
 {"name": "けん"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'fuzzy_search(name, "とむ", 5, 1)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "とむ", {"max_distance": 5, "prefix_length": 1})'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/sequential/prefix_length_ja.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/prefix_length_ja.test    2016-02-18 00:51:29 +0900 (cc94171)
+++ test/command/suite/select/function/fuzzy_search/sequential/prefix_length_ja.test    2016-02-18 00:53:18 +0900 (a053fe7)
@@ -8,6 +8,6 @@ load --table Users
 {"name": "けん"}
 ]
 
-select Users --filter 'fuzzy_search(name, "とむ", 5, 1)' \
+select Users --filter 'fuzzy_search(name, "とむ", {"max_distance": 5, "prefix_length": 1})' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/sequential/reference.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/reference.expected    2016-02-18 00:51:29 +0900 (1a8d5fe)
+++ test/command/suite/select/function/fuzzy_search/sequential/reference.expected    2016-02-18 00:53:18 +0900 (d54b3d4)
@@ -11,5 +11,5 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'fuzzy_search(name, "Tom", 2)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "Tom", {"max_distance": 2})'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [[0,0.0,0.0],[[[2],[["name","Tag"],["_score","Int32"]],["Tom",3],["Tomy",2]]]]

  Modified: test/command/suite/select/function/fuzzy_search/sequential/reference.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/reference.test    2016-02-18 00:51:29 +0900 (669ee5a)
+++ test/command/suite/select/function/fuzzy_search/sequential/reference.test    2016-02-18 00:53:18 +0900 (a09b5a4)
@@ -10,6 +10,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Users --filter 'fuzzy_search(name, "Tom", 2)' \
+select Users --filter 'fuzzy_search(name, "Tom", {"max_distance": 2})' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/sequential/reference_vector.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/reference_vector.expected    2016-02-18 00:51:29 +0900 (c1c5a3b)
+++ test/command/suite/select/function/fuzzy_search/sequential/reference_vector.expected    2016-02-18 00:53:18 +0900 (8c974d8)
@@ -11,7 +11,7 @@ load --table Users
 {"name": ["Ken"]}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'fuzzy_search(name, "Tom", 2)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "Tom", {"max_distance": 2})'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/sequential/reference_vector.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/reference_vector.test    2016-02-18 00:51:29 +0900 (8d7c3d8)
+++ test/command/suite/select/function/fuzzy_search/sequential/reference_vector.test    2016-02-18 00:53:18 +0900 (a7d668d)
@@ -10,6 +10,6 @@ load --table Users
 {"name": ["Ken"]}
 ]
 
-select Users --filter 'fuzzy_search(name, "Tom", 2)' \
+select Users --filter 'fuzzy_search(name, "Tom", {"max_distance": 2})' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/sequential/text.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/text.expected    2016-02-18 00:51:29 +0900 (eaca3d9)
+++ test/command/suite/select/function/fuzzy_search/sequential/text.expected    2016-02-18 00:53:18 +0900 (fd14611)
@@ -9,7 +9,7 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'fuzzy_search(name, "Tom", 1)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "Tom")'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/sequential/text.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/text.test    2016-02-18 00:51:29 +0900 (a4aa0c1)
+++ test/command/suite/select/function/fuzzy_search/sequential/text.test    2016-02-18 00:53:18 +0900 (1aad0f1)
@@ -8,6 +8,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Users --filter 'fuzzy_search(name, "Tom", 1)' \
+select Users --filter 'fuzzy_search(name, "Tom")' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/sequential/transposition.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/transposition.expected    2016-02-18 00:51:29 +0900 (78e2290)
+++ test/command/suite/select/function/fuzzy_search/sequential/transposition.expected    2016-02-18 00:53:18 +0900 (4a12600)
@@ -9,7 +9,7 @@ load --table Users
 {"name": "Ken"}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'fuzzy_search(name, "Toym", 1, 0, 0, true)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "Toym", {"with_transposition": true})'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/sequential/transposition.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/transposition.test    2016-02-18 00:51:29 +0900 (7a421bf)
+++ test/command/suite/select/function/fuzzy_search/sequential/transposition.test    2016-02-18 00:53:18 +0900 (336bae0)
@@ -8,6 +8,6 @@ load --table Users
 {"name": "Ken"}
 ]
 
-select Users --filter 'fuzzy_search(name, "Toym", 1, 0, 0, true)' \
+select Users --filter 'fuzzy_search(name, "Toym", {"with_transposition": true})' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1

  Modified: test/command/suite/select/function/fuzzy_search/sequential/vector.expected (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/vector.expected    2016-02-18 00:51:29 +0900 (4e3e521)
+++ test/command/suite/select/function/fuzzy_search/sequential/vector.expected    2016-02-18 00:53:18 +0900 (d5b7ae6)
@@ -9,7 +9,7 @@ load --table Users
 {"name": ["Ken"]}
 ]
 [[0,0.0,0.0],3]
-select Users --filter 'fuzzy_search(name, "Tom", 2)'   --output_columns 'name, _score'   --match_escalation_threshold -1
+select Users --filter 'fuzzy_search(name, "Tom", {"max_distance": 2})'   --output_columns 'name, _score'   --match_escalation_threshold -1
 [
   [
     0,

  Modified: test/command/suite/select/function/fuzzy_search/sequential/vector.test (+1 -1)
===================================================================
--- test/command/suite/select/function/fuzzy_search/sequential/vector.test    2016-02-18 00:51:29 +0900 (bf61c58)
+++ test/command/suite/select/function/fuzzy_search/sequential/vector.test    2016-02-18 00:53:18 +0900 (67789a5)
@@ -8,6 +8,6 @@ load --table Users
 {"name": ["Ken"]}
 ]
 
-select Users --filter 'fuzzy_search(name, "Tom", 2)' \
+select Users --filter 'fuzzy_search(name, "Tom", {"max_distance": 2})' \
   --output_columns 'name, _score' \
   --match_escalation_threshold -1
-------------- next part --------------
HTML����������������������������...
Download 



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