Hello David,
thanks for your reply, it solved one part of my problem, i appreciate it.
Now i have another problem about highlighting the result. can you pls help me about this too?
My mapping:
{
"files": {
"properties": {
"file": {
"type": "attachment",
"fields": {
"content": {
"type": "string",
"term_vector":"with_positions_offsets",
"store": true
},
"name" : { "type" : "string" }
}
}
}
}
}
My Insert Document Request:
{
"file" : "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
}
My Query Request:
{
"query": {
"query_string": {
"query": "ipsum"
}
},
"highlight" : {
"fields" : {
"file" : {}
}
}
}
The Search Result:
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.095891505,
"hits": [
{
"_index": "filesystem",
"_type": "files",
"_id": "11",
"_score": 0.095891505,
"_source": {
"file": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
}
}
]
}
}
As you can see in the response, there is no hightlight information in the response. What is my mistake, pls kindly advice.
Thanks