Questions tagged [spring-data-elasticsearch]

Spring Data makes it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services as well as provide improved support for relational database technologies.

Spring Data makes it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services as well as provide improved support for relational database technologies.

1454 questions
6
votes
3 answers

How to configure the socket timeout of the Rest high level client in Spring Data Elasticsearch 2.2.3.RELEASE

I use Spring Boot Starter Data Elasticsearch 2.2.3.RELEASE with Elasticsearch v6.8.6. I configured the RestHighLevelClient for the connection to the cluster. Now I constantly get a SocketTimeoutException on different…
6
votes
1 answer

Spring-Boot Elasticseach EntityMapper can not be autowired

Based on this answer and the comments I implemented the code to receive the scores of an elastic search query. public class CustomizedHotelRepositoryImpl implements CustomizedHotelRepository { private final ElasticsearchTemplate…
Patrick
  • 12,336
  • 15
  • 73
  • 115
6
votes
0 answers

@Field(type=FieldType.keyword) being ignored on certain properties

I'm having trouble with the way SD Elasticsearch is creating some of my indices on application startup. I've got some String fields that I want to be of type "keyword" but they are always being created as type "text". This is using Elasticsearch…
Thomas Feiler
  • 295
  • 4
  • 11
6
votes
4 answers

Spring Data api (Containing or startwith) not working with SPACE which has wildcard

I am using Elastic Search with Spring Data . I have a simple method in repository: findByUserNameContaining("a b"); This method not giving expecting result because of SPACE. Error getting: "Cannot constructQuery '"a b"'. Use expression or multiple…
Vijay
  • 4,694
  • 1
  • 30
  • 38
6
votes
1 answer

spring data JPA & spring data elasticsearch; No property index found for type?

I'm unsure why this is happening! I've got a class that is used by spring data elasticsearch and spring data jpa, but when I try run my application I get an error. Error creating bean with name 'articleSearch': Invocation of init method failed;…
James111
  • 15,378
  • 15
  • 78
  • 121
6
votes
1 answer

Spring Data Elasticsearch: Can't merge because of conflicts: [Cannot update enabled setting for [_source]]

I'm trying to disable the _source field with Spring Data Elasticsearch, in order to add this property: "_source": { "enabled": false } I'm doing the following in a @Configuration class: @Bean public ElasticsearchTemplate…
6
votes
3 answers

Elasticsearch SearchContextMissingException during 'scan & scroll' query with Spring Data Elasticsearch

I am using elasticsearch 2.2.0 with default cluster configuration. I encounter a problem with scan and scroll query using spring data elasticsearch. When I execute the query I get error like this: [2016-06-29 12:45:52,046][DEBUG][action.search.type …
esnosek
  • 113
  • 1
  • 1
  • 4
6
votes
6 answers

How to set result size zero in spring data elasticsearch

Consider the following elasticsearch query : { "query": {"match_all": {}}, "size": 0, "aggs": { "Terms": { "terms": { "field":"fileName" } } } } Here I'm just interested in the aggregation and not in the documents. That's why…
blackSmith
  • 3,054
  • 1
  • 20
  • 37
6
votes
2 answers

Dynamic Index with SpringData ElasticSearch

How can I parameterize a SpringData ElasticSearch index at runtime? For example, the data model: @Document(indexName = "myIndex") public class Asset { @Id public String id; // ... } and the repository: public interface…
Daniel
  • 2,087
  • 3
  • 23
  • 37
6
votes
2 answers

How to set _id field for Elastic Search using Spring Data

I have defined a field in my entity using @Id annotation. But this @Id is not mapping to the _id in Elastic Search Documents. The _id values are auto generated by Elastic Search. I am using "org.springframework.data.annotation.Id;". Is this @Id…
Bharath
  • 543
  • 1
  • 6
  • 11
6
votes
2 answers

Spring-Data-Elasticsearch settings: Spring can't find config file?

With Spring-Data-Elasticsearch, I am trying to use analyzers and mappings defined in elasticsearch_config.json. This JSON file is in /src/main/resources folder. My JAVA model looks like: @Document(indexName = "test",…
6
votes
7 answers

Spring data elastic search - Query - Full text search

I am trying to use elastic search for full text search and Spring data for integrating elastic search with my application. For example, There are 6 fields to be indexed. 1)firstName 2)lastName 3)title 4)location 5)industry 6)email…
user1578872
  • 7,808
  • 29
  • 108
  • 206
6
votes
3 answers

Elasticsearch Aggregation by Day of Week and Hour of Day

I have documents of type: [{"msg":"hello", date: "some-date"},{"msg":"hi!", date: "some-date"}, ... I want to have the count of documents by day of week. For example x messages were sent on Monday and y were sent on Tuesday and so on. I have used…
6
votes
1 answer

Spring-data-elasticsearch meta-data annotations for _version, _id etc

Using the @Id annotation I can add an id field to my model object and when I execute a query the resulting model object will contain the value of the elasticsearch _id in the @Id annotated field. However, I have yet to figure out how to get other…
Matt Friedman
  • 1,535
  • 1
  • 17
  • 24
6
votes
3 answers

findAllByX incorrectly limited to 10 results

In Spring Data Elasticsearch - I noticed something that looks like a bug with the generated findAllByFoo type methods. These seem to be limited to the default size (of 10) - which goes against the semantics you would expect from a findAll operation.…
Eugen
  • 8,523
  • 8
  • 52
  • 74