add tests for path mappings
This commit is contained in:
parent
911d800ff8
commit
04cfacec41
|
@ -42,12 +42,31 @@ public class PathXContentMapperTests {
|
|||
|
||||
assertThat(docMapper.mappers().indexName("first1"), notNullValue());
|
||||
assertThat(docMapper.mappers().indexName("name1.first1"), nullValue());
|
||||
assertThat(docMapper.mappers().indexName("last1"), notNullValue());
|
||||
assertThat(docMapper.mappers().indexName("last1"), nullValue());
|
||||
assertThat(docMapper.mappers().indexName("i_last_1"), notNullValue());
|
||||
assertThat(docMapper.mappers().indexName("name1.last1"), nullValue());
|
||||
assertThat(docMapper.mappers().indexName("name1.i_last_1"), nullValue());
|
||||
|
||||
assertThat(docMapper.mappers().indexName("first2"), nullValue());
|
||||
assertThat(docMapper.mappers().indexName("name2.first2"), notNullValue());
|
||||
assertThat(docMapper.mappers().indexName("last2"), nullValue());
|
||||
assertThat(docMapper.mappers().indexName("name2.last2"), notNullValue());
|
||||
assertThat(docMapper.mappers().indexName("i_last_2"), nullValue());
|
||||
assertThat(docMapper.mappers().indexName("name2.i_last_2"), notNullValue());
|
||||
assertThat(docMapper.mappers().indexName("name2.last2"), nullValue());
|
||||
|
||||
// test full name
|
||||
assertThat(docMapper.mappers().fullName("first1"), nullValue());
|
||||
assertThat(docMapper.mappers().fullName("name1.first1"), notNullValue());
|
||||
assertThat(docMapper.mappers().fullName("last1"), nullValue());
|
||||
assertThat(docMapper.mappers().fullName("i_last_1"), nullValue());
|
||||
assertThat(docMapper.mappers().fullName("name1.last1"), notNullValue());
|
||||
assertThat(docMapper.mappers().fullName("name1.i_last_1"), nullValue());
|
||||
|
||||
assertThat(docMapper.mappers().fullName("first2"), nullValue());
|
||||
assertThat(docMapper.mappers().fullName("name2.first2"), notNullValue());
|
||||
assertThat(docMapper.mappers().fullName("last2"), nullValue());
|
||||
assertThat(docMapper.mappers().fullName("i_last_2"), nullValue());
|
||||
assertThat(docMapper.mappers().fullName("name2.i_last_2"), nullValue());
|
||||
assertThat(docMapper.mappers().fullName("name2.last2"), notNullValue());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,18 +5,18 @@
|
|||
"type" : "object",
|
||||
"path" : "just_name",
|
||||
"properties" : {
|
||||
"first1" : {"type" : "string", "store" : "yes"},
|
||||
"last1" : {"type" : "string", "index" : "not_analyzed"}
|
||||
"first1" : {"type" : "string"},
|
||||
"last1" : {"type" : "string", "index_name" : "i_last_1"}
|
||||
}
|
||||
},
|
||||
"name2" : {
|
||||
"type" : "object",
|
||||
"path" : "full",
|
||||
"properties" : {
|
||||
"first2" : {"type" : "string", "store" : "yes"},
|
||||
"last2" : {"type" : "string", "index" : "not_analyzed"}
|
||||
"first2" : {"type" : "string"},
|
||||
"last2" : {"type" : "string", "index_name" : "i_last_2"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue