Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/panthershark/elastic_filter
Elastic Search plugin for generating filtered queries.
https://github.com/panthershark/elastic_filter
Last synced: about 2 months ago
JSON representation
Elastic Search plugin for generating filtered queries.
- Host: GitHub
- URL: https://github.com/panthershark/elastic_filter
- Owner: panthershark
- License: mit
- Created: 2014-12-18T22:21:58.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-06T19:56:06.000Z (over 9 years ago)
- Last Synced: 2024-04-15T14:27:03.904Z (9 months ago)
- Language: JavaScript
- Size: 146 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
elastic_filter
==============Elastic Search plugin for generating filtered queries.
Standalone
```
var ElasticFilter = require('elastic_filter');
var elastic = new ElasticFilter({
"host": "localhost:9200",
"log": "error"/** see elasticsearch.js docs for more options **/
});var searchOptions = {
fields: [],
type: 'person',
index: 'person',
pagenum: 1,
pagesize: 20,
sort: ["age"],
result_fields: ["id", "first_name", "last_name", "created_date", "other_property"],
filters: {
first_name: "Bill"
/** supports multiple filters **/
}
};elastic.search('optional free form term', searchOptions, function(err, data) {
console.log(err, data);
});
```With Mixdown App
```
var App = require('mixdown-app').App;
var ElasticFilter = require('elastic_filter');var app = new App();
app.use(new ElasticFilter({
"host": "localhost:9200",
"log": "error"/** see elasticsearch.js docs for more options **/
}), 'elastic');var searchOptions = {
fields: [],
type: 'person',
index: 'person',
pagenum: 1,
pagesize: 20,
sort: ["age"],
result_fields: ["id", "first_name", "last_name", "created_date", "other_property"],
filters: {
first_name: "Bill"
/** supports multiple filters **/
}
};app.elastic.search('optional free form term', searchOptions, function(err, data) {
console.log(err, data);
});
```