Skip to content

Commit

Permalink
add JestVersion annotation to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Cihat Keser committed May 22, 2016
1 parent 27f4305 commit bff65d1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions jest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,25 @@ numeric characters.
So the non-String type support for JestId annotation is purely for ease of use and should
not be used if you plan to use the automatic id generation functionality of Elasticsearch.

#### Version field support (aka Optimistic Concurrency Control)

`_version` field for documents are supported via the @JestVersion annotation. Marking a
property of your bean with @JestVersion will cause that field to be serialized and deserialized
as `_version` in the document JSON communicated to Elasticsearch. This in turn lets you
use the [Optimistic Concurrency Control](https://www.elastic.co/guide/en/elasticsearch/guide/current/optimistic-concurrency-control.html#optimistic-concurrency-control) capabilities provided by Elasticsearch.

```java
class Article {

@JestId
private String documentId;

@JestVersion
private Long documentVersion;

}
```

### Searching Documents

Search queries can be either JSON String or created by ElasticSearch SourceBuilder
Expand Down

0 comments on commit bff65d1

Please sign in to comment.