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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

Elasticsearch and spring data (optimistic locking)

I have a question about some automation implementation it via elastic spring boot data. @SuperBuilder @NoArgsConstructor @AllArgsConstructor @Document(indexName = "super_test_index") public ...
Yegor Saliev's user avatar
0 votes
1 answer
16 views

Spring Boot 2.7.8, latest ElasticSearch Cluster?

Hello dear community, I am in the process of upgrading Spring Boot from 2.3.x to 2.7.8 and wanted to ask what is the highest Elastic version currently supported? I am currently using an ElasticSearch ...
Andreas Pichler's user avatar
0 votes
1 answer
26 views

Disable indexing parameters with type "object" in index ElasticSeacrh

I use ElasticSearch 8.6.2 to store custom logs, I build a Java object and save it to ELC using RestHighLevelClient. The class I save in ELK: public class DetailedLogModel { private Map<String, ...
Денис Дергачев's user avatar
0 votes
0 answers
11 views

How to search using elastic search 8.8 java and get response without specifying target bean

In Elastic 6.8 spring data elastic I could query by providing an extractor; ElasticSearchResultExtractor resultsExtractor; elasticsearchOperations.query(searchQuery, resultsExtractor) public class ...
Bankelaal's user avatar
  • 408
0 votes
0 answers
18 views

How to build dsl query in spring-data-elasticsearch 5 (ElasticsearchOperations , CriteriaQuery)

I'm trying to write some query using spring data elasticsearch 5 and this is my environment elasticsearch 8 spring-boot-3 spring-data-elasticsearch 5 and i can not make query like this with spring ...
dan kim's user avatar
0 votes
0 answers
20 views

Unable to save to Elastic search with correct index

I'm getting data from service bus queue using jms Template receive method and then saving received data into elasticsearch. I have also created an endpoint for this . The issue I'm facing is first ...
Cdac15655482's user avatar
0 votes
1 answer
31 views

Is there any difference when applying http_max_content_length setting for elastic clusters for version 7.17.3 and 8.9.0?

I have two elastic clusters one with version 7.17.3 and the other with 8.9.0. I was having an issue https://stackoverflow.com/questions/51020646/org-apache-http-contenttoolongexception-entity-content-...
Shubham Palkar's user avatar
0 votes
1 answer
23 views

LinkedHashMap objects in SearchHits instead of user type objects

To search with one query for several indexes in "Spring Data ES", I created an object "IndexCoordinates", in which I added the names of the indexes I needed. The result is expected....
Dmitriy_Ze's user avatar
0 votes
1 answer
63 views

Elasticsearch Searching and Sorting Error: Parsing Exception - Malformed Query

I am working on implementing searching and sorting functionality using Elasticsearch in my Java application. I am using Elasticsearch version 8.10.4 and Spring Data Elasticsearch version 5.1.5. When I ...
sandeep kande's user avatar
0 votes
1 answer
58 views

elasticsearch script_score query with java client

I'm using spring-boot 3.1.5 and spring-data-elasticsearch 5.1.5 java project. I try to make client program with this query. GET vector_search/_search { "query": { "function_score&...
Luis han's user avatar
0 votes
0 answers
42 views

Unable to Perform Search Using Spring Data Elasticsearch and Elasticsearch High-Level REST Client

I am trying to implement a partial search functionality in my Spring Boot application using Spring Data Elasticsearch and the Elasticsearch High-Level REST Client. I have a method partialSearchUsers ...
sandeep kande's user avatar
0 votes
0 answers
20 views

Update multiple documents in ES index using spring-data-elasticsearch

Using spring-data-elasticsearch v5.1.0, I want to update all documents in my index to add/overwrite some fields. This does not work (afaiu it only works for single-document update queries, correct?): ...
Wang Tang's user avatar
  • 540
0 votes
1 answer
32 views

Can I use Spring Data ElasticSearch instead of Specification for MySQL query?

I want to build a /search endpoint, I find Specification quite hard to code and limiting if traverse across multiple microservices. Is using Spring Data ElasticSearch instead for MySQL search a good ...
vunhatchuong's user avatar
0 votes
2 answers
30 views

how to sort msearch results among several indexes

I need to make a query to several indexes to match one criterion. I use "multisearch" to search among several indexes. Java code below: List<SearchHits<?>> searchHits = ...
Dmitriy_Ze's user avatar
0 votes
1 answer
36 views

Strange behavior of Spring Data Elasticsearch with a Wildcard query using a '?'

I created a Spring Boot application using spring-data-elasticsearch 5.1.1. When I execute my query on the database, I get the correct result, but not with the API, and I can't figure out why. I have ...
gcbox999's user avatar
  • 161
0 votes
1 answer
22 views

spring-data-elasticsearch @Field with nested documents

I have an index with this documents : { "brand": "Renault", "brand_suggest": [ { "input": "Renault", "weight": 10 }, ...
user1361815's user avatar
0 votes
2 answers
24 views

How to change the primary score by increasing it by the value of the "booster" field of the document that corresponds to the query

I am looking for ways to solve the problem of changing the score of documents corresponding to the query: I need to change the primary score by increasing it by the value of the "booster field of ...
Dmitriy_Ze's user avatar
0 votes
0 answers
50 views

[type=search_context_missing_exception, reason=No search context found for id [5123123]]

I am trying to use scrollApi, with its simplest approach: public Stream<MyData> getAllRecords { Query searchQuery = new NativeSearchQueryBuilder() ....
SereneAtk's user avatar
1 vote
0 answers
53 views

How to set slice when using PIT API w/ Spring Data Elasticsearch?

I am working on a Spring Boot application where I have to search through 100k+ docs and I am using the PIT api to achieve this. Previously, using the elasticsearch libraries this was achievable by: ...
Omar's user avatar
  • 11
0 votes
1 answer
41 views

@Query including extra // for escape character "/"" in while connecting to elasticsearch

service class: String linkname = StringUtils.join(link, "\", \""); String querylink = StringUtils.wrap(linkname, "\""); String query = "{"+"\"...
mpsimham's user avatar
0 votes
0 answers
45 views

Paging forward vs backward with PIT

I am using ES 7 and spring data to query for data in ES. I want to have paging working after 10000 elements and for that I think I will implement PIT and _shard_doc approach described here: https://...
SereneAtk's user avatar
0 votes
1 answer
72 views

Elastisearch with lots of data and paging

I am using Elasticsearch to query ES data. When I query for a page after 10000 element I get this exception: RestStatusException{status=400} org.springframework.data.elasticsearch.RestStatusException:...
SereneAtk's user avatar
0 votes
1 answer
91 views

Spring Data Elastic Fails on 3.1.4 - Incorrect HTTP method for uri

I've been upgrading my Spring Boot Elastic application from 2.x up to 3.x - i'm struggling with the below error that i've been able to reproduce in a fresh Spring Boot ES Application (from the Spring ...
Mannie's user avatar
  • 1,625
0 votes
0 answers
23 views

Sorting by a field of the "keyword" type, taking into account the values of the numbers contained in the field string

I am trying to find a solution to sort the search result in elasticsearch by a field of type "keyword", the value of which can contain a string with a number at the same time. Since the &...
Dmitriy_Ze's user avatar
0 votes
2 answers
114 views

Set query size when performing scroll request via Spring Data Elasticsearch Repositories

I have a Spring Boot application and am using spring-data-elasticsearch-5.1.2 to create a scroll request to fetch large sets of "book"s from elasticsearch. The setup looks something like ...
Seanimus's user avatar
  • 459
0 votes
0 answers
33 views

How to create a java entity for Elasticsearch aliases?

I created an alias using the command: POST /_aliases { "actions": [ { "add": { "index": "books", "alias": "combined-...
Murtazali's user avatar
0 votes
0 answers
14 views

The task of a query to search for a single value in documents of different types from different indexes in spring data elasticsearch (SDE)

I did not find the relevant information in the spring data elasticsearch specification about method for one query to find matches in two indexes. The method is necessary to get the results of ...
Dmitriy_Ze's user avatar
0 votes
1 answer
51 views

Reindexing data in elastisearch after index change

I have a field carName which uses some analyzer: @Field(type = FieldType.Text, searchAnalyzer = "myAnalyzer", analyzer = "myAnalyzer") private String carName; The myAnalyzer ...
SereneAtk's user avatar
0 votes
0 answers
36 views

Elasticsearch HelathCheck failed : Unknown host

An elasticsearch server version 8 is up with docker compose but the ElasticSearch health check failed when starting my springboot applcation, I am working with Elastic Search 8 on Spring boot 3 the ...
Dado sellami's user avatar
0 votes
1 answer
83 views

ElasticSearch - delete by query - too many scroll contexts exception

We are using Elastic Search 7.6.1 , In consumer ,we consume elastic operation batch messages from topic/queue and do elastic search updates accordingly in ES, we happen to execute sequence of delete ...
Kalaiselvam M's user avatar
0 votes
1 answer
86 views

Can elasticsearch client version 8.X communicate with elasticsearch server version 7

I have 2 questions: 1: can elasticsearch client version 8 communicate with elasticsearch server version 7? 2: how to configure spring data elasticsearch version 5 first of all, can client ...
Dado sellami's user avatar
0 votes
0 answers
31 views

Query on Elasticsearch with wildcard path field

I want to save some similar JSONs in one index in elasticsearch These are 2 samples: 1. { "data": { "other-fields":"value", "country": "...
Amir Naby's user avatar
0 votes
1 answer
50 views

Spring Boot and Elasticsearch @Field(type = FieldType.Date) with LocalDateTime conversion error

I am using Elasticsearch in a spring boot application. I am trying to convert the "kibana_sample_data_ecommerce" sample index, one of the sample databases in Kibana, into a spring boot ...
serdarfirlayis's user avatar
0 votes
0 answers
20 views

ElasticSearch Spring boot does not sort by relevant data

I am using Elasticsearch in spring boot project. The problem is that when I am querying data with Elasticsearch's API it is giving sorted (by relevant first) data. But when I am using ...
Khushwant Pratap yadav's user avatar
0 votes
2 answers
108 views

How to return a simple query with aggregation using Spring Data Elasticsearch (latest version) and Spring Boot?

I'm trying to retrieve a list of aggregated brands using Spring-Boot 3 + Spring Data ElasticSearch 5 and Elasticsearch 8. Currently, I am getting results but never aggregated ones. I have gone through ...
gcbox999's user avatar
  • 161
0 votes
1 answer
96 views

Spring data elasticsearch document count info using built in reactive client

My problem: I am trying to get indices information: IndexName IndexCreationDate IndexAlias IndexDocumentCount IndexSize I am able to get some of that information via GetIndexResponse mentioned below. ...
User1254's user avatar
1 vote
1 answer
96 views

Spring Data elasticsearch UpdateQuery withRefreshPolicy not working

I use ElasticsearchOperations to implement update operations. esOperations.update( UpdateQuery.builder(old.id.toString()) .withDocument(Document.from(mapOf("browsed" to item....
SageJustus's user avatar
0 votes
1 answer
160 views

How can the ReactiveElasticsearchClient be enriched with headers from a Mono?

I am going to enrich the Spring Data Elasticsearch - ReactiveElasticsearchClient requests with a JWT (as authorization header) retrieved from the ReactiveSecurityContextHolder. The deprecated version ...
GeBeater's user avatar
  • 143
0 votes
2 answers
58 views

Springdata Elasticsearch - How to populate id field in _source when indexing?

I have a document @Document(indexName = "my_index") public class MyDocument { @Id @Field(type = FieldType.Keyword) private String id; @Field(type = FieldType.Keyword) private ...
Marius Manastireanu's user avatar
0 votes
1 answer
91 views

How to use multi term filter in Spring Data Elasticsearch?

I wish to implement the following rest api: POST /t_source_item/_search?typed_keys=true&search_type=query_then_fetch { "query": { "bool": { "filter": [ ...
SageJustus's user avatar
1 vote
1 answer
173 views

Failed to parse mapping: Field [similarity] requires field [index] to be configured

when I use dense_vecto and set cosine to similarity, start application will get a mapper_parsing_exception : Field [similarity] requires field [index] to be configured But the @Field annotation has ...
Rodrick Zadrozny's user avatar
0 votes
1 answer
40 views

Elastic Search Spring Data not setting FieldType Nested

I'm working with spring-boot-starter-data-elasticsearch version 2.7.3, ElasticSearch version 8.7.1. I have a field, B, annotated as @Field(type = FieldType.Nested) in class A. I create an index on ...
sdeep-de's user avatar
0 votes
0 answers
112 views

Connect aws elastic search 7.x with spring boot

I tried connecting aws elasticsearch with spring boot through spring-elasticsearch-data and various other libraries but i get invalid bridge or oss flavor error. Any help in connecting them
sandesh a's user avatar
0 votes
0 answers
97 views

Cannot index a document due to seq_no+primary_term conflict since upgrade to spring-data-elasticsearch 5.x

I've upgraded from spring-data-elasticsearch 4.x to 5.x and switched from REST high level client to Elastic's new client. Since then, I'm getting a lot of org.springframework.dao....
N4zroth's user avatar
  • 1,344
-1 votes
1 answer
77 views

I am trying to pass this query as native query from my spring boot application but its throwing response after trying alot of combiation also

{"size": 0,"query": {"term": {"loan_application_id": {"value": 87015}}},"aggs": {"group_by_fields": {"composite": {"...
Ritik kumar's user avatar
0 votes
0 answers
31 views

Use Spring data elasticsearch in AWS Lambda

Spring data elasticsearch provides annotations so I don't need to create the index mapping json manually, it also takes care of updating the indexes automatically. I want to take advantage of all ...
user9973's user avatar
0 votes
2 answers
43 views

How to matches any character on elasticsearch request with Spring-Boot and JPA?

I want to match any character against two characters "*" and "?" in the parameters of a query using JPA and an elasticsearch database. Example: In my database I have a "code&...
gcbox999's user avatar
  • 161
1 vote
0 answers
319 views

Spring Boot,Spring application gets connection refused when trying to connect to elasticsearch in GKE

I have successfully deployed elasticsearch at gke following the steps of this tutorial The problem appears when applying the deployment descriptor of my application where it gets the following ...
kafrlust's user avatar
  • 299
0 votes
1 answer
77 views

spring-data-elasticsearch: how to combine and & or with CriteriaQuery

I have a document with 4 fields, for simplicity sake A, B, C and D. Now I'm trying to build a CriteriaQuery where ((a = 1 AND b = 2 ) OR (a = 3 AND b = 43)) AND D = '4234234' The basic flow using by ...
Jackie Danes's user avatar
0 votes
1 answer
70 views

spring data elastic : Aggregator [total_sum_metric] of type [sum] cannot accept sub-aggregation

I'm new on spring data elastic and i'm facing issue about query aggregation. My stack is : spring boot 3, spring 6, elastic client 8.5.x. My elastic search host version is 7.xx. So let's assume we ...
Waley's user avatar
  • 47

1
2 3 4 5
30