Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-3125

Allow native access to the Elasticsearch RestClient

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.10.0.CR1
    • Component/s: backend-elasticsearch
    • Labels:
      None

      Description

      Sometimes it is necessary to send a request to Elasticsearch for something that simply does not exist in Hibernate Search. Let's say an administration command, for example.

      Currently, the only option for users is to create their own client and use that. They cannot use our client.

      If we want to change that, we have three options:

      1. Expose our internal client, something like ElasticsearchBackend.getClient() returnin a org.elasticsearch.client.RestClient.
      2. Promote our own abstraction layer (org.hibernate.search.v6poc.backend.elasticsearch.client.impl.ElasticsearchClient, org.hibernate.search.v6poc.backend.elasticsearch.client.impl.ElasticsearchRequest, org.hibernate.search.v6poc.backend.elasticsearch.client.impl.ElasticsearchResponse, GSON, ...) to API and expose that.
      3. Create an additional abstraction layer on top of our own and expose that.

      I would much rather do 3., so that we are not stuck with the current technologies (Apache HTTP Client + GSON) forever just because they are exposed through our APIs. Especially since we already considered switching from GSON to something else ( HSEARCH-2817 Open , HSEARCH-2835 Open ) and from the Apache HTTP Client to something else.

      Note the "additional abstraction layer" could be very thin and very simple: it would be very close to our own abstraction layer, it would only be a matter of requring the body elements to be passed as strings instead of GSON's JsonObjet.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                yrodiere Yoann Rodière
                Reporter:
                yrodiere Yoann Rodière
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: