spring-data-elasticsearch | Spring Data implementation for ElasticSearch | Application Framework library

 by   SpringDataElasticsearchDevs Java Version: Current License: No License

kandi X-RAY | spring-data-elasticsearch Summary

kandi X-RAY | spring-data-elasticsearch Summary

spring-data-elasticsearch is a Java library typically used in Server, Application Framework, Spring Boot, Spring applications. spring-data-elasticsearch has no bugs, it has no vulnerabilities, it has build file available and it has high support. You can download it from GitHub.

Note : This Project is moved to SpringSource Repository Spring-Data-Elasticsearch. Hence all the new changes will be pushed to new repository. BioMed Central Development Team.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              spring-data-elasticsearch has a highly active ecosystem.
              It has 63 star(s) with 25 fork(s). There are 14 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 9 open issues and 23 have been closed. On average issues are closed in 9 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 current.

            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 does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              spring-data-elasticsearch releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.

            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.
            • Create a mapping for the specified index type
            • Appends field annotation mapping
            • Checks if field is entity type
            • Recursively maps entities to an entity
            • Get a page of more like - like query results
            • Converts a search response into a pageable pageable
            • Performs bulk index
            • Prepares an index request
            • Build the native search query
            • Execute query
            • Perform a scan
            • Gets the target repository
            • Executes the query with the given query
            • Evaluates a count for a given search query
            • Queries a search
            • Creates the repository bean
            • Deletes all documents
            • Returns the version of the given entity
            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

            No Code Snippets are available at this moment for spring-data-elasticsearch.

            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

            You can download it from GitHub.
            You can use spring-data-elasticsearch like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the spring-data-elasticsearch component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

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

            Find more libraries
            CLONE
          • HTTPS

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

          • CLI

            gh repo clone SpringDataElasticsearchDevs/spring-data-elasticsearch

          • sshUrl

            git@github.com:SpringDataElasticsearchDevs/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