wistroni40-elasticsearch
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

wistroni40-elasticsearch

Install

npm i wistroni40-elasticsearch --save

Table of Contents

Quickstart

index.ts

const client = new ElasticClient({ node: 'http://localhost:9200/' });

client
  .scrollSearch({
    index: 'your_index_*',
    type: 'your_type',
    scroll: '1m',
    body: YOUR_QUERY_BODY,
  })
  .subscribe((result: any) => console.log(result));

Full Example

Feature

  • 提供scrollSearch滾動查詢,直接將尚未查詢的結果透過滾動方式一次獲取

API

ElasticClient

Class,ElasticSearch客戶端

Constructor

建構值

Parameter Type Required Default Description
opts ClientOptions Optional undefined 客戶端配置,可參考@elastic/elasticsearch

Methods

scrollSearch

滾動查詢

Parameter Type Required Default Description
params Search<object> Required undefined 查詢參數,可參考@elastic/elasticsearch
options TransportRequestOptions Optional undefined 查詢配置,可參考@elastic/elasticsearch
returns Observable<T[]> Required undefined 回傳查詢結果

Package Sidebar

Install

npm i wistroni40-elasticsearch

Weekly Downloads

5

Version

1.0.1

License

ISC

Unpacked Size

20.6 kB

Total Files

26

Last publish

Collaborators

  • steveylin