Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Pluggable client #78

Open
wants to merge 16 commits into
base: 8.x-7.x
Choose a base branch
from

Conversation

mgalang
Copy link
Contributor

@mgalang mgalang commented Jul 2, 2021

Problem/Motivation

Elasticsearch helper client currently has a somewhat hard dependency with the Elasticsearch PHP client. This works ok for most cases, but there has been cases where Elasticsearch is behind a proxy API, and the API has a different request format.

There has also been proposal for expanding the capabilities of the module to allow the use other search backend engines in the future. This would be a first step towards that direction also.

Proposed solution

  • Refactor the client as a service
  • Deprecate the old client builder
  • Create a default client, which uses the Elasticsearch PHP client
  • Add a client interface which would enforces the methods and attributes of existing and future clients
  • Updated Index base class to use the new client and interface

I have added an example index that uses a custom client as an example of how to use this.

Possible issues

  • This would create breaking changes for projects and modules that calls the client directly, or have implemented custom index methods

@mgalang mgalang marked this pull request as ready for review July 2, 2021 12:54
@mgalang mgalang requested review from maijs and mitrpaka July 2, 2021 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant