forked from lbdremy/solr-node-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a test for simple groupBy query
- Loading branch information
Showing
1 changed file
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,33 @@ | ||
//TODO support http://wiki.apache.org/solr/FieldCollapsing?highlight=%28field%29%7C%28collapsing%29 | ||
//TODO support http://wiki.apache.org/solr/FieldCollapsing?highlight=%28field%29%7C%28collapsing%29 | ||
/** | ||
* Modules dependencies | ||
*/ | ||
|
||
var mocha = require('mocha'), | ||
assert = require('chai').assert, | ||
libPath = process.env['SOLR_CLIENT_COV'] ? '../lib-cov' : '../lib', | ||
solr = require( libPath + '/solr'), | ||
sassert = require('./sassert'); | ||
|
||
// Test suite | ||
var client = solr.createClient(); | ||
|
||
|
||
describe('Group',function(){ | ||
|
||
describe('#groupBy(field), callback)',function(){ | ||
it('should return grouped results',function(done){ | ||
var query = client.createQuery() | ||
.q({ | ||
title_t: 'title1' | ||
}) | ||
.groupBy('title_t'); | ||
client.search(query, function(err, data){ | ||
sassert.ok(err, data); | ||
assert(data.responseHeader.params.group); | ||
assert.equal('title_t', data.responseHeader.params['group.field']); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |