Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/okdistribute/node-federated-search
federated search for node.js
https://github.com/okdistribute/node-federated-search
Last synced: about 2 months ago
JSON representation
federated search for node.js
- Host: GitHub
- URL: https://github.com/okdistribute/node-federated-search
- Owner: okdistribute
- License: bsd-2-clause
- Created: 2015-09-22T06:45:45.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-29T08:48:18.000Z (about 9 years ago)
- Last Synced: 2024-10-12T20:44:40.324Z (2 months ago)
- Language: JavaScript
- Size: 122 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - okdistribute/node-federated-search - federated search for node.js (others)
README
# node-federated-search
Federated search for Node.js. This tool assumes you have assembled node modules that implement the [abstract-search](http://github.com/karissa/abstract-search) api.
```
npm install federated-search
```## Example
```js
var fedsearch = require('federated-search')var query = {
field1: 'hello',
field2: 'world'
}var searchers = [
require('ckan-searcher')('www.datahub.io'),
require('github-searcher')('www.github.com'),
require('figshare-searcher')('www.figshare.com')
]
```Use the streaming API.
```js
var stream = fedsearch(query, searchers)
stream.on('data', function (result) {
console.log(result)
})
stream.destroy() // will stop fetching data.
```Prints (one for each calback)
```json
{
"searcher": {"name": "ckan", "url": "www.datahub.io", "version": "latest"},
"data": data...
}
```