No hits when do a text search in an attachment for .docx file

Hi David,

Thanks for your reply and for your help with this.

I managed yesterday to get the search working for all files types except .docx files, so that probably means that the plugin is loaded and that the mapping has been applied correctly but I must be missing something as it is supposed to work with .docx files also.

This is my mapping json:

{
"index":"client_index",
"type":"documents",
"body":{
"documents":{
"properties":{
"file":{
"type":"attachment",
"fields": {
"content": {
"type": "string",
"term_vector":"with_positions_offsets",
"store": true
}
}
}
}
}
}
}

and this is my index json:

{
"index":"client_index",
"type":"documents",
"id":"' . $index . '",
"body":{
"file":{
"_content":"' . $file_encoded . '",
"_name":"' . $file_to_index .'",
"_content_type":"' . $mime_type . '",
"_indexed_chars":"-1",
"_detect_language":"true"
}
}
}

and this is my search json:

{
"index":"client_index",
"type":"documents",
"body":{
"query":{
"match":{
"file.content": "' . $search_text . '"
}
},
"highlight": {
"fields": {
"file.content": {
}
}
}
}
}

Your help is much appreciated. Thanks. Mary