Elasticsearch js client for Angular2+


I'm trying to figure out how to connect Elastic 5.x with Angular 4. The thing that has me all confused is that I know with AngularJS and Elasticsearch 1.x and 2.x, the AngularJS client used promises to communicate with ES. Now Angular uses Observables and I don't quite know how to make that work with Angular client for ES 5.x??

I got this code from github support thread of Elastic repo

public test_search(): Observable<SearchResponse<{}>> {
    return Observable.fromPromise(<Promise<SearchResponse<{}>>> this.clientElasticsearch.search( {
      index: '3entreprises',
      q: `Customer:0`

The first two lines have me confused and I'm not quite sure what they actually do?

(system) #2

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