Yoji Shidara
null+****@clear*****
Mon Jan 20 18:33:55 JST 2014
Yoji Shidara 2014-01-20 18:33:55 +0900 (Mon, 20 Jan 2014) New Revision: a9af7d5246f14af60b15abe1489ec2cb03b715a1 https://github.com/droonga/fluent-plugin-droonga/commit/a9af7d5246f14af60b15abe1489ec2cb03b715a1 Message: Add a test case for output attribtues of subrecs Modified files: test/unit/plugin/handler/test_search.rb Modified: test/unit/plugin/handler/test_search.rb (+79 -0) =================================================================== --- test/unit/plugin/handler/test_search.rb 2014-01-20 18:11:25 +0900 (a6c08f5) +++ test/unit/plugin/handler/test_search.rb 2014-01-20 18:33:55 +0900 (e56ab67) @@ -297,6 +297,85 @@ class SearchHandlerTest < Test::Unit::TestCase }) end + def test_attributes_subrecs_simple + pend "Not implemented yet" + assert_search({ + "sections-result" => { + "attributes" => [ + { + "name" => "key", + "type" => "ShortText", + "vector" => false + }, + { + "name" => "title", + "type" => "ShortText", + "vector" => false + }, + { + "name" => "_nsubrecs", + "type" => "Int32", + "vector" => false + }, + { + "name" => "subrecs", + "attributes" => [ + { + "name" => "sectionTitle", + "type" => "ShortText", + "vector" => false + }, + { + "name" => "documentTitle", + "type" => "ShortText", + "vector" => false + } + ] + } + ] + }, + }, + { + "queries" => { + "sections-result" => { + "source" => "Sections", + "groupBy" => { + "key" => "document", + "maxNSubRecords" => 1 + }, + "output" => { + "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