I have some documents in elasticsearch v5.2.2 that look like this:
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 1,
"hits": [
{
"_index": "company",
"_type": "external",
"_id": "2",
"_score": 1,
"_source": {
"name": "IBM",
"bloomberg": "IBMB34:BZ"
}
},
{
"_index": "company",
"_type": "external",
"_id": "1",
"_score": 1,
"_source": {
"name": "Apple",
"bloomberg": "AAPL34:BZ"
}
},
{
"_index": "company",
"_type": "external",
"_id": "3",
"_score": 1,
"_source": {
"name": "Microsoft",
"bloomberg": "MSFT34:BZ"
}
}
]
}
}
I would like to find all documents that contain a substring that possibly contains a special character (in my case ':').
{
"query": {
"wildcard" : { "bloomberg" : "*b34*" }
}
}
Returns one result (as expected).
{
"query": {
"wildcard" : { "bloomberg" : "*b34:*" }
}
}
Returns none. I have tried query_string and various other things but nothing seems to work.