mapping
PUT /my_index/_mapping/blogpost
{
"properties": {
“document”: {
"properties": {
"content": {
"type": "text",
"fields": {
"raw": {
"type": "keyword",
"ignore_above": 32766
}
}
}
}
}
}
}
register
POST /my_index/_doc/1
{
"contents": "so long text which exceeds 32766 bytes"
}
search
GET /my_index/_search
{
"query": {
"match": {
"contents": "somothing"
}
},
"collapse" : {
"field" : "contents.row"
}
}
Using this mapping, when searching text which is smaller than 32766 bytes,
I can eliminate duplication of search response.
However, when searching text which is larger than 32766 bytes, I can't.
Is there another way of solving my requirements?