Yoji Shidara
null+****@clear*****
Wed Jan 22 11:15:25 JST 2014
Yoji Shidara 2014-01-22 11:15:25 +0900 (Wed, 22 Jan 2014) New Revision: 0ba5c5f7d9a9b3f095ad8d584c4533228cfc7ec8 https://github.com/droonga/fluent-plugin-droonga/commit/0ba5c5f7d9a9b3f095ad8d584c4533228cfc7ec8 Message: search: add a test case for sub records in complex Modified files: test/unit/plugin/handler/test_search.rb Modified: test/unit/plugin/handler/test_search.rb (+78 -0) =================================================================== --- test/unit/plugin/handler/test_search.rb 2014-01-20 19:29:23 +0900 (aa5ff1f) +++ test/unit/plugin/handler/test_search.rb 2014-01-22 11:15:25 +0900 (67e0515) @@ -380,6 +380,84 @@ class SearchHandlerTest < Test::Unit::TestCase }) end + def test_attributes_subrecs_complex + pend "Not implemented" + assert_search({ + "sections-result" => { + "attributes" => { + "key" => { + "type" => "ShortText", + "vector" => false + }, + "title" => { + "type" => "ShortText", + "vector" => false + }, + "_nsubrecs" => { + "type" => "Int32", + "vector" => false + }, + "subrecs" => { + "attributes" => { + "_key" => { + "type" => "ShortText", + "vector" => false + }, + "sectionTitle" => { + "type" => "ShortText", + "vector" => false + }, + "documentTitle" => { + "type" => "ShortText", + "vector" => false + } + } + } + } + }, + }, + { + "queries" => { + "sections-result" => { + "source" => "Sections", + "groupBy" => { + "key" => "document", + "maxNSubRecords" => 1 + }, + "output" => { + "format" => "complex", + "elements" => [ + "attributes" + ], + "attributes" => [ + { + "label" => "key", + "source" => "_key", + }, + "title", + "_nsubrecs", + { + "label" => "subrecs", + "source" => "_subrecs", + "attributes" => [ + "_key", + { + "label" => "sectionTitle", + "source" => "title" + }, + { + "label" => "documentTitle", + "source" => "document.title" + } + ] + } + ], + }, + }, + }, + }) + end + class AttributesTest < self def test_source_only expected = { -------------- next part -------------- HTML����������������������������...Download