> For the complete documentation index, see [llms.txt](https://moluo.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://moluo.gitbook.io/notes/bian-cheng-xue-xi/shu-ju-ku/elasticsearch/ji-cheng.md).

# 集成

```java
public TransportClient client(){
    InetSocketTransportAddress node =new InetSocketTransportAddress(
    InetAddress.getByName("localhost"),9300);
    Setting settrings=Settings.builder().put("cluster.name","wali").build();
    TransportClient client=new PreBuiltTransportClient(Settings,EMPTY);
    client.addTransportAddress(node);
    return client;
}
```

获取

```java
GetResponnse result=this.client.preprareGet("book","novel",id).setSource().get();
```

增加

```java
XcontentFactory.jsonBuilder()
.startObject()
.field("title",title)
.field("author",author)
.field("word_count",wordCount)
.field("publist_data",publishData.getTime())
.endObject();
result=this.client.preprareGet("book","novel",id).setSource().get();
```

删除

```java
this.client.prepareDelete("book",)
```

更新接口
