[groonga-dev,00340] :key_normalize => true 時にの検索の漏れについて

Back to archive index

SHIDARA Yoji dara****@shida*****
2010年 3月 21日 (日) 14:58:54 JST


しだらです。

:key_normalize => true 時に、検索の漏れが発生することがあるようです。
以前にも似ている現象がありましたが、今回は(複数の?)記号が絡む場合のようです。

ruby-groonga のテストを以下のようにすると確認できます。
#必要でしたらコミットしておきます

Index: test/test-table-select-normalize.rb
===================================================================
--- test/test-table-select-normalize.rb	(revision 1046)
+++ test/test-table-select-normalize.rb	(working copy)
@@ -32,7 +32,7 @@
                               :with_section => true,
                               :source => "Comments.content")
     @japanese_comment =
-      @comments.add(:content => "うちのボロTVはまだ現役です",
+      @comments.add(:content => "うちのボロTV(アナログ...)はまだ現役です",
                     :created_at => Time.parse("2009-06-09"))
   end

@@ -41,6 +41,11 @@
     assert_equal_select_result([@japanese_comment], result)
   end

+  def test_select_query_with_japanese_parenthesis
+    result =****@comme*****("content:@)は")
+    assert_equal_select_result([@japanese_comment], result)
+  end
+
   def test_select_query_only_in_japanese
     result =****@comme*****("content:@うちの")
     assert_equal_select_result([@japanese_comment], result)

実行結果は以下のとおりです:

garlic:~/local/src/ruby-groonga/test% ./run-test.rb -n /parenthesis/
Loaded suite ./run-test
Started
F

  1) Failure:
test_select_query_with_japanese_parenthesis(TableSelectNormalizeTest)
    [/home/dara/local/src/ruby-groonga/test/groonga-test-utils.rb:102:in
`assert_equal_select_result'
     /home/dara/local/src/ruby-groonga/test/test-table-select-normalize.rb:46:in
`test_select_query_with_japanese_parenthesis']:
#<Groonga::Expression noname(?0:0){2content GET_VALUE,0")は",0MATCH}>
<[#<Groonga::Record:0x7fbef61679b8
  @id=1,
  @table=
   #<Groonga::Array id: <256>, name: <Comments>, path:
</home/dara/local/src/ruby-groonga/test/tmp/database.0000100>, domain:
(nil), range: (nil), flags: <>, size: <1>>>]> expected but was
<[]>

diff:
? [#<Groonga::Record:0x7fbef61679b8
?  ]
-   @id=1,
-   @table=
-    #<Groonga::Array id: <256>, name: <Comments>, path:
</home/dara/local/src/ruby-groonga/test/tmp/database.0000100>, domain:
(nil), range: (nil), flags: <>, size: <1>>>]

Finished in 0.430873 seconds.

1 tests, 1 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions,
0 notifications
0% passed

-- 
SHIDARA Yoji
本を書きました! http://www.amazon.co.jp/dp/4798119881




groonga-dev メーリングリストの案内
Back to archive index