|
45 | 45 | import org.elasticsearch.search.suggest.completion.context.ContextMapping;
|
46 | 46 | import org.junit.jupiter.api.AfterEach;
|
47 | 47 | import org.junit.jupiter.api.BeforeEach;
|
| 48 | +import org.junit.jupiter.api.DisplayName; |
48 | 49 | import org.junit.jupiter.api.Test;
|
49 | 50 | import org.springframework.beans.factory.annotation.Autowired;
|
50 | 51 | import org.springframework.data.annotation.Id;
|
@@ -249,6 +250,16 @@ public void shouldUseCopyTo() {
|
249 | 250 | assertThat(fieldLastName.get("copy_to")).isEqualTo(copyToValue);
|
250 | 251 | }
|
251 | 252 |
|
| 253 | + @Test // DATAES-991 |
| 254 | + @DisplayName("should write correct TermVector values") |
| 255 | + void shouldWriteCorrectTermVectorValues() { |
| 256 | + |
| 257 | + IndexOperations indexOps = operations.indexOps(TermVectorFieldEntity.class); |
| 258 | + indexOps.create(); |
| 259 | + indexOps.putMapping(); |
| 260 | + |
| 261 | + } |
| 262 | + |
252 | 263 | /**
|
253 | 264 | * @author Xiao Yu
|
254 | 265 | */
|
@@ -621,4 +632,19 @@ static class RankFeatureEntity {
|
621 | 632 |
|
622 | 633 | @Field(type = FieldType.Rank_Features) private Map<String, Integer> topics;
|
623 | 634 | }
|
| 635 | + |
| 636 | + @Data |
| 637 | + @Document(indexName = "termvectors-test") |
| 638 | + static class TermVectorFieldEntity { |
| 639 | + @Id private String id; |
| 640 | + @Field(type = FieldType.Text, termVector = TermVector.no) private String no; |
| 641 | + @Field(type = FieldType.Text, termVector = TermVector.yes) private String yes; |
| 642 | + @Field(type = FieldType.Text, termVector = TermVector.with_positions) private String with_positions; |
| 643 | + @Field(type = FieldType.Text, termVector = TermVector.with_offsets) private String with_offsets; |
| 644 | + @Field(type = FieldType.Text, termVector = TermVector.with_positions_offsets) private String with_positions_offsets; |
| 645 | + @Field(type = FieldType.Text, |
| 646 | + termVector = TermVector.with_positions_payloads) private String with_positions_payloads; |
| 647 | + @Field(type = FieldType.Text, |
| 648 | + termVector = TermVector.with_positions_offsets_payloads) private String with_positions_offsets_payloads; |
| 649 | + } |
624 | 650 | }
|
0 commit comments