YUKI Hiroshi
null+****@clear*****
Fri Aug 24 16:01:10 JST 2012
YUKI Hiroshi 2012-08-24 16:01:10 +0900 (Fri, 24 Aug 2012) New Revision: 368def6ac2b86ed4de68e72c0f8c2417b5b20ad2 https://github.com/groonga/gcs/commit/368def6ac2b86ed4de68e72c0f8c2417b5b20ad2 Log: Add test for "nosearch" Modified files: test/api-search.test.js Modified: test/api-search.test.js (+6 -10) =================================================================== --- test/api-search.test.js 2012-08-24 15:56:12 +0900 (f6bec6f) +++ test/api-search.test.js 2012-08-24 16:01:10 +0900 (a63a17c) @@ -400,23 +400,20 @@ suite('Search API', function() { } ); -/* searchability of text field cannot be configured. how should I test it? - testSearch('/2011-02-01/search?q=Jack', - 'should match only nickname, by searchability', + testSearch('/2011-02-01/search?bq=type:\'human\'', + 'should return empty result, for search query about "nosearch" field', 'search-people-00000000000000000000000000.localhost', function() { - domain.getIndexField('realname').setSearchEnabled(false).saveOptionsSync(); + domain.getIndexField('type').setSearchEnabled(false).saveOptionsSync(); }, function(response) { var expected = { rank: '-text_relevance', - 'match-expr': "(label 'Jack')", + 'match-expr': "type:'human'", hits: { - found: 1, + found: 0, start: 0, - hit: [ - { id: 'id2' } - ] + hit: [] }, info: { rid: '000000000000000000000000000000000000000000000000000000000000000', @@ -427,7 +424,6 @@ suite('Search API', function() { assert.deepEqual(response.normalizedBody, expected); } ); -*/ testSearch('/2011-02-01/search?q=Jack&return-fields=realname,nickname,type,unknown', 'should return only "realname" field by resultEnabled', -------------- next part -------------- HTML����������������������������...Download