Comparing version 0.0.2 to 0.0.3
@@ -7,3 +7,2 @@ /** | ||
'nlogger').logger(module); | ||
; | ||
@@ -83,2 +82,11 @@ /** | ||
if (typeof options.timeout == 'number') { | ||
req.on('socket', function(socket) { | ||
socket.setTimeout(options.timeout); | ||
socket.on('timeout', function() { | ||
req.abort(); | ||
}); | ||
}); | ||
} | ||
if (typeof options.data == 'string') { | ||
@@ -89,3 +97,2 @@ req.write(options.data); | ||
} | ||
; | ||
@@ -92,0 +99,0 @@ this.select = function(options, callback) { |
@@ -8,2 +8,2 @@ /** | ||
module.exports.client = require("./client"); | ||
module.exports.queryBuilder = require('./queryBuilder'); | ||
module.exports.queryBuilder = require('./queryBuilder'); |
@@ -84,3 +84,4 @@ /** | ||
if (typeof options['facet.sort'] != 'string') options['facet.sort'] = 'count'; | ||
if (typeof options['facet.sort'] != 'string') | ||
options['facet.sort'] = 'count'; | ||
if (isNaN(parseInt(options['facet.limit']))) options['facet.limit'] = 10; | ||
@@ -87,0 +88,0 @@ |
@@ -14,12 +14,10 @@ /** | ||
return str.replace(/&/g, '&') | ||
.replace(/</g, '<') | ||
.replace(/>/g, '>') | ||
.replace(/"/g, '"'); | ||
return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, | ||
'>').replace(/"/g, '"'); | ||
}, | ||
}, | ||
unEscapeXML : function(str) { | ||
return str.replace(/"/g, '"').replace(/>/g, '>').replace(/</g, | ||
return str.replace(/"/g, '"').replace(/>/g, '>').replace(/</g, | ||
'<').replace(/&/g, '&'); | ||
@@ -29,5 +27,4 @@ | ||
}; | ||
module.exports = utils; |
{ | ||
"name": "helios", | ||
"version": "0.0.2", | ||
"description": "Nodejs client for SOLR", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node --expose_gc ./node_modules/nodeunit/bin/nodeunit test" | ||
"name" : "helios", | ||
"version" : "0.0.3", | ||
"description" : "SOLR client for Nodejs", | ||
"main" : "index.js", | ||
"scripts" : { | ||
"test" : "node --expose_gc ./node_modules/nodeunit/bin/nodeunit test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/rishabhmhjn/helios" | ||
"bugs" : { | ||
"url" : "https://github.com/rishabhmhjn/helios/issues", | ||
"email" : "rishabhmhjn@gmail.com" | ||
}, | ||
"keywords": [ | ||
"repository" : { | ||
"type" : "git", | ||
"url" : "https://github.com/rishabhmhjn/helios" | ||
}, | ||
"keywords" : [ | ||
"solr" | ||
], | ||
"author": "Rishabh Mahajan", | ||
"license": "BSD", | ||
"author" : "Rishabh Mahajan", | ||
"license" : "BSD", | ||
"dependencies" : { | ||
@@ -25,2 +29,2 @@ "underscore" : "*" | ||
} | ||
} | ||
} |
helios - a nodejs-solr client [![Build Status](https://travis-ci.org/rishabhmhjn/helios.png)](https://travis-ci.org/rishabhmhjn/helios) | ||
============================= | ||
Well, this is a little neater version of the already available nodejs-solr clients. | ||
I figured out that a lot of problems lies in creating queries and documents. | ||
I figured out that a lot of problems lies in creating queries and documents. | ||
The powerful thing of this library would be the `queryBuilder` & `document` class. | ||
@@ -9,4 +9,3 @@ | ||
------- | ||
Releases are available for download from | ||
[GitHub](https://github.com/rishabhmhjn/helios/). | ||
Releases are available for download from [GitHub](https://github.com/rishabhmhjn/helios/). | ||
Alternatively, you can install using Node Package Manager (npm) as [helios](https://npmjs.org/package/helios): | ||
@@ -25,3 +24,4 @@ | ||
port : 8989, | ||
path : '/solr' // Insert your client solr path | ||
path : '/solr', // Insert your client solr path | ||
timeout : 1000 // Optional request timeout | ||
}); | ||
@@ -86,3 +86,3 @@ | ||
### init | ||
It can be initialized by passing an `options` object or just by `helios.client()`. | ||
It can be initialized by `helios.client()` or by passing an `options` Object as an argument like `helios.client(options)`. | ||
```js | ||
@@ -98,5 +98,9 @@ try { | ||
} | ||
``` | ||
`options` can have host, port & path. | ||
You can also pass a `proxy : { host : "proxy_host", port : 55 }` in the `options`. | ||
``` | ||
`options` can have | ||
- `host` | ||
- `port` | ||
- `path` | ||
- `proxy : { host : "proxy_host", port : 55 }` | ||
- `timeout : 10000` in milliseconds | ||
@@ -106,5 +110,5 @@ ### methods | ||
#### solr_client.select | ||
It accepts two arguments: | ||
- query string OR query object OR an instance of `helios.queryBuilder` | ||
- callback (err, res) | ||
It accepts two arguments: | ||
- query string OR query object OR an instance of `helios.queryBuilder` | ||
- callback (err, res) | ||
@@ -124,6 +128,6 @@ ```js | ||
#### solr_client.addDoc | ||
It accepts 3 arguments: | ||
- `solrdoc` : an instance of [helios.document](#document) | ||
- `commit_flag` : `boolean` | ||
- `callback(err)` : a callback which is given an error message upon failure | ||
It accepts 3 arguments: | ||
- `solrdoc` : an instance of [helios.document](#document) | ||
- `commit_flag` : `boolean` | ||
- `callback(err)` : a callback which is given an error message upon failure | ||
@@ -160,6 +164,6 @@ ```js | ||
#### setMultiValue | ||
It accepts the following arguments: | ||
- `field_name` | ||
- `value` the value of the `field_name` | ||
- `boost` the boost to be set for `field_name` | ||
It accepts the following arguments: | ||
- `field_name` | ||
- `value` the value of the `field_name` | ||
- `boost` the boost to be set for `field_name` | ||
@@ -173,3 +177,3 @@ This method is helpful in adding values to a `multi=true` field | ||
> for the same `field_name` actually results in a compound | ||
> value which is the multiplication of the boosts added | ||
> value which is the multiplication of the boosts added | ||
> eg. for the above case: `2 * 1.5 = 3` | ||
@@ -219,5 +223,9 @@ | ||
====== | ||
I know there are a lot of pending tasks and modifications required in this library. | ||
If you find any bug or a feature that you want, | ||
please submit an [issue](https://github.com/rishabhmhjn/helios/issues). | ||
I know there are a lot of pending tasks and modifications required in this library. | ||
If you find any bug or a feature that you want, | ||
please submit an [issue](https://github.com/rishabhmhjn/helios/issues). | ||
I will respond to it as soon as I can and make required changes to it. | ||
If you like this module, please do star it :) | ||
npm star helios |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
32371
866
1
223