DATAES-991 - Wrong value for TermVector(with_positions_offets_payloads).

Original PR: #564

(cherry picked from commit 6a6ead5e1ec866812f7bf44af77e587851402ad1)
This commit is contained in:
Peter-Josef Meisch 2020-12-04 08:10:41 +01:00
parent 1e6271edf2
commit 242cf7706b
No known key found for this signature in database
GPG Key ID: DE108246970C7708
2 changed files with 27 additions and 2 deletions

View File

@ -20,5 +20,5 @@ package org.springframework.data.elasticsearch.annotations;
* @since 4.0
*/
public enum TermVector {
none, no, yes, with_positions, with_offsets, with_positions_offsets, with_positions_payloads, with_positions_offets_payloads
none, no, yes, with_positions, with_offsets, with_positions_offsets, with_positions_payloads, with_positions_offsets_payloads
}

View File

@ -604,7 +604,16 @@ public class MappingBuilderTests extends MappingContextBaseTests {
assertThat(propertyMapping).doesNotContain("seqNoPrimaryTerm");
}
/**
@Test // DATAES-991
void shouldWriteCorrectTermVectorValues() {
IndexOperations indexOps = operations.indexOps(TermVectorFieldEntity.class);
indexOps.create();
indexOps.putMapping(indexOps.createMapping());
}
/**
* @author Xiao Yu
*/
@Setter
@ -1093,4 +1102,20 @@ public class MappingBuilderTests extends MappingContextBaseTests {
@Field(type = Object) private SeqNoPrimaryTerm seqNoPrimaryTerm;
}
@Data
@Document(indexName = "termvectors-test")
static class TermVectorFieldEntity {
@Id private String id;
@Field(type = FieldType.Text, termVector = TermVector.no) private String no;
@Field(type = FieldType.Text, termVector = TermVector.yes) private String yes;
@Field(type = FieldType.Text, termVector = TermVector.with_positions) private String with_positions;
@Field(type = FieldType.Text, termVector = TermVector.with_offsets) private String with_offsets;
@Field(type = FieldType.Text, termVector = TermVector.with_positions_offsets) private String with_positions_offsets;
@Field(type = FieldType.Text,
termVector = TermVector.with_positions_payloads) private String with_positions_payloads;
@Field(type = FieldType.Text,
termVector = TermVector.with_positions_offsets_payloads) private String with_positions_offsets_payloads;
}
}