All Questions

Filter by
Sorted by
Tagged with
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
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
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 ...
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
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....
9
votes
1answer
881 views

Transactional Support in Spring Data Elastic Search

I am working with Spring Data Elasticsearch , Spring Data has support for Transactional queries . This i am enabling by @Transactional annotation. But since elasticsearch does not have any ACID ...
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 ...
7
votes
2answers
6k views

Partial update with Spring Data Elasticsearch repository

I have a document with many fields (some nested) indexed on elasticsearch. For example: { "id" : 1, "username" : "...", "name" : "...", "surname" : "...", "address" : "...", "age": 42, ....
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/...
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
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
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
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. ...
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
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
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
1answer
108 views

Partial query with Where statement using Elasticssearch 7 java api

I am using the following to search. It is working fine. But it is returning the results when complete word match is found. But I want results with a partial query (minimum 3 characters match ...
5
votes
1answer
671 views

spring data elasticsearch dynamic multi tenant index mismatch?

I am experimenting with spring data elasticsearch by implementing a cluster which will host multi-tenant indexes, one index per tenant. I am able to create and set settings dynamically for each ...
5
votes
0answers
251 views

Inconsistency in the Spring Data Elasticsearch documentation for limiting the result size of query with Top or First keyword

Spring data offers a convenient way to limit results with the keyword Top or First. We can read in the Spring Data ES documentation : The results of query methods can be limited via the keywords ...
4
votes
4answers
4k views

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 ...
4
votes
2answers
3k views

Is it possible to use Spring's annotations to define Completion Suggester for a mapping in Elasticsearch?

I currently have the following POJO. @Document(indexName="ws",type="vid") public class Vid { @Id private String id; @Field(type=FieldType.String, index=FieldIndex.not_analyzed) ...
4
votes
2answers
2k views

Does Spring Data Elasticsearch support Multi Search API?

I'm using Spring Data Elasticsearch, and am interested in utilizing Elasticsearch 6.2's Multi Search API in order to execute more than one search in a single API request. https://www.elastic.co/guide/...
4
votes
1answer
2k views

Document, Min and Max for specific field with spring data elasticsearch

I'm using Spring Data ElasticSearch and trying to get distinct documents with a min and max value for one of the fields. I also need the document associated with the Max Value. Based on some ...
4
votes
1answer
136 views

Spring Data Elasticsearch (4.x) - Using @Id forces id field in _source

Summary Recently we upgraded to Spring Data Elasticsearch 4.x. Part of this major release meant that Jackson is no longer used to convert our domain objects to json (using ...
4
votes
1answer
2k views

index a @MultiField spring-data-elasticsearch. Internationalization purposes

I´m trying to index a multiField String attribute ("prueba") for multilingual purposes. My mapping is working with annotations @MultiField( mainField = @Field(type = FieldType.String, store = ...
4
votes
1answer
314 views

Meaning of useServerConfiguration() and createIndex() in spring data for elastic search

Hi I recently upgraded from spring-data-elasticsearch 1.3.2 to 2.0.1. I noticed that there are two new attributes of @Document annotation: boolean useServerConfiguration() default false; boolean ...
4
votes
1answer
1k views

findBy query method not woking in spring data elasticsearch

I am using Spring-data-elasticsearch plugin for retrieving information from elasticsearch server. Below is the repository class: public interface ActorRepository extends ElasticsearchRepository<...
4
votes
0answers
754 views

Spring-data-elasticsearch @CompletionField does not create field with type “complete”

I am using Spring-data-elasticsearch and there ElasticsearchTemplate functions. I try to create an index by using the @CompletionField annotation on a Completion field named suggest. @Document(...
4
votes
0answers
1k views

Spring Data Elasticsearch “Error creating elasticsearchTemplate”

Im using: - elasticsearch 5.4. - Spring boot 1.4.7.RELEASE - spring-data-elasticsearch 3.0.1.RELEASE. @Configuration @EnableElasticsearchRepositories(basePackages = "com.landfiles.farms....
4
votes
0answers
151 views

Randomize result from Elasticsearch using NativeSearchQueryBuilder

Hi I am new ElasticSearch, I am using spring data. I have 2 API which saves data in article and discourse model using elastic search, now when a client app makes a API call for both article and ...
4
votes
0answers
615 views

Spring Data Elasticsearch containing query with spaces

I have an entity named Port with a field portName. I wrote following Spring Data ES query method for containing query: List<Port> ports = portRepository.findByPortNameContaining(searchText); ...
4
votes
0answers
563 views

Elasticsearch Nested Type Recursive

We are using Spring Data Elasticsearch for the development of our search mechanism. I'm just wondering how can we have a parent-child mapping of the same type/document? The code is more like this: @...
3
votes
2answers
8k views

Getting count and list of ids using ElasticsearchTemplate in spring-data-elasticsearch

I am using spring-data-elasticsearch for a project to provide it with full text search functionality. We keep the real data in a relational database and relevant metadata along with respective id in ...
3
votes
1answer
2k views

Spring Elasticsearch HashMap[String, String] mapping value cannot be not_analyzed

Actually my question is very simple: I want my hashmap value not_analyzed! Now i have one object contains a hashmap[string, string], looks like: class SomeObject{ String id; @Field(type=...
3
votes
1answer
4k views

Getting the error Fielddata is disabled on text fields by default in CURL [duplicate]

I tried this command: curl -XPOST 'localhost:9200/bank/_search?pretty' -d ' { "size": 0, "aggs": { "group_by_state": { "terms": { "field": "state" } } } }' When I'm executing it, then I always ...
3
votes
3answers
2k views

Spring Data Elasticsearch - Create keyword field with normalizer

We are using the spring-data-elasticsearch project to interface with our elasticsearch clusters, and have been using it now for around a year. Recently, we moved to elasticsearch 5.x (from 2.x) where ...
3
votes
5answers
2k views

Can't connect java client to elasticsearch server

I'm trying to connect my java client to an elasticsearch server. Elasticsearch 2.4.0 is installed on a distant server. To access to it, I have to use port 10700. (When I run "telnet xxxx 10700", it ...
3
votes
1answer
7k views

Elasticsearch return raw json with java api

I have following requirements in my spring web app: find objects from Elasticsearch and display them on google map (json format preferred) find objects (the same query as above) from Elasticsearch ...
3
votes
1answer
571 views

Elasticsearch multiple values match without analyzer

Pardon my knowledge on ElasticSearch. I have an Elasticsearch collection which has documents like these: { "date": "2013-12-30T00:00:00.000Z", "value": 2, "dimensions": { "region":...
3
votes
2answers
308 views

Spring Data Elasticsearch failed to find geo_point field

I have an spring boot application for use elasticsearch geopoint. When i save an elastic index and create a geoDistanceQuery i getted QueryShardException[failed to find geo_point field [customer]] ...
3
votes
0answers
309 views

Intercepting aggregation query in elastic search

I am investigating elastic search now and I like to get some insights on the possibility of certain things. Any suggestions would be greatly appreciated. I'm trying to tackle a very specific use ...

1
2 3 4 5
7