Skip to content

Commit dc02812

Browse files
author
Jake Heimbouch
committed
Fixed tests that were failing by reverting the phrase index back to standard analyzed instead of not_analyzed. Also returned the input_time field back to phrases.json
1 parent d3cc8bd commit dc02812

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

src/test/java/org/nlpcn/es4sql/MainTestSuite.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ public static void setUp() throws Exception {
5151
deleteQuery(TEST_INDEX);
5252
loadBulk("src/test/resources/accounts.json");
5353
loadBulk("src/test/resources/online.json");
54+
loadBulk("src/test/resources/phrases.json");
5455

5556
prepareOdbcIndex();
5657
loadBulk("src/test/resources/odbc-date-formats.json");
57-
preparePhraseIndex();
58-
loadBulk("src/test/resources/phrases.json");
59-
6058

6159
searchDao = new SearchDao(client);
6260
System.out.println("Finished the setup process...");
@@ -137,25 +135,6 @@ public static void prepareOdbcIndex(){
137135
client.admin().indices().preparePutMapping(TEST_INDEX).setType("odbc").setSource(dataMapping).execute().actionGet();
138136
}
139137

140-
public static void preparePhraseIndex(){
141-
String dataMapping = "{\n" +
142-
"\t\"phrase\" :{\n" +
143-
"\t\t\"properties\":{\n" +
144-
"\t\t\t\"insert_time\":{\n" +
145-
"\t\t\t\t\"type\":\"date\",\n" +
146-
"\t\t\t\t\"format\": \"{'ts' ''yyyy-MM-dd HH:mm:ss.SSS''}\"\n" +
147-
"\t\t\t},\n" +
148-
"\t\"phrase\":{\n" +
149-
"\t\"type\":\"string\",\n" +
150-
"\t\"index\":\"not_analyzed\"\n" +
151-
"\t}\n" +
152-
"\t}\n" +
153-
"\t}\n" +
154-
"}";
155-
156-
client.admin().indices().preparePutMapping(TEST_INDEX).setType("phrase").setSource(dataMapping).execute().actionGet();
157-
}
158-
159138
public static SearchDao getSearchDao() {
160139
return searchDao;
161140
}

src/test/resources/phrases.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{"index":{"_type": "phrase"}}
22
{"phrase": "quick fox"}
33
{"index":{"_type": "phrase"}}
4-
{"phrase": "quick fox here"}
4+
{"phrase": "quick fox here", "insert_time":"2014-08-19T07:09:13.434Z" }
55
{"index":{"_type": "phrase"}}
66
{"phrase": "brown fox"}
77
{"index":{"_type": "phrase"}}
8-
{"phrase": "fox brown"}
8+
{"phrase": "fox brown", "insert_time":"2014-08-19T07:09:13.434Z"}

0 commit comments

Comments
 (0)