Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ The only difference is that this new marker has a second range of two dots after
- https://github.com/eclipse-sirius/sirius-web/issues/6101[#6101] [sirius-web] Allow more control of the redirect URL in the new project card
- https://github.com/eclipse-sirius/sirius-web/issues/5909[#5909] [graphql] Improve the customization of GraphQL error messages
- https://github.com/eclipse-sirius/sirius-web/issues/5947[#5947] [sirius-web] Add support for publishing libraries from non-main editing contexts.
- https://github.com/eclipse-sirius/sirius-web/issues/6044[#6044] [sirius-web] Properly catch `ElasticsearchException`



Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2025 Obeo.
* Copyright (c) 2025, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand All @@ -23,6 +23,7 @@
import org.springframework.stereotype.Service;

import co.elastic.clients.elasticsearch.ElasticsearchClient;
import co.elastic.clients.elasticsearch._types.ElasticsearchException;

/**
* The default implementation that creates the index for an editing context.
Expand Down Expand Up @@ -65,7 +66,7 @@ public boolean createIndex(String editingContextId) {
textPropertyBuilder.index(false)))));
indexCreated = true;
}
} catch (IOException exception) {
} catch (IOException | ElasticsearchException exception) {
this.logger.warn("An error occurred while creating the index", exception);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2025 Obeo.
* Copyright (c) 2025, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand All @@ -22,6 +22,7 @@
import org.springframework.stereotype.Service;

import co.elastic.clients.elasticsearch.ElasticsearchClient;
import co.elastic.clients.elasticsearch._types.ElasticsearchException;

/**
* The default implementation that deletes the index for an editing context.
Expand Down Expand Up @@ -49,7 +50,7 @@ public boolean deleteIndex(String editingContextId) {
elasticSearchClient.indices().delete(deleteIndexRequest -> deleteIndexRequest.index(DefaultIndexCreationService.EDITING_CONTEXT_INDEX_NAME_PREFIX + editingContextId));
indexDeleted = true;
}
} catch (IOException exception) {
} catch (IOException | ElasticsearchException exception) {
this.logger.warn("An error occurred while deleting the index", exception);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2025 Obeo.
* Copyright (c) 2025, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand All @@ -26,6 +26,7 @@
import org.springframework.stereotype.Service;

import co.elastic.clients.elasticsearch.ElasticsearchClient;
import co.elastic.clients.elasticsearch._types.ElasticsearchException;
import co.elastic.clients.elasticsearch.core.SearchResponse;
import co.elastic.clients.elasticsearch.core.search.Hit;

Expand Down Expand Up @@ -67,7 +68,7 @@ public List<IIndexEntry> search(String query) {
.allowLeadingWildcard(true)))
, IIndexEntry.class);
result = response.hits().hits().stream().map(Hit::source).toList();
} catch (IOException exception) {
} catch (IOException | ElasticsearchException exception) {
this.logger.warn("An error occurred while querying indices", exception);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024, 2025 Obeo.
* Copyright (c) 2024, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -270,6 +270,15 @@ public void givenQueryWhenObjectsAreSearchedInProjectsOmniboxThenObjectsAreRetur
assertThat(complexQueryObjectLabels).isNotEmpty()
.anyMatch(label -> label.contains("org.eclipse.sirius.web.tests.data"))
.anyMatch(label -> label.contains("Success"));

Map<String, Object> queryWithSyntaxErrorVariables = Map.of(
"query", "name::Comp*"
);

var queryWithSyntaxErrorResult = this.projectsOmniboxSearchQueryRunner.run(queryWithSyntaxErrorVariables);
assertThat(queryWithSyntaxErrorResult.errors()).isEmpty();
List<String> queryWithSyntaxErrorObjectLabels = JsonPath.read(queryWithSyntaxErrorResult.data(), "$.data.viewer.projectsOmniboxSearch.edges[*].node.label");
assertThat(queryWithSyntaxErrorObjectLabels).isEmpty();
}

}
Loading