DATAES-85 - Add support to get elasticsearch mappings

This commit is contained in:
Mohsin Husen
2014-04-24 15:19:00 +01:00
parent 5ca0ed7ff1
commit 6b6f3beabe
3 changed files with 50 additions and 0 deletions

View File

@@ -109,4 +109,18 @@ public class SettingEntityRepositoryTest {
assertThat(entityList.size(), is(1));
assertThat(entityList.get(0).getEmail(), is(settingEntity1.getEmail()));
}
@Test
public void shouldGetMappingForGivenIndexAndType() {
//given
//delete , create and apply mapping in before method
//when
Map mapping = elasticsearchTemplate.getMapping(SettingEntity.class);
//then
Map properties = (Map) mapping.get("properties");
assertThat(mapping, is(notNullValue()));
assertThat(properties, is(notNullValue()));
assertThat(((String) ((Map) properties.get("email")).get("type")), is("string"));
assertThat((String) ((Map)properties.get("email")).get("analyzer"), is("emailAnalyzer"));
}
}