I tried to simplify your use case at it's not explicitly related to ingest-attachment here:
DELETE test
PUT test
{
"mappings" : {
"doc" : {
"properties" : {
"attachment.content" : {
"type": "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
},
"analyzer" : "french"
}
}
}
}
}
PUT test/doc/1?refresh
{
"attachment.content": "Bonjour"
}
GET test/_search
{
"query": {
"match": {
"attachment.content": {
"query": "Bonjour"
}
}
}
}
GET test/_search
{
"query": {
"wildcard": {
"attachment.content": {
"value" : "Bon*"
}
}
}
}
GET test/_search
{
"query": {
"wildcard": {
"attachment.content": {
"value" : "bon*"
}
}
}
}
This gives:
# GET test/_search
{
"took": 17,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.2876821,
"hits": [
{
"_index": "test",
"_type": "doc",
"_id": "1",
"_score": 0.2876821,
"_source": {
"attachment.content": "Bonjour"
}
}
]
}
}
# GET test/_search
{
"took": 14,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
# GET test/_search
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "test",
"_type": "doc",
"_id": "1",
"_score": 1,
"_source": {
"attachment.content": "Bonjour"
}
}
]
}
}
So this is what I'm expected here.
What is the problem you have then?