Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ public SearchAccessor getSearchAccessor() {

private SearchAccessor createSearchAccessorForServerlessCollection(final PluginComponentRefresher clientRefresher) {
if (Objects.isNull(openSearchSourceConfiguration.getSearchConfiguration().getSearchContextType())) {
LOG.info("Configured with AOS serverless flag as true, defaulting to search_context_type as 'none', which uses search_after");
LOG.info("Configured with AOS serverless flag as true, defaulting to search_context_type as 'point_in_time'");
return new OpenSearchAccessor(clientRefresher,
SearchContextType.NONE);
SearchContextType.POINT_IN_TIME);
} else {
if ( SearchContextType.SCROLL.equals(openSearchSourceConfiguration.getSearchConfiguration().getSearchContextType())) {
throw new InvalidPluginConfigurationException("A search_context_type of scroll is not supported for serverless collections");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void search_context_type_set_to_none_uses_that_search_context_regardless_of_vers
}

@Test
void serverless_flag_true_defaults_to_search_context_type_none() {
void serverless_flag_true_defaults_to_search_context_type_point_in_time() {

final AwsAuthenticationConfiguration awsAuthenticationConfiguration = mock(AwsAuthenticationConfiguration.class);
when(awsAuthenticationConfiguration.isServerlessCollection()).thenReturn(true);
Expand All @@ -222,7 +222,7 @@ void serverless_flag_true_defaults_to_search_context_type_none() {
final SearchAccessor searchAccessor = createObjectUnderTest().getSearchAccessor();

assertThat(searchAccessor, notNullValue());
assertThat(searchAccessor.getSearchContextType(), equalTo(SearchContextType.NONE));
assertThat(searchAccessor.getSearchContextType(), equalTo(SearchContextType.POINT_IN_TIME));
verifyNoInteractions(pluginConfigObservable);
}

Expand All @@ -244,7 +244,7 @@ void serverless_flag_true_throws_InvalidPluginConfiguration_if_search_context_ty
}

@ParameterizedTest
@ValueSource(strings = {"NONE"})
@ValueSource(strings = {"NONE", "POINT_IN_TIME"})
void serverless_flag_true_uses_search_context_type_from_config(final String searchContextType) {

final AwsAuthenticationConfiguration awsAuthenticationConfiguration = mock(AwsAuthenticationConfiguration.class);
Expand Down
Loading