Skip to content

Commit

Permalink
making the facet-test pass --> by picking a facet field (author) that…
Browse files Browse the repository at this point in the history
… exists in the schema and adding the extra returned data to compare
  • Loading branch information
marc-portier committed Jul 18, 2014
1 parent 16a1819 commit a2f764a
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions test/facet-query-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Client#createQuery()',function(){
var facetOptions = {
"on": true
, "query": "query"
, "field": "field"
, "field": "author"
, "prefix": "prefix"
, "sort": "field desc"
, "limit": 100
Expand Down Expand Up @@ -62,15 +62,23 @@ describe('Client#createQuery()',function(){
.q({ title_t : 'test'})
.debugQuery();
client.search(query,function(err,data){
console.log("\n\n--> client response\n err=%s\n data=%j\n", err, data);
sassert.ok(err,data);
assert.deepEqual(data.responseHeader.params,
{
facet: 'true',
wt: 'json',
debugQuery: 'true',
q: 'title_t:test',
'facet.field': 'field'
/* Other response params here */
"facet.field": 'author',
"facet.limit": "100",
"facet.method": "fc",
"facet.mincount": "10",
"facet.missing": "true",
"facet.offset": "5",
"facet.prefix": "prefix",
"facet.query": "query",
"facet.sort": "field\\ desc"
}
);
assert.equal(data.debug.QParser,'LuceneQParser');
Expand All @@ -83,7 +91,7 @@ describe('Client#createQuery()',function(){
var facetOptions = {
"on": true
, "query": "query"
, "field": "field"
, "field": "author"
, "prefix": "prefix"
, "sort": "field desc"
, "limit": 100
Expand Down Expand Up @@ -126,8 +134,15 @@ describe('Client#createQuery()',function(){
wt: 'json',
debugQuery: 'true',
q: 'title_t:test',
'facet.field': 'field'
/* Other response params here */
"facet.field": 'author',
"facet.limit": "100",
"facet.method": "fc",
"facet.mincount": "10",
"facet.missing": "true",
"facet.offset": "5",
"facet.prefix": "prefix",
"facet.query": "query",
"facet.sort": "field\\ desc"
}
);
assert.equal(data.debug.QParser,'LuceneQParser');
Expand Down

0 comments on commit a2f764a

Please sign in to comment.