![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
simple-elasticsearch
Advanced tools
Provides lightweight wrapper around Elasticsearch API.
npm install simple-elasticsearch
Provides wrappers around commonly-used Elasticsearch API endpoints, as well as a generic request()
method that can
be used to execute arbitrary API calls.
See tests for more usage examples.
var client = require('simple-elasticsearch').client.create();
var options = {
host: 'localhost', // default
port: 9200, // default
protocol: 'http', // default
index: 'my_index', // optional - if set, then the core methods don't require an index
to be set in each function call.
auth: { // optional HTTP Basic Auth params.
username: 'username',
password: 'password'
},
logging: { // optional logging
logger: your_logger, // required -- there is no default logger.
level: 'debug', // default
events: ['request', 'response'] // Default events to log.
// 'request': Log the HTTP requests.
// 'response': Log the HTTP responses.
formatters: {request: 'curl'} // Default 'plain'. Available options are 'plain' and 'curl' for now.
// 'curl' formatter logs requests in
// cURL format, which is handy for debugging and
// sharing requests with others.
// TODO: add ability to provide a custom formatter.
}
};
var client = require('simple-elasticsearch').client.create(options);
client.core.index({index: 'my_index', type: 'my_type'}, function(err, result) {});
client.core.index({index: 'my_index', type: 'my_type', id: 'my_id'}, function(err, result) {});
var search = {query: {term: {name: 'foo'}}};
client.core.search({search: search}, function(err, result) {});
client.core.search({index: 'my_index', search: search}, function(err, result) {});
client.core.search({index: 'my_index', type: 'my_type', search: search}, function(err, result, raw) {
// raw is the raw JSON string from Elasticsearch
// result is an object with this structure:
// {
// ids: [/* array of matching doc ids */],
// objects: [/* array of _source doc objects */],
// total: <number of search hits>,
// max_score: <max search score>
// }
});
client.core.get({index: 'my_index', type: 'my_type', id: id}, function(err, doc) {
console.log(doc);
});
client.core.del({index: 'my_index', type: 'my_type', id: id}, function(err, result) {});
var search = {query: {term: {name: 'foo'}}};
client.core.scanSearch({search: search}, function(err, result) {});
client.core.scanSearch({index: 'my_index'}, function(err, result) {});
client.core.scanSearch({index: 'my_index', type: 'my_type'}, function(err, result, raw) {
// raw is the raw JSON string from Elasticsearch
// result is the scroll_id
});
client.core.scrollSearch({scroll_id: 'a_scroll_id_returned_from_scan_search'}, function(err, result, raw) {
// raw is the raw JSON string from Elasticsearch
// result is an object with this structure:
// {
// ids: [/* array of matching doc ids */],
// objects: [/* array of _source doc objects */],
// total: <number of search hits>,
// max_score: <max search score>
// }
});
var options = {number_of_shards: 1};
client.indices.create({index: 'my_index', options: options}, function(err, result) {});
client.indices.del({index: 'my_index'}, function(err, result) {});
client.indices.refresh(function(err, result) {});
client.indices.refresh({index: 'my_index'}, function(err, result) {});
client.indices.refresh({indices: ['my_index1', 'my_index2']}, function(err, result) {});
client.indices.status(function(err, result) {});
client.indices.status({index: 'my_index'}, function(err, result) {});
client.indices.status({indices: ['my_index1', 'my_index2']}, function(err, result) {});
TBD, but you can use the client.request()
method directly in the meantime.
To run tests, first run:
npm install
Run the tests and JShint:
make
If you would like to contribute to the project, please fork it and send us a pull request. Please add tests
for any new features or bug fixes. Also run make
before submitting the pull request.
node-simple-elasticsearch licensed under the MIT license. See LICENSE file.
FAQs
Minimalistic Elasticsearch client
The npm package simple-elasticsearch receives a total of 27 weekly downloads. As such, simple-elasticsearch popularity was classified as not popular.
We found that simple-elasticsearch 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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.