Skip to content
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.

Commit

Permalink
expose scroll method through module
Browse files Browse the repository at this point in the history
  • Loading branch information
chris72205 committed Mar 13, 2019
1 parent 8724638 commit 05f901a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/elasticsearch.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {
SearchResponse,
UpdateDocumentByQueryParams,
UpdateDocumentByQueryResponse,
UpdateDocumentParams
UpdateDocumentParams,
ScrollParams
} from 'elasticsearch';
import { bindNodeCallback, Observable } from 'rxjs';
import { ELASTICSEARCH_CLIENT } from './elasticsearch-client.provider';
Expand Down Expand Up @@ -61,6 +62,12 @@ export class ElasticsearchService {
) as any) as Observable<SearchResponse<T>>;
}

scroll<T = any>(params: ScrollParams): Observable<SearchResponse<T>> {
return (bindNodeCallback(this.bindClientContext(this.esClient.scroll))(
params
) as any) as Observable<SearchResponse<T>>;
}

count(params: CountParams): Observable<CountResponse> {
return (bindNodeCallback(this.bindClientContext(this.esClient.count))(
params
Expand Down

0 comments on commit 05f901a

Please sign in to comment.