Skip to content

Conversation

jiafu1115
Copy link

Each vector operation (such as ElasticsearchVectorStore#doAdd)calls ElasticsearchIndicesClient#exists via an HTTP request to check whether the index exists. This redundant check wastes performance, so a small refactor was performed to eliminate it.

Signed-off-by: stroller <fujian1115@gmail.com>
}
return;
}
if (!indexExists()) {
Copy link
Member

Choose a reason for hiding this comment

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

Given the indexExists() is called here as well, perhaps we can optimise this for reusability in the above logic to throw exception when index doesn't exist.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd move line 339 higher up and reuse it here also, it will be called anyway

Copy link
Author

Choose a reason for hiding this comment

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

@ilayaperumalg @deejay1 thanks for your review and comments. I just do one small refactor to simple the code.
PTAL
Thanks!

@ilayaperumalg
Copy link
Member

@jiafu1115 Thanks for the PR!

Signed-off-by: stroller <fujian1115@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants