Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Adding fix for test knn index replication integ test failure #1501

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open
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 @@ -26,6 +26,10 @@ import org.opensearch.client.indices.CreateIndexRequest
import org.opensearch.common.xcontent.XContentType
import org.opensearch.common.CheckedRunnable
import org.opensearch.test.OpenSearchTestCase.assertBusy
import org.opensearch.action.admin.indices.settings.get.GetSettingsRequest
import org.opensearch.action.admin.indices.settings.put.UpdateSettingsRequest
import org.opensearch.index.IndexSettings
import org.opensearch.common.settings.Settings
import org.opensearch.client.indices.PutMappingRequest
import org.junit.Assert
import java.util.Locale
Expand Down Expand Up @@ -94,11 +98,14 @@ class BasicReplicationIT : MultiClusterRestTestCase() {
val leaderIndexName = randomAlphaOfLength(10).toLowerCase(Locale.ROOT)
val followerIndexNameInitial = randomAlphaOfLength(10).toLowerCase(Locale.ROOT)
val followerIndexName = randomAlphaOfLength(10).toLowerCase(Locale.ROOT)
val settings: Settings = Settings.builder()
.put("index.knn", true)
.build()
val KNN_INDEX_MAPPING = "{\"properties\":{\"my_vector1\":{\"type\":\"knn_vector\",\"dimension\":2},\"my_vector2\":{\"type\":\"knn_vector\",\"dimension\":4}}}"
// create knn-index on leader cluster
try {
val createIndexResponse = leaderClient.indices().create(
CreateIndexRequest(leaderIndexName)
CreateIndexRequest(leaderIndexName).settings(settings)
.mapping(KNN_INDEX_MAPPING, XContentType.JSON), RequestOptions.DEFAULT
)
assertThat(createIndexResponse.isAcknowledged).isTrue()
Expand Down
Loading