@@ -699,7 +699,7 @@ public enum PruningScenario {
699699 DEFAULT_PRUNING , // Default pruning configuration
700700 STRICT_PRUNING // Stricter pruning with higher thresholds
701701 }
702-
702+
703703 public enum QueryPruningScenario {
704704 PRUNE_FALSE_NO_CONFIG ,
705705 PRUNE_FALSE_WITH_CONFIG ,
@@ -710,8 +710,6 @@ public enum QueryPruningScenario {
710710 }
711711
712712 public enum IndexPruningScenario {
713- // PREVIOUS_VERSION_NO_PRUNING, //TODO(mromaios): This fails when combined with query pruning that overrides the index options,
714- // check.
715713 PRUNE_FALSE_NO_CONFIG ,
716714 PRUNE_TRUE_NO_CONFIG ,
717715 PRUNE_TRUE_WITH_CONFIG ,
@@ -765,8 +763,6 @@ private void withSearchExecutionContext(MapperService mapperService, CheckedCons
765763 }
766764 }
767765
768- // @TestLogging(value = "org.elasticsearch.index.mapper.vectors.SparseVectorFieldMapperTests:TRACE", reason = "debug")
769- // TODO(mromaios): remove
770766 public void testTypeQueryFinalizationPruningScenarios () throws Exception {
771767 for (int i = 0 ; i < 60 ; i ++) {
772768 runTestTypeQueryFinalization (randomFrom (IndexPruningScenario .values ()), randomFrom (QueryPruningScenario .values ()));
@@ -807,7 +803,6 @@ private XContentBuilder getIndexMapping(IndexPruningScenario pruningScenario) th
807803 case PRUNE_TRUE_NO_CONFIG -> fieldMapping (this ::mappingWithIndexOptionsOnlyPruneTrue );
808804 case PRUNE_TRUE_WITH_CONFIG -> fieldMapping (this ::minimalMappingWithExplicitIndexOptions );
809805 case PRUNE_NULL_NO_CONFIG -> fieldMapping (this ::minimalMapping );
810- // case PRUNE_NULL_NO_CONFIG, PREVIOUS_VERSION_NO_PRUNING -> fieldMapping(this::minimalMapping); //TODO(mromaios): revisit
811806 };
812807 }
813808
@@ -832,11 +827,6 @@ private PruningScenario getEffectivePruningScenario(
832827 IndexPruningScenario indexPruningScenario ,
833828 QueryPruningScenario queryPruningScenario
834829 ) {
835- // TODO(mromaios): Double check expected behavior with previous index version
836- // if (indexPruningScenario == IndexPruningScenario.PREVIOUS_VERSION_NO_PRUNING) {
837- // return PruningScenario.NO_PRUNING;
838- // }
839-
840830 PruningScenario effectivePruningScenario = null ;
841831 if (queryPruningScenario != null ) {
842832 effectivePruningScenario = switch (queryPruningScenario ) {
@@ -894,11 +884,8 @@ private Tuple<Boolean, TokenPruningConfig> getQueryPruneConfig(QueryPruningScena
894884 private void runTestTypeQueryFinalization (IndexPruningScenario indexPruningScenario , QueryPruningScenario queryPruningScenario )
895885 throws IOException {
896886 logger .debug ("Running test with indexPruningScenario: {}, queryPruningScenario: {}" , indexPruningScenario , queryPruningScenario );
897- IndexVersion indexVersion = getIndexVersionForTest (
898- // indexPruningScenario == IndexPruningScenario.PREVIOUS_VERSION_NO_PRUNING //TODO(mromaios): revisit, adding one specific UT
899- // for it for now
900- false
901- );
887+ IndexVersion indexVersion = IndexVersionUtils .randomVersionBetween (random (),
888+ SPARSE_VECTOR_PRUNING_INDEX_OPTIONS_SUPPORT , IndexVersion .current ());
902889 MapperService mapperService = createMapperService (indexVersion , getIndexMapping (indexPruningScenario ));
903890 logger .debug ("Index mapping: {}" , mapperService .documentMapper ().mappingSource ().toString ());
904891 Tuple <Boolean , TokenPruningConfig > queryPruneConfig = getQueryPruneConfig (queryPruningScenario );
0 commit comments