Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

feathers-solr-node

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feathers-solr-node - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

8

lib/index.js
const queryParser = require('./utils/queryParser');
const solrClient = require('./solr-client/solr');
const errors = require('feathers-errors');
const errors = require('@feathersjs/errors');
const _ = require('./utils/util');

@@ -52,2 +52,5 @@

let query = this.queryParser.parseQuery(params.query);
if(query instanceof errors.BadRequest){
return Promise.reject(query);
}
//console.log("this.queryParser", query);

@@ -67,2 +70,5 @@ return new Promise((resolve, reject) => {

let query = this.queryParser.parseQuery(params.query);
if(query instanceof errors.BadRequest){
return Promise.reject(query);
}
return new Promise((resolve, reject) => {

@@ -69,0 +75,0 @@ this.solrClient.$search(query, (err, res) => {

16

lib/utils/queryParser.js
const _ = require('./util');
const errors = require('@feathersjs/errors');
class QueryParser {

@@ -41,3 +42,3 @@ constructor(options) {

queryObj.filter = [];
Object.keys(query).forEach((item) => {
Object.keys(query).every((item) => {
if (this.mapKey[item]) {

@@ -48,3 +49,9 @@ let value = this[item](item, query[item]);

let $filter = this.filterBuilder(item, query[item]);
queryObj.filter.push(...$filter);
if($filter) {
queryObj.filter.push(...$filter);
}
else {
queryObj = new errors.BadRequest(`undefined field ${item}`);
return false;
}
}

@@ -60,5 +67,6 @@ });

}
if (item[0] !== '$') {
return this.filter(item, param);
if (item[0] === '$') {
return false;
}
return this.filter(item, param);
}

@@ -65,0 +73,0 @@

@@ -10,3 +10,3 @@ {

"description": "Solr Adapter for Feathersjs. Base on Solr-client, so can also used as a Solr-client",
"version": "0.2.1",
"version": "0.2.2",
"repository": {

@@ -26,6 +26,6 @@ "type": "git",

"dependencies": {
"@feathersjs/errors": "^3.3.4",
"JSONStream": "^1.3.4",
"bluebird": "^3.5.2",
"duplexer": "^0.1.1",
"feathers-errors": "^2.9.2",
"httperror": "^0.2.3",

@@ -32,0 +32,0 @@ "json-bigint": "^0.3.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc