Skip to content

Commit

Permalink
HSEARCH-3589 Fix an invalid write in RangeSearchPredicateIT
Browse files Browse the repository at this point in the history
One should not use field references from a different index when
indexing; it used to (incorrectly) work, but with the following changes
it won't work anymore.
  • Loading branch information
yrodiere committed May 6, 2020
1 parent fb403fb commit 31b773c
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -69,6 +69,7 @@ public class RangeSearchPredicateIT {
private IndexMapping indexMapping;
private StubMappingIndexManager indexManager;

private IndexMapping compatibleIndexMapping;
private StubMappingIndexManager compatibleIndexManager;

private RawFieldCompatibleIndexMapping rawFieldCompatibleIndexMapping;
Expand All @@ -91,7 +92,7 @@ public void setup() {
)
.withIndex(
COMPATIBLE_INDEX_NAME,
ctx -> new IndexMapping( ctx.getSchemaElement() ),
ctx -> this.compatibleIndexMapping = new IndexMapping( ctx.getSchemaElement() ),
indexManager -> this.compatibleIndexManager = indexManager
)
.withIndex(
Expand Down Expand Up @@ -1043,8 +1044,8 @@ private void initData() {

plan = compatibleIndexManager.createIndexingPlan();
plan.add( referenceProvider( COMPATIBLE_INDEX_DOCUMENT_1 ), document -> {
indexMapping.supportedFieldModels.forEach( f -> f.document1Value.write( document ) );
indexMapping.supportedFieldWithDslConverterModels.forEach( f -> f.document1Value.write( document ) );
compatibleIndexMapping.supportedFieldModels.forEach( f -> f.document1Value.write( document ) );
compatibleIndexMapping.supportedFieldWithDslConverterModels.forEach( f -> f.document1Value.write( document ) );
} );
plan.execute().join();

Expand Down

0 comments on commit 31b773c

Please sign in to comment.