Search code examples
elasticsearchoracle-jet

How to connect to Elasticsearch in OJet project?


I have created an index using Elasticsearch. Now I want to communicate to elasticsearch from Ojet project and get the data from the index in JSON format.

How can I achieve this? I did not find any examples about this topic, could you please help with it?

Thanks in advance!


Solution

  • I have never used Elastic search in general but when using Oracle JET the ideal way to communicate with with a backend server is via a REST API.

    Elastic search seems to offer an REST API, please checkout there documentation here: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs.html

    You can use the Oracle JET common model + collection API (docs) or use jQuery to do AJAX calls and handle the logic yourself.