DATAES-639 - Add ignore_above mapping parameter support.
Original pull request: #304.
This commit is contained in:
committed by
Peter-Josef Meisch
parent
2712a1e021
commit
a9c3058bef
@@ -80,6 +80,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
* @author Don Wellington
|
||||
* @author Sascha Woo
|
||||
* @author Peter-Josef Meisch
|
||||
* @author Xiao Yu
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@ContextConfiguration("classpath:elasticsearch-template-test.xml")
|
||||
@@ -409,6 +410,35 @@ public class MappingBuilderTests extends MappingContextBaseTests {
|
||||
assertEquals(expected, mapping, false);
|
||||
}
|
||||
|
||||
@Test // DATAES-639
|
||||
public void shouldUseIgnoreAbove() throws IOException, JSONException {
|
||||
|
||||
// given
|
||||
String expected = "{\"ignore-above-type\":{\"properties\":{\"message\":{\"store\":false,\"type\":\"keyword\",\"ignore_above\":10}}}}";
|
||||
|
||||
// when
|
||||
String mapping = getMappingBuilder().buildPropertyMapping(IgnoreAboveEntity.class);
|
||||
|
||||
// then
|
||||
assertEquals(expected, mapping, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Xiao Yu
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Document(indexName = "ignore-above-index", type = "ignore-above-type")
|
||||
static class IgnoreAboveEntity {
|
||||
|
||||
@Id private String id;
|
||||
|
||||
@Field(type = FieldType.Keyword, ignoreAbove = 10) private String message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Peter-Josef Meisch
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user