Connecting and fetching elasticsearch from react Js

Hello,

Would it be possible or is there any library available in javascript to connect and fetch data from elasticsearch index by providing json as input which elasticserver understand.

regards,

Have you looked at the official client?

yes, it says the following in "introduction".

This is the official Node.js client for Elasticsearch. This page gives a quick overview about the features of the client.

I need to use J2EE server and would like to write javascript in clientside and not in "Node.js" side..

Welcome!

I'd not recommend connecting Elasticsearch from the frontend TBH. That would require to have the frontend aware of the credentials...

Why not doing the backend connection from the backend (your JEE app) and then send to the frontend only what is needed or the full response as a JSON...

See for example:

1 Like

Thanks. Agree that, it is not safe to connect from frontend. But still would like to know if there is any library exists to connect from frontend( Javascript).

May I know the Java library location from where to download, that need to be used in serverside rest API.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.