Supported Client Libraries
Supported Operations
Operation | Methods Supported |
---|
Select | - findAllById
- findAll
- findById
- count
- existsById
- searchSimilar
- indexOps
- get
- multiGet
- search
|
Delete | - delete
- deleteAll
- deleteById
- deleteAllById
|
Insert | |
Update | |
Objects
Icon | Description |
---|
| Java Elasticsearch Cluster |
| Java Elasticsearch Index |
| Java Unknown Elasticsearch Cluster |
| Java Unknown Elasticsearch Index |
Links
Links are created for transaction and function point needs:
Link type | Source and destination of link | Methods supported |
---|
parentLink | Between Elasticsearch Cluster object and Elasticsearch Index object
|
|
|
useDeleteLink | - delete
- deleteAll
- deleteById
- deleteAllById
|
useInsertLink | |
useSelectLink | - findAllById
- findAll
- findById
- count
- existsById
- searchSimilar
- indexOps
- get
- multiGet
- search
|
useUpdateLink | |
What results can you expect?
Once the analysis/snapshot generation is completed, you can view the results in the normal manner (for example via CAST Enlighten). Some examples are shown below.
Cluster & Index Creation
Cluster and index creation
public class EsConfig {
@Autowired
private EsSinkProperties properties;
@Bean
public Client client() throws Exception {
Settings esSettings = Settings.builder()
.put("cluster.name", properties.getClusterName())
.build();
TransportClient client = new PreBuiltTransportClient(esSettings)
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(properties.getHost()), Integer.parseInt(properties.getPort())));
}
}
public class EsSinkProperties {
/**
* Elasticsearch cluster name.
*/
private String clusterName = "elasticsearch";
/**
* Elasticsearch host name.
*/
private String host = "localhost";
/**
* Elasticsearch native port.
*/
private String port = "9300";
@NotBlank
public String getClusterName() {
return clusterName;
}
public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
}
@Document(indexName = "trader", type = "trade")
public class Trade {
@Id
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}

Insert Operation
Insert Operation
public Book save(Book book) {
return bookRepository.save(book);
}

Delete Operation
Delete Operation
public void delete(Book book) {
bookRepository.delete(book);
}

Select Operation
Select Operation
public Iterable<Book> findAll() {
return bookRepository.findAll();
}

Query Methods
Query Methods
public interface BookRepository extends ElasticsearchRepository<Book, String> {
Page<Book> findByAuthor(String author, Pageable pageable);
List<Book> findByTitle(String title);
}
public Page<Book> findByAuthor(String author, PageRequest pageRequest) {
return bookRepository.findByAuthor(author, pageRequest);
}

Elasticsearch Operations / Elasticsearch Template
Elasticsearch Operations
public void deleteIndex() {
operations.indexOps(Conference.class).delete();
}

Evolution
- Better resolution for cluster and index names
- Support for ReactiveElasticsearchRepository
- Query Methods are supported for Spring Data
- Query methods with @Query annotation for Spring Data are supported
- Elasticsearch operations and Elasticsearch template support for more APIs
Limitations
- Cluster is created as unknown, if the name is not retrieved from the properties file or if the name could not be resolved.
- Limited support for Spring Data Elasticsearch 3.x
- In 3.x, CRUD operations performed using ElasticsearchRepository are supported
- In 3.x no support for CRUD operations performed using ElasticsearchTemplate. However, if the user configures version 3.x jars inside its class path, then ElasticsearchTemplate will produce links.