[Groonga-commit] groonga/groonga at 82d0e2c [master] grn_table_select: fix too much score with GRN_OP_AND and temporary table

Back to archive index

Kouhei Sutou null+****@clear*****
Mon May 28 18:20:04 JST 2018


Kouhei Sutou	2018-05-28 18:20:04 +0900 (Mon, 28 May 2018)

  New Revision: 82d0e2c87c315173dd14a231a67dab277b3d2be9
  https://github.com/groonga/groonga/commit/82d0e2c87c315173dd14a231a67dab277b3d2be9

  Message:
    grn_table_select: fix too much score with GRN_OP_AND and temporary table

  Added files:
    test/command/suite/select/function/query/and_and_and_or.expected
    test/command/suite/select/function/query/and_and_and_or.test
  Modified files:
    lib/expr.c

  Modified: lib/expr.c (+1 -1)
===================================================================
--- lib/expr.c    2018-05-28 18:19:32 +0900 (27d0e2c83)
+++ lib/expr.c    2018-05-28 18:20:04 +0900 (658293304)
@@ -4844,7 +4844,7 @@ grn_table_select(grn_ctx *ctx, grn_obj *table, grn_obj *expr,
                 grn_rset_recinfo *ri = value;
                 grn_rset_recinfo *base_ri = base_value;
                 grn_memcpy(base_ri, ri, ((grn_hash *)base_res)->value_size);
-                base_ri->score--;
+                base_ri->score = 0;
               }
             });
           }

  Added: test/command/suite/select/function/query/and_and_and_or.expected (+14 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/function/query/and_and_and_or.expected    2018-05-28 18:20:04 +0900 (eff747cc8)
@@ -0,0 +1,14 @@
+table_create Users TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Users name COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Users memo COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+load --table Users
+[
+{"name": "Alice", "memo": "Groonga user"},
+{"name": "Bob",   "memo": "Rroonga user"}
+]
+[[0,0.0,0.0],2]
+select Users   --output_columns _score   --filter 'memo @ "Groonga" && memo @ "Groonga" && memo @ "Groonga" && query("name", "Alice OR Bob")'
+[[0,0.0,0.0],[[[1],[["_score","Int32"]],[4]]]]

  Added: test/command/suite/select/function/query/and_and_and_or.test (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/function/query/and_and_and_or.test    2018-05-28 18:20:04 +0900 (3557e4ac2)
@@ -0,0 +1,13 @@
+table_create Users TABLE_NO_KEY
+column_create Users name COLUMN_SCALAR ShortText
+column_create Users memo COLUMN_SCALAR ShortText
+
+load --table Users
+[
+{"name": "Alice", "memo": "Groonga user"},
+{"name": "Bob",   "memo": "Rroonga user"}
+]
+
+select Users \
+  --output_columns _score \
+  --filter 'memo @ "Groonga" && memo @ "Groonga" && memo @ "Groonga" && query("name", "Alice OR Bob")'
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180528/083e55ab/attachment-0001.htm 



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