Skip to content

Commit

Permalink
comment out mixed test case
Browse files Browse the repository at this point in the history
  • Loading branch information
will-hwang committed Jan 8, 2025
1 parent 47f0a8c commit e9f2684
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ public void testBatchIngestion_SparseEncodingProcessor_E2EFlow() throws Exceptio
validateDocCountAndInfo(indexName, 5, () -> getDocById(indexName, "4"), EMBEDDING_FIELD_NAME, Map.class);
break;
case MIXED:
sparseModelId = TestUtils.getModelId(getIngestionPipeline(SPARSE_PIPELINE), SPARSE_ENCODING_PROCESSOR);
loadModel(sparseModelId);
List<Map<String, String>> docsForMixed = prepareDataForBulkIngestion(5, 5);
bulkAddDocuments(indexName, TEXT_FIELD_NAME, SPARSE_PIPELINE, docsForMixed, 3);
validateDocCountAndInfo(indexName, 10, () -> getDocById(indexName, "9"), EMBEDDING_FIELD_NAME, Map.class);
// sparseModelId = TestUtils.getModelId(getIngestionPipeline(SPARSE_PIPELINE), SPARSE_ENCODING_PROCESSOR);
// loadModel(sparseModelId);
// List<Map<String, String>> docsForMixed = prepareDataForBulkIngestion(5, 5);
// bulkAddDocuments(indexName, TEXT_FIELD_NAME, SPARSE_PIPELINE, docsForMixed, 3);
// validateDocCountAndInfo(indexName, 10, () -> getDocById(indexName, "9"), EMBEDDING_FIELD_NAME, Map.class);
break;
case UPGRADED:
try {
sparseModelId = TestUtils.getModelId(getIngestionPipeline(SPARSE_PIPELINE), SPARSE_ENCODING_PROCESSOR);
loadModel(sparseModelId);
List<Map<String, String>> docsForUpgraded = prepareDataForBulkIngestion(10, 5);
bulkAddDocuments(indexName, TEXT_FIELD_NAME, SPARSE_PIPELINE, docsForUpgraded, 2);
validateDocCountAndInfo(indexName, 15, () -> getDocById(indexName, "14"), EMBEDDING_FIELD_NAME, Map.class);
List<Map<String, String>> docsForUpgraded = prepareDataForBulkIngestion(5, 5);
bulkAddDocuments(indexName, TEXT_FIELD_NAME, SPARSE_PIPELINE, docsForUpgraded, 3);
validateDocCountAndInfo(indexName, 10, () -> getDocById(indexName, "9"), EMBEDDING_FIELD_NAME, Map.class);
} finally {
wipeOfTestResources(indexName, SPARSE_PIPELINE, sparseModelId, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,26 @@ public void testNormalizationProcessor_whenIndexWithMultipleShards_E2EFlow() thr
);
break;
case MIXED:
modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_EMBEDDING_PROCESSOR);
int totalDocsCountMixed;
if (isFirstMixedRound()) {
totalDocsCountMixed = NUM_DOCS_PER_ROUND;
HybridQueryBuilder hybridQueryBuilder = getQueryBuilder(modelId, null, null, null);
QueryBuilder rescorer = QueryBuilders.matchQuery(TEST_FIELD, RESCORE_QUERY).boost(0.3f);
validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, hybridQueryBuilder, rescorer);
addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_MIXED, null, null);
} else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// HybridQueryBuilder hybridQueryBuilder = getQueryBuilder(modelId, null, null, null);
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, hybridQueryBuilder, null);
}
// modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_EMBEDDING_PROCESSOR);
// int totalDocsCountMixed;
// if (isFirstMixedRound()) {
// totalDocsCountMixed = NUM_DOCS_PER_ROUND;
// HybridQueryBuilder hybridQueryBuilder = getQueryBuilder(modelId, null, null, null);
// QueryBuilder rescorer = QueryBuilders.matchQuery(TEST_FIELD, RESCORE_QUERY).boost(0.3f);
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, hybridQueryBuilder, rescorer);
// addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_MIXED, null, null);
// } else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// HybridQueryBuilder hybridQueryBuilder = getQueryBuilder(modelId, null, null, null);
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, hybridQueryBuilder, null);
// }
break;
case UPGRADED:
try {
modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_EMBEDDING_PROCESSOR);
int totalDocsCountUpgraded = 3 * NUM_DOCS_PER_ROUND;
int totalDocsCountUpgraded = 1 * NUM_DOCS_PER_ROUND;
loadModel(modelId);
addDocument(getIndexNameForTest(), "2", TEST_FIELD, TEXT_UPGRADED, null, null);
addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_UPGRADED, null, null);
HybridQueryBuilder hybridQueryBuilder = getQueryBuilder(modelId, null, null, null);
QueryBuilder rescorer = QueryBuilders.matchQuery(TEST_FIELD, RESCORE_QUERY).boost(0.3f);
validateTestIndexOnUpgrade(totalDocsCountUpgraded, modelId, hybridQueryBuilder, rescorer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,26 @@ public void testHybridQueryWithRescore_whenIndexWithMultipleShards_E2EFlow() thr
);
break;
case MIXED:
modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_EMBEDDING_PROCESSOR);
int totalDocsCountMixed;
if (isFirstMixedRound()) {
totalDocsCountMixed = NUM_DOCS_PER_ROUND;
HybridQueryBuilder hybridQueryBuilder = getQueryBuilder(modelId, null, null);
QueryBuilder rescorer = QueryBuilders.matchQuery(TEST_FIELD, RESCORE_QUERY).boost(0.3f);
validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, hybridQueryBuilder, rescorer);
addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_MIXED, null, null);
} else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// HybridQueryBuilder hybridQueryBuilder = getQueryBuilder(modelId, null, null);
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, hybridQueryBuilder, null);
}
// modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_EMBEDDING_PROCESSOR);
// int totalDocsCountMixed;
// if (isFirstMixedRound()) {
// totalDocsCountMixed = NUM_DOCS_PER_ROUND;
// HybridQueryBuilder hybridQueryBuilder = getQueryBuilder(modelId, null, null);
// QueryBuilder rescorer = QueryBuilders.matchQuery(TEST_FIELD, RESCORE_QUERY).boost(0.3f);
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, hybridQueryBuilder, rescorer);
// addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_MIXED, null, null);
// } else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// HybridQueryBuilder hybridQueryBuilder = getQueryBuilder(modelId, null, null);
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, hybridQueryBuilder, null);
// }
break;
case UPGRADED:
try {
modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_EMBEDDING_PROCESSOR);
int totalDocsCountUpgraded = 3 * NUM_DOCS_PER_ROUND;
int totalDocsCountUpgraded = 1 * NUM_DOCS_PER_ROUND;
loadModel(modelId);
addDocument(getIndexNameForTest(), "2", TEST_FIELD, TEXT_UPGRADED, null, null);
addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_UPGRADED, null, null);
HybridQueryBuilder hybridQueryBuilder = getQueryBuilder(modelId, null, null);
QueryBuilder rescorer = QueryBuilders.matchQuery(TEST_FIELD, RESCORE_QUERY).boost(0.3f);
validateTestIndexOnUpgrade(totalDocsCountUpgraded, modelId, hybridQueryBuilder, rescorer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@ public void testKnnRadialSearch_E2EFlow() throws Exception {
addDocument(getIndexNameForTest(), "0", TEST_FIELD, TEXT, TEST_IMAGE_FIELD, TEST_IMAGE_TEXT);
break;
case MIXED:
modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_IMAGE_EMBEDDING_PROCESSOR);
int totalDocsCountMixed;
if (isFirstMixedRound()) {
totalDocsCountMixed = NUM_DOCS_PER_ROUND;
validateIndexQueryOnUpgrade(totalDocsCountMixed, modelId, TEXT, TEST_IMAGE_TEXT);
addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_MIXED, TEST_IMAGE_FIELD, TEST_IMAGE_TEXT_MIXED);
} else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// validateIndexQueryOnUpgrade(totalDocsCountMixed, modelId, TEXT_MIXED, TEST_IMAGE_TEXT_MIXED);
}
// modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_IMAGE_EMBEDDING_PROCESSOR);
// int totalDocsCountMixed;
// if (isFirstMixedRound()) {
// totalDocsCountMixed = NUM_DOCS_PER_ROUND;
// validateIndexQueryOnUpgrade(totalDocsCountMixed, modelId, TEXT, TEST_IMAGE_TEXT);
// addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_MIXED, TEST_IMAGE_FIELD, TEST_IMAGE_TEXT_MIXED);
// } else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// validateIndexQueryOnUpgrade(totalDocsCountMixed, modelId, TEXT_MIXED, TEST_IMAGE_TEXT_MIXED);
// }
break;
case UPGRADED:
try {
modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_IMAGE_EMBEDDING_PROCESSOR);
int totalDocsCountUpgraded = 3 * NUM_DOCS_PER_ROUND;
int totalDocsCountUpgraded = 1 * NUM_DOCS_PER_ROUND;
loadModel(modelId);
addDocument(getIndexNameForTest(), "2", TEST_FIELD, TEXT_UPGRADED, TEST_IMAGE_FIELD, TEST_IMAGE_TEXT_UPGRADED);
addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_UPGRADED, TEST_IMAGE_FIELD, TEST_IMAGE_TEXT_UPGRADED);
validateIndexQueryOnUpgrade(totalDocsCountUpgraded, modelId, TEXT_UPGRADED, TEST_IMAGE_TEXT_UPGRADED);
} finally {
wipeOfTestResources(getIndexNameForTest(), PIPELINE_NAME, modelId, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ public void testTextImageEmbeddingProcessor_E2EFlow() throws Exception {
addDocument(getIndexNameForTest(), "0", TEST_FIELD, TEXT, TEST_IMAGE_FIELD, TEST_IMAGE_TEXT);
break;
case MIXED:
modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_IMAGE_EMBEDDING_PROCESSOR);
int totalDocsCountMixed;
if (isFirstMixedRound()) {
totalDocsCountMixed = NUM_DOCS_PER_ROUND;
validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, TEXT, TEST_IMAGE_TEXT);
addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_MIXED, TEST_IMAGE_FIELD, TEST_IMAGE_TEXT_MIXED);
} else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, TEXT_MIXED, TEST_IMAGE_TEXT_MIXED);
}
// modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_IMAGE_EMBEDDING_PROCESSOR);
// int totalDocsCountMixed;
// if (isFirstMixedRound()) {
// totalDocsCountMixed = NUM_DOCS_PER_ROUND;
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, TEXT, TEST_IMAGE_TEXT);
// addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_MIXED, TEST_IMAGE_FIELD, TEST_IMAGE_TEXT_MIXED);
// } else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId, TEXT_MIXED, TEST_IMAGE_TEXT_MIXED);
// }
break;
case UPGRADED:
try {
modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_IMAGE_EMBEDDING_PROCESSOR);
int totalDocsCountUpgraded = 3 * NUM_DOCS_PER_ROUND;
int totalDocsCountUpgraded = 1 * NUM_DOCS_PER_ROUND;
loadModel(modelId);
addDocument(getIndexNameForTest(), "2", TEST_FIELD, TEXT_UPGRADED, TEST_IMAGE_FIELD, TEST_IMAGE_TEXT_UPGRADED);
addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_UPGRADED, TEST_IMAGE_FIELD, TEST_IMAGE_TEXT_UPGRADED);
validateTestIndexOnUpgrade(totalDocsCountUpgraded, modelId, TEXT_UPGRADED, TEST_IMAGE_TEXT_UPGRADED);
} finally {
wipeOfTestResources(getIndexNameForTest(), PIPELINE_NAME, modelId, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,32 +59,32 @@ public void testSparseEncodingProcessor_E2EFlow() throws Exception {
);
break;
case MIXED:
modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), SPARSE_ENCODING_PROCESSOR);
int totalDocsCountMixed;
if (isFirstMixedRound()) {
totalDocsCountMixed = NUM_DOCS_PER_ROUND;
validateTestIndexOnUpgrade(totalDocsCountMixed, modelId);
addSparseEncodingDoc(
getIndexNameForTest(),
"1",
List.of(TEST_SPARSE_ENCODING_FIELD),
List.of(testRankFeaturesDoc2),
List.of(TEST_TEXT_FIELD),
List.of(TEXT_MIXED)
);
} else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId);
}
// modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), SPARSE_ENCODING_PROCESSOR);
// int totalDocsCountMixed;
// if (isFirstMixedRound()) {
// totalDocsCountMixed = NUM_DOCS_PER_ROUND;
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId);
// addSparseEncodingDoc(
// getIndexNameForTest(),
// "1",
// List.of(TEST_SPARSE_ENCODING_FIELD),
// List.of(testRankFeaturesDoc2),
// List.of(TEST_TEXT_FIELD),
// List.of(TEXT_MIXED)
// );
// } else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId);
// }
break;
case UPGRADED:
try {
modelId = getModelId(getIngestionPipeline(PIPELINE_NAME), SPARSE_ENCODING_PROCESSOR);
int totalDocsCountUpgraded = 3 * NUM_DOCS_PER_ROUND;
int totalDocsCountUpgraded = 1 * NUM_DOCS_PER_ROUND;
loadModel(modelId);
addSparseEncodingDoc(
getIndexNameForTest(),
"2",
"1",
List.of(TEST_SPARSE_ENCODING_FIELD),
List.of(testRankFeaturesDoc3),
List.of(TEST_TEXT_FIELD),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,24 @@ public void testSemanticSearch_E2EFlow() throws Exception {
addDocument(getIndexNameForTest(), "0", TEST_FIELD, TEXT, null, null);
break;
case MIXED:
String modelId2 = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_EMBEDDING_PROCESSOR);
int totalDocsCountMixed;
if (isFirstMixedRound()) {
totalDocsCountMixed = NUM_DOCS_PER_ROUND;
validateTestIndexOnUpgrade(totalDocsCountMixed, modelId2, TEXT);
addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_MIXED, null, null);
} else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId2, TEXT_MIXED);
}
// String modelId2 = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_EMBEDDING_PROCESSOR);
// int totalDocsCountMixed;
// if (isFirstMixedRound()) {
// totalDocsCountMixed = NUM_DOCS_PER_ROUND;
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId2, TEXT);
// addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_MIXED, null, null);
// } else {
// totalDocsCountMixed = 2 * NUM_DOCS_PER_ROUND;
// validateTestIndexOnUpgrade(totalDocsCountMixed, modelId2, TEXT_MIXED);
// }
break;
case UPGRADED:
String modelId3 = null;
try {
modelId3 = getModelId(getIngestionPipeline(PIPELINE_NAME), TEXT_EMBEDDING_PROCESSOR);
int totalDocsCountUpgraded = 3 * NUM_DOCS_PER_ROUND;
int totalDocsCountUpgraded = 1 * NUM_DOCS_PER_ROUND;
loadModel(modelId3);
addDocument(getIndexNameForTest(), "2", TEST_FIELD, TEXT_UPGRADED, null, null);
addDocument(getIndexNameForTest(), "1", TEST_FIELD, TEXT_UPGRADED, null, null);
validateTestIndexOnUpgrade(totalDocsCountUpgraded, modelId3, TEXT_UPGRADED);
} finally {
wipeOfTestResources(getIndexNameForTest(), PIPELINE_NAME, modelId3, null);
Expand Down
Loading

0 comments on commit e9f2684

Please sign in to comment.