spring-data-elasticsearch | Provide support to increase developer productivity in Java when using Elasticsearch. Uses familiar S | Microservice library

 by   spring-projects Java Version: 5.2.0 License: Apache-2.0

kandi X-RAY | spring-data-elasticsearch Summary

kandi X-RAY | spring-data-elasticsearch Summary

spring-data-elasticsearch is a Java library typically used in Architecture, Microservice, Spring applications. spring-data-elasticsearch has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub, Maven.

Provide support to increase developer productivity in Java when using Elasticsearch. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              spring-data-elasticsearch has a highly active ecosystem.
              It has 2791 star(s) with 1282 fork(s). There are 262 watchers for this library.
              There were 4 major release(s) in the last 6 months.
              There are 27 open issues and 1676 have been closed. On average issues are closed in 7 days. There are 1 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of spring-data-elasticsearch is 5.2.0

            kandi-Quality Quality

              spring-data-elasticsearch has 0 bugs and 0 code smells.

            kandi-Security Security

              spring-data-elasticsearch has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              spring-data-elasticsearch code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              spring-data-elasticsearch is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              spring-data-elasticsearch releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              It has 53323 lines of code, 6046 functions and 489 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed spring-data-elasticsearch and discovered the below as its top functions. This is intended to give you an instant insight into spring-data-elasticsearch implemented functionality, and help decide if they suit your requirements.
            • Initializes the property value converter
            • Returns a list of Elasticsearch date converters
            • Returns a DateFormatter for the given pattern
            • Initializes the value converter from the annotation
            • Execute a query with multiple queries
            • Executes a query on a list of classes
            • Execute a multi search query
            • Gets the specified index
            • Create a request for an index
            • Builds a native search query
            • Gets the sort builder
            • Gets the completion suggestion from a list of suggestions
            • Writes the type and parameters to an ObjectNode
            • Writes the given value as a string
            • Get the health of a cluster
            • Gets a request for term vectors
            • Reads the specified value as a Range object
            • A delete request
            • Updates an indexed object
            • Registers the given property
            • Gets a request
            • Performs an index operation
            • Creates a new ElasticsearchRestClient from clientConfiguration
            • Executes the query
            • Create a TemporalQuery for a given temporal type
            • Start the downloader
            Get all kandi verified functions for this library.

            spring-data-elasticsearch Key Features

            No Key Features are available at this moment for spring-data-elasticsearch.

            spring-data-elasticsearch Examples and Code Snippets

            Spring Data ElasticSearch Can't Connect with ElasticSearch 5.5.0
            Lines of Code : 57dot img1License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            # spring boot
            compile 'org.springframework.boot:spring-boot:2.0.0.M2'
            
            # elasticsearch
            compile 'org.elasticsearch:elasticsearch:5.5.0'
            compile 'org.elasticsearch.client:transport:5.5.0'
            
            # spring-data-elasticsearch for spring boot
            compile 

            Community Discussions

            QUESTION

            How to run springboot application without elasticsearch server running?
            Asked 2022-Apr-05 at 08:51

            I am using Springboot with MongoDb and Elasticsearch for my project. When my Elasticsearch server is running then my Springboot application is working fine but when the Elasticsearch server is stopped, my Springboot application also fails to start. According to my project's requirements, our Springboot application should still be running even though the Elasticsearch server fails to start as the majority of our APIs are built on Springboot and MongoDb and only a few depend on Elasticsearch. Is there any way I can achieve this?

            Elasticsearch configuration

            ...

            ANSWER

            Answered 2022-Apr-05 at 08:51

            You can mark them beans with @Lazy so spring will not construct them on application startup. It will construct them when you use them runtime.

            please see this documentation

            https://memorynotfound.com/lazy-initialize-autowired-dependencies-with-lazy-annotation/

            Source https://stackoverflow.com/questions/71747078

            QUESTION

            can I use old spring-data-elasticsearch to connect to new elasticsearch?
            Asked 2022-Mar-28 at 17:51

            Currently we are on spring-data-elasticsearch 3.2.6 + elasticsearch 6.8. We are moving to new elasticsearch 7.x. Do I have to update spring-data-elasticsearch to 4.x? We only use ElasticsearchRepository in spring-data-elasticsearch. And we don't need to use any new feature in elasticsearch 7.x.

            If we are moving to elasticsearch 8.x in the future, do I need update spring-data-elasticsearch ?

            Update:

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

            All methods in the `ElasticsearchRepository` are deprecated. What should do I use?

            I found some discussions in above threads. Here is my summary.

            1. Operations with Templates:

            ElasticsearchTemplate implements ElasticSearchOperation. It uses TransportClient(which is deprecated in ES 7 and has been removed in ES8)

            ElasticsearchRestTemplate implements ElasticSearchOperation. It uses high level client(which is deprecated in ES 7.16.0. It will be removed in future. @Deprecated(since = "7.16.0", forRemoval = true) )

            ReactiveElasticsearchTemplate implements ReactiveElasticsearchOperations. It uses Reactive Client.

            1. Repository

            ElasticsearchRepository uses TransportClient as default. All methods in the ElasticsearchRepository are deprecated now.

            Reactive Elasticsearch repository builds on ReactiveElasticsearchOperations.

            Due to underlying TransportClient or HigLevelRestClient has been deprecated, can I conclude that the correct way is to use Reactive Client(ReactiveElasticsearchTemplate or Reactive Elasticsearch repository) ?

            ...

            ANSWER

            Answered 2022-Mar-24 at 16:54

            The new Elasticsearch would be 8.

            Val already put the link to the compatibility matrix in his comment.

            Version 3.2.6 is pretty outdated (March 25 2020) and out of support since October 2020.

            The first thing you can try is to see if your application works with a 7 cluster - although I doubt that, I can't tell you exactly what had changed in the API, but there was quite some stuff.

            What you should not do is putting newer Elasticsearch libraries on the classpath than the ones that Spring Data Elasticsearch was built with, this will in most cases make problems.

            But I'd recommend to upgrade your application anyway and keep it regularly up to date.

            As for future upgrade to version 8: It is possible to send a compatibility header in your requests (this can be done in Spring Data Elasticsearch 4) and the Elasticsearch cluster should respond in a format that is compatible with a client expecting version 7. I wrote should, because it does not conform to this in every case - I reported one case that is fixed now. But I wouldn't rely on that.

            Again, please update your application and keep it up to date, not only because of Spring Data Elasticsearch, but also because these updates always include bug and/or security fixes.

            Source https://stackoverflow.com/questions/71605823

            QUESTION

            Getting Exceptions while running a Spring boot app with elasticsearch
            Asked 2022-Mar-15 at 09:47

            I was following this tutorial: https://www.youtube.com/watch?v=IiZZAu2Qtp0&ab_channel=LiliumCode

            and the only changes I made were that I was using maven with eclipse instead. The rest of the code is exactly the same. When I run the app I get:

            ...

            ANSWER

            Answered 2022-Mar-15 at 09:47

            ConnectionClosedException seems to hint at the fact that your Spring Boot application cannot establish a connection to your ES cluster.

            It looks like you're using ES8, which has SSL/TLS on by default, so you would need to configure your Spring Boot application to use SSL instead.

            At 6:00 into the video, elasticsearch.url in application.properties should be https://localhost:9200 instead of just localhost:9200.

            However, as of March 15th 2022, it doesn't seem like ES 8 is supported by Spring Data ES yet, you might need to revert to the ES 7.15+ release.

            Source https://stackoverflow.com/questions/71478330

            QUESTION

            How to search Startswith and Endswith in Elasticsearch using Java?
            Asked 2022-Feb-06 at 18:51

            I am using Spring-Data-Elasticsearch and I have the following queries,

            ...

            ANSWER

            Answered 2022-Feb-06 at 18:51

            QUESTION

            Connecting to ES with Spring Data Elasticsearch (reactive) gives error host not reachable
            Asked 2022-Jan-25 at 15:25

            I'm running on an aws-elasticsearch (with OpenSearch 1.1.x) service and im trying to connect with it since an spring application using spring-data-elasticsearch, according to the doc i configured the way it says.

            From aws i used an ssh tunnel from my aws account.

            i used this command:

            ...

            ANSWER

            Answered 2021-Oct-18 at 05:15

            You have to configure to use SSL for the reactive client with one of the usingSsl()methods:

            Source https://stackoverflow.com/questions/69607732

            QUESTION

            `ElasticsearchOperations` formulation with spring-data-elasticsearch 4.4 and elasticsearch 7.16
            Asked 2022-Jan-22 at 07:44

            Before elasticsearch 7.16, the ElasticsearchOperations could be formulated with RestHighLevelClient

            ...

            ANSWER

            Answered 2022-Jan-22 at 07:44

            I am currently working on integrating the new Elasticsearch client in Spring Data Elasticsearch. We will in the next minor release (4.4) still the RestHighLevelClient but provide as an optional alternative the possibility to use the new client.

            The new client does not yet have the same functionality as the RHLC and still has some error (you might want to have a look at it's issue list), so we cannot already replace it, but the most important reason not to use it in the current version is that the new Client pulls in jakarta packages instead of javax and switching by default to the new client would break many existing applications.

            A full replacement cannot be done before Spring Data Elasticsearch 5.0, which will use Spring 6, be integrated in Spring Boot 3 as Jakarta EE9 will be only with these releases.

            In my opinion, Elasticsearch should not have deprecated the RHLC in a switch of a minor version (ES 7.15 -> 7.16) while providing an incomplete alternative that introduces breaking changes.

            So for the time being we have to live with the fact that Spring Data Elasticsearch needs to use a deprecated class.

            Source https://stackoverflow.com/questions/70808154

            QUESTION

            Spring data Elasticsearch : Reinitialise elasticsearch hosts/cluster_password programmatically
            Asked 2022-Jan-11 at 15:26

            TL;DR : How to switch elastic search hosts at runtime using spring-data-elasticsearch?

            We have a spring boot application (v : 2.5.2) using spring data elasticsearch (v: 4.2.2).

            I am using java configurations to initialize ES connection as mentioned in High Level Rest Client section of spring's documentation.

            We have a requirement where we need to change the elasticsearch hosts at runtime and not manually restart our servers.

            I tried restarting spring IOC on hostname config change using something similar to spring actuator's RestartEndpoint. But this seems to work only in spring's embedded tomcat and not with the external tomcat that we use.

            Is there an alternate way to do this?

            [This is required in case there is a disaster and we need to switch to backup]

            ...

            ANSWER

            Answered 2022-Jan-08 at 17:19

            Nothing out of the box.

            One idea (I did not try it out): You'd need to create your own implementation of the ElasticsearchOperations interface, lets call it MyOperations and return that from the AbstractElasticsearchConfiguration#elasticsearchOperations() method which your configuration inherits. In this MyOperations implementation (which is a singleton Spring bean), you'd create a delegate ElasticsearchOperations with the same code like in the configuration class that is connected to normal cluster. Every method in your implementation then delegates to the corresponding method of the delegate.

            In the failure case, your implementation would create a new delegate that now connects to the secondary cluster and replace the first one with it. Or create both and implement a toggle feature to switch between the two.

            Source https://stackoverflow.com/questions/70618247

            QUESTION

            Setting elastic search refresh interval when Refresh Policy is none
            Asked 2021-Dec-11 at 21:33

            I was comparing elastic search results with refresh_interval 1s and 30s, when Refresh Policy was set to None by indexing 2000 documents in the same rate. but there was not much difference between their indexing speed.

            using version:

            ...

            ANSWER

            Answered 2021-Dec-11 at 21:33

            These are different things. refresh (aka refreshPolicy) lets you tell ES to start a refresh after indexing and wait for it to complete (wait_for) or not wait (true) or just leave cluster do its job (false, None, default).

            refresh_interval makes most sense when refresh is not enabled and it defines how exactly cluster "does its job". Refresh is quite heavy operation so it's recommended to increase it or even disable (set to -1) for the time of indexing.

            If you haven't noticed performance improvement while changing refresh_interval then you probably haven't maxed out indexing capacity on ES side: bulk size tuning, multiple indexing threads/machines, etc (see Tune for indexing speed)

            Source https://stackoverflow.com/questions/70313605

            QUESTION

            Elasticsearch exception unrecognized parameter ccs_minimize_roundtrips
            Asked 2021-Nov-23 at 15:15

            I am getting the following error while searching data from elasticsearch through spring data jpa

            ...

            ANSWER

            Answered 2021-Nov-23 at 15:15

            The ccs_minimize_roundtrips parameter has been added in 7.0.0-beta1, so my take is that you're using a client version that is more recent (i.e. 7+) than your Elasticsearch server version.

            According to your Maven dependencies, spring-data-elasticsearch:3.2.3 depends on Elastic 6.8.12, so there is a small disconnect between the client and server versions.

            Source https://stackoverflow.com/questions/70082182

            QUESTION

            How to search by nested field id using NativeSearchQueryBuilder in ElasticsearchRepository?
            Asked 2021-Nov-07 at 21:11

            I am using spring-data-elasticsearch and I have a class as follows,

            ...

            ANSWER

            Answered 2021-Aug-31 at 04:46

            Your top level query should be a bool query with two entries as must:

            • the first for the name that would be the one you already have.
            • the second for the "status.id" property

            Source https://stackoverflow.com/questions/68989964

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install spring-data-elasticsearch

            Here is a quick teaser of an application using Spring Data Repositories in Java:.

            Support

            Having trouble with Spring Data? We’d love to help!.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
            Maven
            Gradle
            CLONE
          • HTTPS

            https://github.com/spring-projects/spring-data-elasticsearch.git

          • CLI

            gh repo clone spring-projects/spring-data-elasticsearch

          • sshUrl

            git@github.com:spring-projects/spring-data-elasticsearch.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link