[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 #102.
This commit is contained in:
parent
400910e53e
commit
ec0de9c57d
|
@ -299,12 +299,12 @@ GET /test/person/_search
|
||||||
"fields": [],
|
"fields": [],
|
||||||
"query": {
|
"query": {
|
||||||
"match": {
|
"match": {
|
||||||
"file": "king queen"
|
"file.file": "king queen"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"highlight": {
|
"highlight": {
|
||||||
"fields": {
|
"fields": {
|
||||||
"file": {
|
"file.file": {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ It gives back:
|
||||||
"_id": "1",
|
"_id": "1",
|
||||||
"_score": 0.13561106,
|
"_score": 0.13561106,
|
||||||
"highlight": {
|
"highlight": {
|
||||||
"file": [
|
"file.file": [
|
||||||
"\"God Save the <em>Queen</em>\" (alternatively \"God Save the <em>King</em>\"\n"
|
"\"God Save the <em>Queen</em>\" (alternatively \"God Save the <em>King</em>\"\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,8 +141,8 @@ public class SimpleAttachmentIntegrationTests extends ElasticsearchIntegrationTe
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
SearchResponse response = client().prepareSearch("test")
|
SearchResponse response = client().prepareSearch("test")
|
||||||
.addField("content_type")
|
.addField("file.content_type")
|
||||||
.addField("name")
|
.addField("file.name")
|
||||||
.execute().get();
|
.execute().get();
|
||||||
String contentType = response.getHits().getAt(0).getFields().get("file.content_type").getValue();
|
String contentType = response.getHits().getAt(0).getFields().get("file.content_type").getValue();
|
||||||
String name = response.getHits().getAt(0).getFields().get("file.name").getValue();
|
String name = response.getHits().getAt(0).getFields().get("file.name").getValue();
|
||||||
|
|
Loading…
Reference in New Issue