Is it possible use _update_by_query in spring elasticsearch - spring

is it possible using Spring Elasticsearch send
"_update_by_query" api method

No, the Update by Query API is not implemented into Spring Data Elasticsearch, but nothing prevents you from using the TransportClient you feed into ElasticsearchTemplate for calling that endpoint.

Related

Use GraphQL with in existing spring boot rest api

We have few existing rest apis written in spring boot to fetch different data in our project? Now we are exploring options to use GraphQL. But we don't want rest endpoints & response to change since it is being consumed by many UI/backend applications. Can anyone suggest proper way to use GraphQL within existing API without changing rest endpoints and Response type?

Can Spring Data Elastic Search connect to a proxy REST service that connects to Elastic Search?

My company has Elastic Search behind the REST endpoints /search and /count, but it hides the cluster nodes from access.
I could call those REST endpoints through Native DSL queries, but I don't want to create a lot of the boilerplate code that comes with creating queries and mapping responses, which is why I would like to use Spring Data Elastic Search to do a lot of that for me. I would like to know if it is possible to connect to Spring Data Elastic Search to an ES instance through a proxy REST endpoint, but based on the docs, it seems like Spring Data ES can only connect to the ES Instance. Has anyone else had this kind of need?
Spring Data Elasticsearch operates upon an Elasticsearch client that is connected to a single Elasticsearch node or a cluster.
You link to the documentation, Chapter Elasticsearch Clients. In this chapter, in the section Client Configuration you find the description how to configure a proxy:
ClientConfiguration clientConfiguration = ClientConfiguration.builder()
.connectedTo("localhost:9200", "localhost:9291")
.withProxy("localhost:8888")
.build();

How to index bulk json file to elasticsearch in spring boot

I have a JSON file and I want to know how to index it to the elasticsearch in spring boot
You could use the Spring Data Elasticsearch component and index the JSON using the bulk API.
You have to convert the JSON into a relevant Java Object using libraries like GSon.
It uses the Elasticsearch High-level REST Client and the _bulk underlying.

How to store a JSON object in couchbase using springboot

I am new to spring boot and I am developing a simple spring boot API to store data to a couchbase db. Storing JSON objects have different formats.Is there any suitable method to achieve this?
Couchbase has given support for the JAVA SDK's that can help you easily integrate the couchbase api's and access the couchbase server to perform CRUD operation's here is the tutorial available : JAVA SDK
And also please take a look at this blog couchbase with Spring Boot sample example

Using SolrJ REST-API to query data in a Spring Application

I have solr running at http://localhost:8983/solr/ . I have a Spring MVC app running at http://localhost:8080/login.jsp .
I would like to be able to Query only the solr data from my spring app. What is the best way to go about this? Does someone have a simple running example?
Integrate Solr with Spring using SolrJ.
SolrJ is the Solr Java Client Library which will allow you to query Solr and get back the results in java objects which you can use as Model objects with Spring MVC.
You can easily create a Repository which interacts with Solr using Solrj.
Also, secure the Solr Collections so that no one can access Solr from direct URL without authentication.
The Solrj Client with the Spring MVC app can query SOlr with Authentication.
You can also use spring-data-solr to do so. It should integrate quite nicely into an existing spring MVC application.

Resources