spring-data-elasticsearch

@Setting annotation for Elasticsearch is ignored in Spring Boot

走远了吗. 提交于 2019-12-01 19:53:19
问题 In my Spring Boot application I have a @Setting annotation pointing to a settings JSON file but it seems to be completely ignored. @Setting(settingPath = "/settings/elasticsearch-settings.json") @Document(indexName = "hermes", type = "client", shards = 1, replicas = 0, refreshInterval = "-1") public class Client { @Id private String externalId; private String name; private String surname; private String taxNumber; private String uid; //getters and setter intentionally left out } My settings

@Setting annotation for Elasticsearch is ignored in Spring Boot

这一生的挚爱 提交于 2019-12-01 18:17:48
In my Spring Boot application I have a @Setting annotation pointing to a settings JSON file but it seems to be completely ignored. @Setting(settingPath = "/settings/elasticsearch-settings.json") @Document(indexName = "hermes", type = "client", shards = 1, replicas = 0, refreshInterval = "-1") public class Client { @Id private String externalId; private String name; private String surname; private String taxNumber; private String uid; //getters and setter intentionally left out } My settings file is placed in: src/main/resources/settings/elasticsearch-settings.json The content of the file is

What Elasticsearch client does Spring-Data-Elasticsearch use under the hood?

霸气de小男生 提交于 2019-12-01 10:59:27
I want to use Spring Data Elasticsearch in my project and I saw this: The well known TransportClient is deprecated as of Elasticsearch 7.0.0 and is expected to be removed in Elasticsearch 8.0. My approach is to only use Spring Data Elasticsearch to do CRUD operations (ORM-like), and High Level REST Client for searching and all the rest. So I want to know which client is the ElasticsearchRepository using to perform its operations, and if the code will no longer be valid in version 8.0 of Elasticsearch. Is it still a good decision to use version 3.1.5? P.J.Meisch As always, it depends. About

What Elasticsearch client does Spring-Data-Elasticsearch use under the hood?

有些话、适合烂在心里 提交于 2019-12-01 05:12:02
问题 I want to use Spring Data Elasticsearch in my project and I saw this: The well known TransportClient is deprecated as of Elasticsearch 7.0.0 and is expected to be removed in Elasticsearch 8.0. My approach is to only use Spring Data Elasticsearch to do CRUD operations (ORM-like), and High Level REST Client for searching and all the rest. So I want to know which client is the ElasticsearchRepository using to perform its operations, and if the code will no longer be valid in version 8.0 of

How to enable query logging in Spring-data-elasticsearch

耗尽温柔 提交于 2019-12-01 03:04:40
I use spring-data-elasticsearch framework to get query result from elasticsearch server, the java code like this: SearchQuery searchQuery = new NativeSearchQueryBuilder() .withQuery(matchAllQuery()).withSearchType(SearchType.COUNT) .addAggregation(new MinBuilder("min_createDate").field("createDate")) .build(); List<Entity> list = template.queryForList(searchQuery, Entity.class); While how can I know the raw http query sent to elasticssearch server? How can I enable the logging, I tried add log4j, but it seems the spring-data-elasticsearch doesn't log the query. I don't have an answer for

Does Spring Data Elasticsearch support Amazon Elasticsearch?

你。 提交于 2019-11-30 23:40:43
问题 From the research I have done it seems that the two do not work together because of HTTP only support for Amazon Elasticsearch. Hoping someone can clarify if in fact it is not something that is possible with Spring Data Elasticsearch. 回答1: From different discussions: - Spring data ES and searchly - port for the transport protocol and the AWS documentation on ES service limitations; go to the bottom, the last line says: The service supports HTTP on port 80, but does not support TCP transport.

How to enable query logging in Spring-data-elasticsearch

让人想犯罪 __ 提交于 2019-11-30 22:59:06
问题 I use spring-data-elasticsearch framework to get query result from elasticsearch server, the java code like this: SearchQuery searchQuery = new NativeSearchQueryBuilder() .withQuery(matchAllQuery()).withSearchType(SearchType.COUNT) .addAggregation(new MinBuilder("min_createDate").field("createDate")) .build(); List<Entity> list = template.queryForList(searchQuery, Entity.class); While how can I know the raw http query sent to elasticssearch server? How can I enable the logging, I tried add

Spring data ElastiSearch aggregations with filters

大憨熊 提交于 2019-11-30 16:30:29
I am trying to perform aggregations on values filtered by some conditions. I am using ElasticSearchTemplate.query() method of spring data too execute query and get the results in result extractor. I am getting the hits correctly (i.e. filters are applied and docs matching those values are only retrieved.). However, aggregations are performed on all the docs. I believe aggregations should be applied to filtered values only. Following is the code I am using: SearchQuery query = //get the query SearchResponse hits = template.query(query, new ResultsExtractor<SearchResponse>() { @Override public

Elasticsearch Rest Client with Spring Data Elasticsearch

廉价感情. 提交于 2019-11-30 11:50:11
I am in a situation where I am using Spring boot and AWS elasticsearch service. AWS Elasticsearch service which only provides REST interface. Elasticsearch Rest Client is here . Simply, Is it possible to use REST client with Spring Data Elasticsearch? In other words, Does Spring Data Elasticsearch works with Elasticsearch Rest client? Spring Data Elasticsearch is very easy to use and template provides very most functionality that I need. With Elasicsearch Rest client I have to implement all the functionality myself. [2019 February Update] A see now that 3.2.0 M1 Spring Data Elasticsearch

How to provide highlighting with Spring data elasticsearch

懵懂的女人 提交于 2019-11-30 05:52:09
it seems that SpringData ES don't provide classes to fetch highlights returned by ES. Spring Data can return Lists of Objects but the highlights sections in the Json returned by ES is in a separated part that is not handled by the "ElasticSearchTemplate" class. Code example :- QueryBuilder query = QueryBuilders.matchQuery("name","tom"); SearchQuery searchQuery =new NativeSearchQueryBuilder().withQuery(query). with HighlightFields(new Field("name")).build(); List<ESDocument> publications = elasticsearchTemplate.queryForList (searchQuery, ESDocument.class); I must be wrong, but I can't figure