Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

feat: accept Elasticsearch client as optional constructor argument #73

Merged
merged 2 commits into from
May 20, 2021

Conversation

justinusmenzel
Copy link
Contributor

Description of changes:
To support testing against a local ElasticSearch instance allow passing a Client instance to the ElasticSearchService constructor.
Should not be a breaking change.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

… allow passing ElasticSearch client instance
@@ -155,7 +161,8 @@ export class ElasticSearchService implements Search {
// eslint-disable-next-line class-methods-use-this
private async executeQuery(searchQuery: any): Promise<{ hits: any[]; total: number }> {
try {
const apiResponse = await ElasticSearch.search(searchQuery);
console.log(`Query: ${JSON.stringify(searchQuery, null, 2)}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no, that's nice for debugging but wasn't intended in the MR.

@carvantes carvantes self-requested a review May 20, 2021 16:09
Copy link
Contributor

@carvantes carvantes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@carvantes carvantes changed the title Feat: Adding ElasticSearch client instance as optional constructor argument to ElasticSearchService feat: accept Elasticsearch client as optional constructor argument May 20, 2021
@carvantes carvantes merged commit e1cd875 into awslabs:mainline May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants