All Questions
Tagged with
spring-data-elasticsearch
elasticsearch


697
questions
23
votes
4answers
30k views
The Best way to use ElasticSearch in Spring java framework
I'm developing a system which is planning to use elasticsearch as an data repository.
I'm trying to choose the best way to develop my application that can index and query data from elasticsearch.
The ...
18
votes
3answers
15k views
Elasticsearch Rest Client with Spring Data Elasticsearch
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 ...
17
votes
4answers
18k views
ElasticSearch returning only documents with distinct value
Let's say I have this given data
{
"name" : "ABC",
"favorite_cars" : [ "ferrari","toyota" ]
}, {
"name" : "ABC",
"favorite_cars" : [ "ferrari"...
16
votes
2answers
11k views
Elasticsearch indexing not working and error message: node null not part of the cluster Cluster [elasticsearch], ignoring
I just downloaded the elastic search distribution and ran it.
curl 'localhost:9200'
{
"status" : 200,
"name" : "cbs",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "1.4.1"...
16
votes
5answers
10k views
How to enable query logging in Spring-data-elasticsearch
I use spring-data-elasticsearch framework to get query result from elasticsearch server, the java code like this:
SearchQuery searchQuery = new NativeSearchQueryBuilder()
.withQuery(matchAllQuery())....
15
votes
1answer
8k views
Spring Data Elasticsearch id vs. _id
I am using Spring Data Elasticsearch 2.0.1 with Elastic version 2.2.0.
My DAO is similar to:
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations....
14
votes
2answers
18k views
Spring Data Elasticsearch's @Field annotation not working
I have a Spring Boot application with Spring Data Elasticsearch plugin in the pom.xml. I created a document class which i'd like to index:
@Document(indexName = "operations", type = "operation")
...
14
votes
2answers
6k views
Spring Data Elasticsearch: Multiple Index with same Document
I'm using spring-data-elasticsearch and for the beginning everything works fine.
@Document( type = "products", indexName = "empty" )
public class Product
{
...
}
public interface ProductRepository ...
12
votes
1answer
27k views
Spring Data Elastic Search with Nested Fields and mapping
I am using spring-data-elasticsearch and elasticsearch together to query documents. I'd like to do nested queries on nested documents.
I have this in java :
@Document(indexName = "as", type = "a", ...
11
votes
3answers
4k views
Cannot use custom autoconfiguration with spring-data-elasticsearch
I am not able to get spring-data-elasticsearch working for Elasticsearch 2.0+ versions.
On using following POM
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http:/...
11
votes
1answer
5k views
Spring Elastic Search Custom Field names
I am new to Elastic Search and I am trying to implement it using Spring-data-elasticsearch.
I have fields with names such as "Transportation", "Telephone_Number" in our elastic search documents.
...
11
votes
1answer
3k views
Spring data elasticsearch bulk index and delete
I'm new to the community so I apology if I do something wrong.
I'm using spring data elasticsearch (2.0.4/2.4)
And I would like to make a bulk insert and delete.
But ElasticsearchTemplate only ...
10
votes
2answers
10k views
How to make elasticsearch embedded accessible via localhost:9200
I am playing with spring-boot-sample-data-elastcisearch project.
I've changed the pom and added:
SampleElasticsearchApplicationWebXml extends SpringBootServletInitializer
to run with Tomcat ...
10
votes
2answers
12k views
Creating Indices name Dynamically in Elasticsearch using Spring-Data Elasticsearch
I have a use case where in need to create the indices per month in Elasticsearch. The idea is to create indices on the monthly bases so that they are easy to maintain and can be deleted when expired....
10
votes
3answers
6k views
spring-data-elasticsearch - registering custom analyser
I'm trying to use ElasticSearch in my application for full text search and at this time I'm trying use autocomplete analyser:
{
"settings": {
"number_of_shards": 1,
"analysis": {
...
9
votes
1answer
6k views
Spring Data Elasticsearch's ElasticsearchTemplate vs ElasticsearchRepository
I am in reference to Spring Data Elasticsearch's
org.springframework.data.elasticsearch.repository.ElasticsearchRepository
org.springframework.data.elasticsearch.core.ElasticsearchTemplate
It ...
9
votes
3answers
10k views
spring data elasticsearch: settings and mapping config with annotations not working
I'm using embedded elasticsearch with spring boot and I was trying to use annotations for configuring settings and mappings. I followed this Tutorial which explains how to implement searching over ...
8
votes
2answers
7k views
How to increase the max_result_window in elasticsearch using a python script?
I know, we can use the curl to increase the max_result_window as something like:
curl -XPUT "http://localhost:9200/index1/_settings" -d '{ "index" : { "max_result_window" : 500000} }'
But How do I ...
8
votes
4answers
2k views
Multitenancy with spring-data-elasticsearch
Is there any way to make spring-data-elasticsearch to work for multitenant application?
I've made it to work without multitenancy, but I don't know how can I have multiple indices or multiple nodes ...
8
votes
3answers
5k views
Elasticsearch Spring Data with RestHighLevelClient
I don't understand the relationship between the High Level REST CLient (which replaces the Transport Client) and Spring Data Elasticsearch.
There are tutorials (https://www.baeldung.com/spring-data-...
8
votes
1answer
2k views
Index not Found Exception
So, back again
I have a JHipster generated project which uses an elasticsearch java client embedded in spring boot.
I have recently done some major changes to the datasets since we've been migrating ...
8
votes
1answer
2k views
Spring Data REST does not seem to be working with elasticsearch
I am trying to use Spring Data REST for elasticsearch. The built-in REST controller for POST doesn't seem to be working: I am getting an error when I attempt to post a document. The issue is easy to ...
8
votes
1answer
2k views
How to store Java 8 (JSR-310) dates in elasticsearch
I know elasticsearch can only save Date types internally. But can i make it aware to store/convert Java 8 ZonedDateTime, as i use this type in my entity?
I'm using spring-boot:1.3.1 + spring-data-...
8
votes
1answer
5k views
Best way to synchronize Elasticsearch with Mysql
I am using elasticsearch in my spring web mvc project (spring-data-elasticsearch) and to synchronize with database (MySQL).
I am indexing the document from my app, if any new entity going to add in ...
7
votes
1answer
11k views
Spring Data ElasticSearch TransportClient Java Config
Does anybody know what's Java Config equivalent of :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/...
7
votes
4answers
7k views
How to configure Spring Boot with elasticsearch 5.2.1?
I am trying to connect my Spring Boot application to local elasticsearch 5.2.1 instance. When i use "org.springframework.boot:spring-boot-starter-data-elasticsearch" dependency, i face with "Received ...
7
votes
4answers
6k views
None of the configured nodes are available issue with spring boot
Hi friends i am developing spring boot project with elastic search i have setup elastic search on local machine and i have installed Head plugin in elastic search . My elastic search is setup ...
7
votes
0answers
872 views
Spring data elasticsearch's CriteriaQuery vs SearchQuery
I am in reference to Spring Data Elasticsearch's CriteriaQuery and SearchQuery (both from org.springframework.data.elasticsearch.core.query package).
I am not sure when I should be using a ...
7
votes
2answers
2k views
How to define ElasticSearch index field names for a POJO using Spring Data ElasticSearch
I'm using Spring Data ElasticSearch to perform CRUD operations. By default, when a POJO annotated with @Document gets written to an ElasticSearch index, the index field names are the same as the POJO'...
6
votes
2answers
5k views
What Elasticsearch client does Spring-Data-Elasticsearch use under the hood?
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 ...
6
votes
1answer
2k views
How to config not_analyzed with @Field annotation in spring-data-elasticsearch 3.0.0.RC2
In spring-data-elasticsearch 3.0.0.RC2, @Field annotation has a boolean index() and a String analyzer().
How to config "not_analyzed" with @Field annotation?
6
votes
3answers
8k views
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:
[...
6
votes
2answers
6k views
How to interact with elastic search Alias using Spring data
Hi I am using elastic search Spring data. Domain structure of my project keeps on changing.So I have to drop the index in order to change the mapping every time. To overcome this problem, I am using ...
6
votes
1answer
513 views
ElasticSearch - Spring Boot - Upsert is throwing DocumentMissingException
I am using Spring Boot and ElasticSearch. When I am trying to upsert using Spring, it is throwing DocumentMissingException when there is no document present in the ElasticSearch. The same code works ...
6
votes
1answer
7k views
How add sorting to spring data elasticsearch
I m writing an api using elasticsearch spring data and I want to add ordering.I cant find a resolve in google. So I write here to ask you guys how I can do that. If you will need more code please tell ...
6
votes
1answer
1k views
Spring-data-elasticsearch search for specific fields in multiple indices
I try to search specific fields in multiple indices. I have two indices country and region. Both of the indices have a Field called name.
I am able to specify my field name and my indices in my ...
6
votes
1answer
1k views
@Setting annotation for Elasticsearch is ignored in Spring Boot
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")
@...
6
votes
1answer
3k views
it's possible make spring-data-elasticsearch @Document with compound key?
I started to work with Spring Data Elasticsearch on Spring Boot 1.3.1 and I want to use the same Entity that use in my database, and it has compound key.
Entity class:
@IdClass(PassengerPk.class)
@...
6
votes
1answer
1k views
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.
...
6
votes
1answer
485 views
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:
@...
5
votes
2answers
5k views
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(...
5
votes
2answers
9k views
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.transport.Netty3Plugin
I'm using Spring Boot 2.0.3 Release and i have problem while instantiating org.elasticsearch.client.Client. My code:
Client client = new PreBuiltTransportClient(Settings.builder()
....
5
votes
6answers
15k views
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)...
5
votes
1answer
8k views
ElasticSearch Java Client querying nested objects
How do I convert this kind of query.
{
"query": {
"nested": {
"path": "consultations",
"query": {
"bool": {
"must": [
{
"match": {
...
5
votes
4answers
4k views
How to provide highlighting with Spring data elasticsearch
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 ...
5
votes
4answers
5k views
java.lang.IllegalStateException: Received message from unsupported version: [2.0 .0] minimal compatible version is: [5.0.0]
I'm trying to do this sample tutorial, in order to get familiar with elasticsearch. but running the project it gives this error in intellij:
org.elasticsearch.transport.NodeDisconnectedException: [][...
5
votes
4answers
2k views
ES Rest High Level Client throws SocketTimeoutException after being idle for sometime
RestHighLevelClient is used to connect to ES 6.4(hosted on AWS) in a spring-boot app. When the app goes idle for some time, and request arrives, then the RestHighLevelClient throws ...
5
votes
3answers
2k views
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 ...
5
votes
1answer
3k views
elasticsearch dynamic query - Add another field to each document returned
What I need is very simple, but I am unable to find how to do it in Elasticsearch, possibly because of the complexity of what is required to be done.
Input (two sample JSON documents)
{ "car" : 150, ...
5
votes
1answer
270 views
Spring data elasticsearch wrong page totalPages
I have a simple repository
@Repository
public interface SurgeryIndexRepository extends ElasticsearchRepository<SurgeryIndexEntity, UUID> {}
When I call the search method like this ...