GET data from ES in React

If I have elasticsearch installed and running on my computer, then I can perform a GET request in my ReactJS app through the code below

const query = {
    "query": {
        "match_all": {}
      }
}


axios.get('http://localhost:9200/my-index/my-type/_search', {
  params: {
    source: JSON.stringify(query),
    source_content_type: 'application/json'
  }
}).then((res) => {
  console.log(res);
});

But, what API endpoint to call if I want to access data from an ES server?

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