elasticsearch-js | Official Elasticsearch client library for Node.js | Runtime Evironment library
kandi X-RAY | elasticsearch-js Summary
kandi X-RAY | elasticsearch-js Summary
The official Node.js client for Elasticsearch.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Pulls an index with the given tag name
elasticsearch-js Key Features
elasticsearch-js Examples and Code Snippets
Community Discussions
Trending Discussions on elasticsearch-js
QUESTION
I am trying to create an elastic search index if it doesn't exist using OnModuleInit (NestJs). It works fine with my local machine but when I am trying to deploy to AWS ES Cluster, this part is giving such an error.
...ANSWER
Answered 2022-Jan-16 at 08:44This looks like your AWS Opensearch (same tech under the hood of Elasticsearch) instance is returning a 403. This might mean you need to set up IAM Roles and the correct access for your instance. Please See the AWS Docs
QUESTION
I am trying to connect a React app to an instance of Elasticsearch in AWS using the JavaScript client. I started the React app using "npm start-react-app app" and then I installed the client using "npm install @elastic/elasticsearch". In the official documentation, it says I can initialize the client by using:
...ANSWER
Answered 2021-Jun-30 at 09:03This library is intended to be used in a nodejs environment on the server. You can't use it in the browser as is.
From the repo readme:
BrowserWARNING: There is no official support for the browser environment. It exposes your Elasticsearch instance to everyone, which could lead to security issues. We recommend that you write a lightweight proxy that uses this client instead, you can see a proxy example here.
QUESTION
We have elastic hosted on GCP. I'm getting an error when I try to simply post a document. I'm using their node.js package, and I'm stuck with the following error:
...ANSWER
Answered 2020-Nov-10 at 08:02I think you have one too many create
in the command you return from onDocument
. The command you can return is described here:
So, by removing one create
layer, it should work:
QUESTION
I cannot connect to Elasticsearch docker server from my NodeJS application.
My codeThis is my docker-compose file:
...ANSWER
Answered 2020-Nov-01 at 09:14when you run the docker-compose file, the elasticsearch service instance will not be available to your backend service at localhost
. change http://localhost:9200
to http://elasticsearch:9200
in your node.js code.
docker compose automatically creates dns entries with same name as the service name for each service.
QUESTION
I recently inherited the job of maintaining our ElasticSearch indexes. So I'm still pretty new at this. I've got code in Node.js to create an index and I assume it overwrites an existing index with the same name if it already exists.
What I would like to do is insert one new record into the index leaving the existing data untouched. I've been researching how to do this here, but I'm still not clear on how to do it.
Here is code for creating an index that I'm using now, it appears that the original writer of my file got it from here:
...ANSWER
Answered 2020-Sep-16 at 03:35That code doesn't create an index, but it "indexes" a document.
If a document with the same id (i.e. group.id
) already exists in the index, then it's going to be reindexed (i.e. overridden), otherwise a new document is going to be created.
So I don't think anything wrong can happen here.
QUESTION
I have set up an elasticsearch/kibana docker configuration and I want to connect to elasticsearch from inside of a docker container using the @elastic/elasticsearch client for node. However, the connection is "timing out".
The project is taken with inspiration from Patrick Triest : https://blog.patricktriest.com/text-search-docker-elasticsearch/
However, I have made some modification in order to connect kibana, use a newer ES image and the new elasticsearch node client.
I am using the following docker-compose file:
...ANSWER
Answered 2020-Feb-11 at 00:16In Docker, localhost
(or the corresponding IPv4 address 127.0.0.1, or the corresponding IPv6 address ::1) generally means "this container"; you can't use that host name to access services running in another container.
In a Compose-based setup, the names of the services:
blocks (api
, elasticsearch
, kibana
) are usable as host names. The caveat is that all of the services have to be on the same Docker-internal network. Compose creates one for you and attaches containers to it by default. (In your example api
is on the default
network but the other two containers are on a separate elastic
network.) Networking in Compose in the Docker documentation has some more details.
So to make this work, you need to tell your client code to honor the environment variable you're setting that points at Elasticsearch
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install elasticsearch-js
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page