feat: enhance Elasticsearch connector to handle missing index configuration

This commit is contained in:
Anish Sarkar 2025-10-12 10:10:19 +05:30
parent c3d249682f
commit 72e8d98f40
3 changed files with 12 additions and 14 deletions

View file

@ -150,10 +150,10 @@ export default function ElasticsearchConnectorPage() {
config.ELASTICSEARCH_API_KEY = values.ELASTICSEARCH_API_KEY;
}
if (values.indices?.trim()) {
const indicesArr = stringToArray(values.indices);
config.ELASTICSEARCH_INDEX = indicesArr.length === 1 ? indicesArr[0] : indicesArr;
}
const indicesInput = values.indices?.trim() ?? "";
const indicesArr = stringToArray(indicesInput);
config.ELASTICSEARCH_INDEX =
indicesArr.length === 0 ? "*" : indicesArr.length === 1 ? indicesArr[0] : indicesArr;
if (values.query && values.query !== "*") {
config.ELASTICSEARCH_QUERY = values.query;