|
58 | 58 | import org.elasticsearch.test.VersionUtils;
|
59 | 59 | import org.elasticsearch.threadpool.ThreadPool;
|
60 | 60 | import org.elasticsearch.threadpool.ThreadPoolModule;
|
61 |
| -import org.junit.*; |
| 61 | +import org.junit.After; |
| 62 | +import org.junit.AfterClass; |
| 63 | +import org.junit.Before; |
| 64 | +import org.junit.BeforeClass; |
| 65 | +import org.junit.Ignore; |
| 66 | +import org.junit.Test; |
62 | 67 |
|
63 | 68 | import java.io.IOException;
|
64 | 69 |
|
65 |
| -import static org.hamcrest.Matchers.*; |
| 70 | +import static org.hamcrest.Matchers.equalTo; |
| 71 | +import static org.hamcrest.Matchers.instanceOf; |
| 72 | +import static org.hamcrest.Matchers.is; |
| 73 | +import static org.hamcrest.Matchers.notNullValue; |
| 74 | +import static org.hamcrest.Matchers.nullValue; |
66 | 75 |
|
67 | 76 | @Ignore
|
68 | 77 | public abstract class BaseQueryTestCase<QB extends AbstractQueryBuilder<QB>> extends ElasticsearchTestCase {
|
@@ -135,9 +144,11 @@ protected void configure() {
|
135 | 144 | DOUBLE_FIELD_NAME, "type=double",
|
136 | 145 | BOOLEAN_FIELD_NAME, "type=boolean",
|
137 | 146 | STRING_FIELD_NAME, "type=string",
|
138 |
| - OBJECT_FIELD_NAME, "type=object", |
139 |
| - OBJECT_FIELD_NAME+"."+DATE_FIELD_NAME, "type=date", |
140 |
| - OBJECT_FIELD_NAME+"."+INT_FIELD_NAME, "type=integer").string()), false, false); |
| 147 | + OBJECT_FIELD_NAME, "type=object" |
| 148 | + ).string()), false, false); |
| 149 | + // also add mappings for two inner field in the object field |
| 150 | + mapperService.merge(type, new CompressedXContent("{\"properties\":{\""+OBJECT_FIELD_NAME+"\":{\"type\":\"object\"," |
| 151 | + + "\"properties\":{\""+DATE_FIELD_NAME+"\":{\"type\":\"date\"},\""+INT_FIELD_NAME+"\":{\"type\":\"integer\"}}}}}"), false, false); |
141 | 152 | currentTypes[i] = type;
|
142 | 153 | }
|
143 | 154 | namedWriteableRegistry = injector.getInstance(NamedWriteableRegistry.class);
|
|
0 commit comments