feathers-solr
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -185,2 +185,3 @@ const feathers = require('feathers'); | ||
}) | ||
console.log('importData',importData.length); | ||
// console.log('attributes',attributes); | ||
@@ -187,0 +188,0 @@ // console.log(importData); |
@@ -12,3 +12,3 @@ { | ||
"navType": "inline", | ||
"theme": "cyborg", | ||
"theme": "flatly", | ||
"linenums": true, | ||
@@ -15,0 +15,0 @@ "collapseSymbols": true, |
@@ -45,3 +45,4 @@ 'use strict'; | ||
schema: false, | ||
migrate: 'drop', | ||
migrate: 'safe', | ||
adminKey: false, | ||
managedScheme: true, | ||
@@ -121,3 +122,3 @@ /*commitStrategy softCommit: true, commit: true, commitWithin: 50*/ | ||
if (_self.options.migrate === 'safe' || _self.options.managedScheme === false || _utils._.isObject(_self.options.schema) === false) { | ||
if (!_self.options.migrate === 'safe' || _self.options.managedScheme === false || _utils._.isObject(_self.options.schema) === false) { | ||
return true; | ||
@@ -336,3 +337,2 @@ } | ||
* field update http://yonik.com/solr/atomic-updates/ | ||
* because | ||
* @param {[type]} id [description] | ||
@@ -349,4 +349,8 @@ * @param {[type]} data [description] | ||
var _self = this; | ||
var query = params.query; | ||
var query = {}; | ||
if (_utils._.has(params, 'query')) { | ||
query = params.query; | ||
} | ||
if (id !== null) { | ||
@@ -353,0 +357,0 @@ query = { id: id, $limit: 1 }; |
@@ -44,8 +44,9 @@ 'use strict'; | ||
filter: function filter(field, param) { | ||
if (typeof param === 'string') { | ||
this.query.filter.push(field + ':' + param); | ||
if (_.isObject(param)) { | ||
Object.keys(param).forEach(function (f) { | ||
if (f[0] === '$' && typeof Query[f] !== 'undefined') { | ||
Query[f](field, param[f]); | ||
} | ||
}); | ||
} else if (Array.isArray(param)) { | ||
if (Array.isArray(param)) { | ||
@@ -56,8 +57,3 @@ param = '(' + param.join(' OR ') + ')'; | ||
} else { | ||
Object.keys(param).forEach(function (f) { | ||
if (f[0] === '$' && typeof Query[f] !== 'undefined') { | ||
Query[f](field, param[f]); | ||
} | ||
}); | ||
this.query.filter.push(field + ':' + param); | ||
} | ||
@@ -79,3 +75,3 @@ }, | ||
Object.keys(param).forEach(function (name) { | ||
order.push(name + (param[name] === '1' ? ' asc' : ' desc')); | ||
order.push(name + (parseInt(param[name]) === 1 ? ' asc' : ' desc')); | ||
}); | ||
@@ -110,6 +106,4 @@ | ||
$or: function $or(field, param) { | ||
var filter = this.query.filter; | ||
this.query.filter = []; | ||
Object.keys(param).forEach(function (item, index) { | ||
@@ -124,3 +118,3 @@ | ||
filter.push('("' + this.query.filter.join('" OR "') + '")'); | ||
filter.push('(' + this.query.filter.join(' OR ') + ')'); | ||
this.query.filter = filter; | ||
@@ -161,16 +155,17 @@ }, | ||
function queryDelete(id, params) { | ||
if (id !== null) { | ||
// if (Array.isArray(id)) { | ||
// id = id; | ||
// } | ||
return { delete: { id: id } }; | ||
} else if (_.isObject(params)) { | ||
var crit = []; | ||
Object.keys(params).forEach(function (name) { | ||
crit.push(name + ':' + params[name]); | ||
}); | ||
return { delete: { query: crit.join(',') } }; | ||
} | ||
// if (params) { | ||
// //TODO' implement array | ||
// let pairs = _.pairs(params.query); | ||
// return { delete: { query: (pairs[0] || '*') + ':' + (pairs[1] || '*') } }; | ||
// } | ||
return { delete: { query: '*' } }; | ||
} |
@@ -28,5 +28,4 @@ 'use strict'; | ||
//TODO: ?? | ||
response = { | ||
QTime: _.get(res, 'response.QTime') || 0, //"<total number of records>", | ||
QTime: _.get(res, 'responseHeader.QTime') || 0, //"<total number of records>", | ||
total: _.get(res, 'response.numFound') || 0, //"<total number of records>", | ||
@@ -33,0 +32,0 @@ limit: parseInt(_.get(params, 'query.$limit')) || _.get(opt, 'paginate.default') || _.get(opt, 'paginate.max'), |
{ | ||
"name": "feathers-solr", | ||
"description": "Solr Adapter for Feathersjs", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"homepage": "https://github.com/sajov/feathers-solr", | ||
@@ -38,3 +38,3 @@ "main": "lib/", | ||
"mocha": "mocha --recursive test/ --compilers js:babel-core/register", | ||
"test": "npm run compile && npm run jshint && npm run mocha", | ||
"test0": "npm run compile && npm run jshint && npm run mocha", | ||
"test1": "npm run compile && npm run jshint && mocha --recursive test/adapter.test.js --compilers js:babel-core/register", | ||
@@ -44,2 +44,3 @@ "test2": "npm run compile && npm run jshint && mocha --recursive test/adapter.test.js --compilers js:babel-core/register", | ||
"test4": "npm run compile && npm run jshint && mocha --recursive test/client/schemaApi.test.js --compilers js:babel-core/register", | ||
"test5": "npm run compile && npm run jshint && mocha --recursive test/query.test.js --compilers js:babel-core/register", | ||
"start": "npm run compile && node example/app", | ||
@@ -46,0 +47,0 @@ "test-cov": "node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha -- --compilers js:babel-core/register --colors test/*", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
204947507
1968
271605
3
4