Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
seneca-elasticsearch
Advanced tools
elastic search plugin to seneca
This plugin will automatically index any entities that are being saved. Only entities will have their fields filtered by options.fields, the rest of the api assumes you know what you are doing.
var seneca = require('seneca')({
strict: { // needed for seneca 0.6.4+
add: false
}
});
// important to use a store definition BEFORE including this module
// to automatically index entities
seneca.use('mem-store',{ map:{ '-/-/foo':'*' }});
seneca.use('seneca-elasticsearch', {
fetchEntitiesFromDB: true, // only enable if you depend on this for permissions.
refreshOnSave: true, // never enable this if your code needs to run in production.
entities: [{
name: 'foo',
indexedAttributes: { // define mapping to be imported
someField: {
type: 'string',
index: 'not_analyzed'
}
}
}],
connection: { index : indexName }, // customize index name
pingTimeout: 1000
});
seneca.ready(function(err) {
if (err) { return console.log(err); }
// your code here.
// It will have created the index for you automatically.
});
// check for index
seneca.act({role: 'search', cmd: 'create-index', index: 'myIndex'}, callback);
// create an index (checks first)
seneca.act({role: 'search', cmd: 'create-index', index: 'myIndex'}, callback);
// delete an index (checks first)
seneca.act({role: 'search', cmd: 'delete-index', index: 'myIndex'}, callback);
// index or update a record
seneca.act({
role: 'search',
cmd: 'save',
index: 'myIndex',
type: 'myType',
id: 'myId', // requires either this id
data: {
_id: 'myId', // or this id
/* rest of object here */
}
}, callback);
// remove a record
seneca.act({
role: 'search',
cmd: 'remove',
index: 'myIndex',
type: 'myType',
id: 'myId'
}, callback);
// load a record
seneca.act({
role: 'search',
cmd: 'load',
index: 'myIndex',
type: 'myType',
id: 'myId'
}, callback);
// return all records
seneca.act({
role: 'search',
cmd: 'search',
index: 'myIndex',
type: 'myType'
}, callback);
// match lucene query string
seneca.act({
role: 'search',
cmd: 'search',
index: 'myIndex',
type: 'myType',
search: "query string here",
}, callback);
// match elasticsearch JSON query
// TODO:
// See tests/search.js for more about this.
// This is most likely what you will want
// to be using.
FAQs
elasticsearch plugin for seneca
The npm package seneca-elasticsearch receives a total of 5 weekly downloads. As such, seneca-elasticsearch popularity was classified as not popular.
We found that seneca-elasticsearch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.