New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

adonis-elasticsearch

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adonis-elasticsearch

Elasticsearch Service Provider for Adonis with additional features

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

This service provider makes it easier to integrate and to work with the official Elasticsearch client library for Node.js

It is built on top of @elastic/elasticsearch and proxies all the methods keeping them 100% original. So you can follow official Elasticsearch API reference.

Installation

npm install adonis-elasticsearch

Set the environment variable

Make sure you set the ES_URL environment variable in your .env file. This will be used to access your Elasticsearch server.

ES_URL=http://localhost:9200

Registering the provider

Make sure to register the provider inside start/app.js file.

const providers = [
  // ...
  "adonis-elasticsearch/providers/ElasticProvider",
];

That's all! Now you can use the provider by pulling it from IoC container

const Elastic = use("Elastic");

const response = await Elastic.search({
  index: "my-index",
  body: {
    query: {
      match_all: {},
    },
  },
});

Paginate results the Adonis way!

The Elastic.paginate() helper will paginate the results and return the same payload as Lucid's pagination method.

const Elastic = use("Elastic");

const response = await Elastic.search({
  index: "my-index",
  body: {
    query: {
      match_all: {},
    },
  },
});

return Elastic.paginate(response);

Contributing

You are more than welcome to contribute to Vue Flags. Just submit changes via pull request and I will review them before merging.

  1. Fork it! 🤙

  2. Create your feature branch: git checkout -b my-new-feature

  3. Commit your changes: git commit -am "Add some feature"

  4. Push to the branch: git push origin my-new-feature

  5. Submit a pull request 👍

The documentation is available in the docs folder. The Vue Flags components are available in the lib folder.

License

The Adonis Elasticsearch Service Provider is MIT licensed.

Keywords

FAQs

Package last updated on 17 Jun 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc