[Groonga-commit] droonga/fluent-plugin-droonga at 883a8a7 [master] Add a test case for output attribtues of subrecs

Back to archive index

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: 883a8a73c9cdd762cc95866c2995fb0bc25ad55b
  https://github.com/droonga/fluent-plugin-droonga/commit/883a8a73c9cdd762cc95866c2995fb0bc25ad55b

  Merged 1ab6677: Merge branch 'output-attributes'

  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����������������������������...
다운로드 



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