public void testReaderMultiField() throws Exception {
ElasticSearchFieldsDefinitionReader reader = new ElasticSearchFieldsDefinitionReader(new File(getClass().getClassLoader()
.getResource("elasticsearch/elasticsearch_test_mappings_multifield.json").getFile()));
List<FieldAttributes> fields = reader.readFields();
assertEquals(2, fields.size());
FieldAttributes field1, field2;
if (fields.get(0).name().compareTo("test") == 0) {
field1 = fields.get(0);
field2 = fields.get(1);
} else {
field1 = fields.get(1);
field2 = fields.get(0);
}
// field 1
assertEquals("test", field1.name());
assertTrue(field1.analyzed());
assertTrue(field1.multiValued());
assertTrue(field1.indexed());
assertTrue(field1.store());
// field 2
assertEquals("test.facet", field2.name());
assertFalse(field2.analyzed());
assertTrue(field2.multiValued());
assertTrue(field2.indexed());