NodeJS SDK does not return Full text search "Total Hits"


#1

I use couchbase 5.1 Full text search capability and use node js sdk to execute a full text search query . In the results , i dont see the "Total hits " returned . However , the API’s return the “total hits” in full text search results .
What could be the reason the SDK way of doing FTS does not return “total hits” in results ?


#2

Hi, what version of the SDK are you using? Using 2.4.6 and using a callback of the form

bucket.query(query, function(err, res, meta) {
  console.log(meta);
});

I see this which includes totalHits

{ status: { total: 6, failed: 0, successful: 6 },
  request:
   { query: { term: 'hotels' },
     size: 10,
     from: 0,
     highlight: null,
     fields: null,
     facets: null,
     explain: false,
     sort: [ '-_score' ],
     includeLocations: false },
  hits: [],
  took: 2829648705,
  facets: {},
  totalHits: 129,
  maxScore: 0.7432322330657504 }

#3

thanks , figured it out