From da1207052324a01abd0aee3cc7b78e76dfe527a0 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 21 Aug 2009 18:01:39 +0000 Subject: [PATCH] Do chinese ideogram indexing. --- t/Search/Index.t | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/t/Search/Index.t b/t/Search/Index.t index f8059dcbb..b02ff8d6e 100644 --- a/t/Search/Index.t +++ b/t/Search/Index.t @@ -242,4 +242,25 @@ cmp_deeply ( "Index has decoded entities" ); +#---------------------------------------------------------------------------- +# Test that Chinese ideographical characters are inserted and searchable. +use utf8; +$article->update({ + description => "甲骨文", +}); +$indexer = WebGUI::Search::Index->create( $article ); + +$row = $db->quickHashRef( "SELECT * FROM assetIndex WHERE assetId=?", [ $article->getId ] ); +cmp_deeply ( + $row, + superhashof({ + keywords => all( # keywords contains title, menuTitle, every part of the URL and every keyword + re("''甲''"), + re("''骨''"), + re("''文''"), + ), + }), + "Index has Chinese ideographs, separated by spaces and delimited with quotes to pad the length" +); + #vim:ft=perl