
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
elasticsearch-completion
Advanced tools
Low level query completion for Elasticsearch
This was built as part of an internal tool to autocomplete queries for Elasticsearch.
Install the module with: npm install elasticsearch-completion
// Create a completion class
var ElasticsearchCompletion = require('elasticsearch-completion');
var esCompletion = new ElasticsearchCompletion([
'name',
'location'
]);
// Supply some queries to complete against
esCompletion.match(''); // ['name:', 'location:', '_exists_:', '_missing_:']
esCompletion.match('na'); // ['name:']
esCompletion.match('name:'); // []
esCompletion.match('_exists_:'); // ['_exists_:name', '_exists_:location']
elasticsearch-completion
exposes ElasticsearchCompletion
via its module.exports
.
new ElasticsearchCompletion(fields)
Constructor for a new completion class
Array
- Names of fields to match against (e.g. name
, location
)
['foo', 'bar']
would supply matches agains the fields foo
and bar
esCompletion.match(query)
Find matching completions for an Elasticsearch query
String
- Query being used in ElasticsearchReturns:
Array
- Collection of matching completions for the query
na
might complete to ['name:']
and _ex
might complete to ['_exists_:']
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via npm run lint
and test via npm test
.
Copyright (c) 2015 Underdog.io
Licensed under the MIT license.
FAQs
Low level query completion for Elasticsearch
The npm package elasticsearch-completion receives a total of 1 weekly downloads. As such, elasticsearch-completion popularity was classified as not popular.
We found that elasticsearch-completion demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.