Skip to content

Commit ec0de9c

Browse files
committed
[Test] Use now full qualified names for fields
We were asking for short name fields but elasticsearch does not allow anymore using short names but full qualified names. ```java SearchResponse response = client().prepareSearch("test") .addField("content_type") .addField("name") .execute().get(); ``` We need to use now: ```java SearchResponse response = client().prepareSearch("test") .addField("file.content_type") .addField("file.name") .execute().get(); ``` Closes elastic#102.
1 parent 400910e commit ec0de9c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,12 @@ GET /test/person/_search
299299
"fields": [],
300300
"query": {
301301
"match": {
302-
"file": "king queen"
302+
"file.file": "king queen"
303303
}
304304
},
305305
"highlight": {
306306
"fields": {
307-
"file": {
307+
"file.file": {
308308
}
309309
}
310310
}
@@ -332,7 +332,7 @@ It gives back:
332332
"_id": "1",
333333
"_score": 0.13561106,
334334
"highlight": {
335-
"file": [
335+
"file.file": [
336336
"\"God Save the <em>Queen</em>\" (alternatively \"God Save the <em>King</em>\"\n"
337337
]
338338
}

src/test/java/org/elasticsearch/plugin/mapper/attachments/test/SimpleAttachmentIntegrationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ public void testContentTypeAndName() throws Exception {
141141
refresh();
142142

143143
SearchResponse response = client().prepareSearch("test")
144-
.addField("content_type")
145-
.addField("name")
144+
.addField("file.content_type")
145+
.addField("file.name")
146146
.execute().get();
147147
String contentType = response.getHits().getAt(0).getFields().get("file.content_type").getValue();
148148
String name = response.getHits().getAt(0).getFields().get("file.name").getValue();

0 commit comments

Comments
 (0)