File tree 2 files changed +35
-1
lines changed
main/java/org/elasticsearch/index/mapper/core
test/java/org/elasticsearch/index/mapper/binary 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ public static class Defaults extends AbstractFieldMapper.Defaults {
59
59
60
60
static {
61
61
FIELD_TYPE .setIndexed (false );
62
- FIELD_TYPE .setStored (true );
63
62
FIELD_TYPE .freeze ();
64
63
}
65
64
}
Original file line number Diff line number Diff line change
1
+ package org .elasticsearch .index .mapper .binary ;
2
+
3
+ import org .elasticsearch .common .xcontent .XContentFactory ;
4
+ import org .elasticsearch .index .mapper .DocumentMapper ;
5
+ import org .elasticsearch .index .mapper .FieldMapper ;
6
+ import org .elasticsearch .index .mapper .MapperTestUtils ;
7
+ import org .elasticsearch .index .mapper .core .BinaryFieldMapper ;
8
+ import org .elasticsearch .test .ElasticsearchTestCase ;
9
+ import org .junit .Test ;
10
+
11
+ import static org .hamcrest .Matchers .equalTo ;
12
+ import static org .hamcrest .Matchers .instanceOf ;
13
+
14
+ /**
15
+ */
16
+ public class BinaryMappingTests extends ElasticsearchTestCase {
17
+
18
+ @ Test
19
+ public void testDefaultMapping () throws Exception {
20
+ String mapping = XContentFactory .jsonBuilder ().startObject ().startObject ("type" )
21
+ .startObject ("properties" )
22
+ .startObject ("field" )
23
+ .field ("type" , "binary" )
24
+ .endObject ()
25
+ .endObject ()
26
+ .endObject ().endObject ().string ();
27
+
28
+ DocumentMapper mapper = MapperTestUtils .newParser ().parse (mapping );
29
+
30
+ FieldMapper fieldMapper = mapper .mappers ().smartNameFieldMapper ("field" );
31
+ assertThat (fieldMapper , instanceOf (BinaryFieldMapper .class ));
32
+ assertThat (fieldMapper .fieldType ().stored (), equalTo (false ));
33
+ }
34
+
35
+ }
You can’t perform that action at this time.
0 commit comments