Kouhei Sutou
null+****@clear*****
Mon May 12 11:52:55 JST 2014
Kouhei Sutou 2014-05-12 11:52:55 +0900 (Mon, 12 May 2014) New Revision: 16a31576434e5fe71dd0b3c240e8cd31454a77ec https://github.com/droonga/droonga-engine/commit/16a31576434e5fe71dd0b3c240e8cd31454a77ec Message: test: use catalog.json to define schema Added files: test/command/suite/search/group/string.catalog.json Modified files: test/command/suite/search/group/string.expected test/command/suite/search/group/string.test Added: test/command/suite/search/group/string.catalog.json (+41 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/search/group/string.catalog.json 2014-05-12 11:52:55 +0900 (78e00fd) @@ -0,0 +1,41 @@ +{ + "datasets": { + "Droonga": { + "schema": { + "Sections": { + "type": "Hash", + "keyType": "ShortText", + "columns": { + "document": { + "type": "Scalar", + "valueType": "ShortText" + }, + "title": { + "type": "Scalar", + "valueType": "ShortText" + } + } + }, + "Terms": { + "type": "PatriciaTrie", + "keyType": "ShortText", + "normalizer": "NormalizerAuto", + "tokenizer": "TokenBigram", + "columns": { + "title_index": { + "type": "Index", + "valueType": "Sections", + "indexOptions": { + "sources": [ + "title" + ], + "position": true + } + } + } + } + }, + "fact": "Sections" + } + } +} Modified: test/command/suite/search/group/string.expected (+6 -18) =================================================================== --- test/command/suite/search/group/string.expected 2014-05-12 10:08:36 +0900 (3d419c0) +++ test/command/suite/search/group/string.expected 2014-05-12 11:52:55 +0900 (6156bb4) @@ -3,28 +3,16 @@ "statusCode": 200, "type": "search.result", "body": { - "Groonga": { - "count": 4, + "documents": { + "count": 2, "records": [ [ - "Groonga overview" - ], - [ - "Groonga library" - ], - [ - "Groonga server" + "Groonga", + 3 ], [ - "Groonga storage engine" - ] - ] - }, - "documents": { - "count": 1, - "records": [ - [ - "Groonga" + "Mroonga", + 2 ] ] } Modified: test/command/suite/search/group/string.test (+66 -21) =================================================================== --- test/command/suite/search/group/string.test 2014-05-12 10:08:36 +0900 (2a14808) +++ test/command/suite/search/group/string.test 2014-05-12 11:52:55 +0900 (12351dd) @@ -1,30 +1,75 @@ -#@include fixture/documents.jsons +#@require-catalog-version 2 +#@disable-logging +{ + "dataset": "Droonga", + "type": "add", + "body": { + "table": "Sections", + "key": "groonga-1.1", + "values": { + "document": "Groonga", + "title": "Groonga overview" + } + } +} +{ + "dataset": "Droonga", + "type": "add", + "body": { + "table": "Sections", + "key": "groonga-1.2", + "values": { + "document": "Groonga", + "title": "Full text search and Instant update" + } + } +} +{ + "dataset": "Droonga", + "type": "add", + "body": { + "table": "Sections", + "key": "groonga-1.3", + "values": { + "document": "Groonga", + "title": "Column store and aggregate query" + } + } +} +{ + "dataset": "Droonga", + "type": "add", + "body": { + "table": "Sections", + "key": "mroonga-1.1", + "values": { + "document": "Mroonga", + "title": "What is Mroonga?" + } + } +} +{ + "dataset": "Droonga", + "type": "add", + "body": { + "table": "Sections", + "key": "mroonga-1.2", + "values": { + "document": "Mroonga", + "title": "The successor of Tritonn" + } + } +} +#@enable-logging { "type": "search", "dataset": "Droonga", "body": { "queries": { - "Groonga": { - "source": "Sections", - "condition": { - "query": "groonga", - "matchTo": ["title"] - }, - "sortBy": ["_key"], - "output": { - "elements": [ - "count", - "attributes", - "records" - ], - "limit": -1, - "attributes": ["title"] - } - }, "documents": { - "source": "Groonga", + "source": "Sections", "groupBy": "document", - "sortBy": ["-_key"], + "sortBy": ["-_nsubrecs"], "output": { "elements": [ "count", @@ -32,7 +77,7 @@ "records" ], "limit": -1, - "attributes": ["_key"] + "attributes": ["_key", "_nsubrecs"] } } } -------------- next part -------------- HTML����������������������������... ダウンロード