backbone-db-elasticsearch
Advanced tools
Comparing version 0.1.5 to 0.1.6
10
index.js
@@ -19,3 +19,4 @@ var _ = require('lodash'); | ||
if (!hits || !hits.length) return []; | ||
return _.map(hits, function(hit) { | ||
var res = []; | ||
_.each(hits, function(hit, idx) { | ||
debug('convert', hit); | ||
@@ -28,5 +29,8 @@ var doc = {}; | ||
doc.content_type = hit._type; | ||
doc.score = hit._score; | ||
return doc; | ||
// default score is the order results are returned | ||
// (score is missing e.g. when sorting) | ||
doc.score = hit._score || hits.length - idx; | ||
res.push(doc); | ||
}); | ||
return res; | ||
}; | ||
@@ -33,0 +37,0 @@ |
{ | ||
"name": "backbone-db-elasticsearch", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Elasticsearch driver for backbone-db", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29149
770