Jest Start

来源:互联网 发布:使命召唤fa7.62l数据 编辑:程序博客网 时间:2024/04/29 23:25

Jest is a Java HTTP Rest client for Elasticsearch.It is actively developed and tested by Searchly.

A sample Java application using Jest can be found on GitHub https://github.com/searchly/searchly-java-sample.

Installation

Ensure you have added Sonatype repository to your pom.xml

With Maven add Jest dependency to your pom.xml

Install Jest via Maven

Configuration

Create a Jest Client (Change apiKey with your api key):

Indexing

Create an index via Jest with ease;

Create new document.

Index article to “articles” index with “article” type.

Searching

Search queries can be either JSON String or ElasticSearch SearchSourceBuilder object.

With Json string;

 

With SearchSourceBuilder; (Add ElasticSearch as dependency if you want to use SearchSourceBuilder).

Useful Resources

  • Check out documentation of Jest here.
0 0
原创粉丝点击