We recently integrated ElasticPress for WooCommerce, and did some improvements to it's code (via it's filters), but hit a few things that appears to be limitations of the ElasticSearch API. We've made mods to the queries sent to the elastic search engine when searching orders, so that the search term works as a partial search (much like the LIKE statement in SQL).
It works fine, except when there are special symbols in the query, like space, or the @ symbol. I've read that this could be avoided by escaping the special characters, but i had no luck doing that either.
I'm using the wildcard query, and i tried replacnig spaces with their escaped version, or even the ? token (which should match any single character). And no luck with that either.
This query works:
"query": {
"wildcard": {
"meta._billing_full_name.value": "*manish*"
}
}
This does too
"query": {
"wildcard": {
"meta._billing_full_name.value": "*kumar*"
}
}
This doesn't:
"query": {
"wildcard": {
"meta._billing_full_name.value": "*manish k*"
}
}
By the way, we're using AWS ElasticSearch Service as a service provider. They're using an seriously outdated version of ElasticSearch (1.5.3 as far as i know), and i'm not sure if that could be one cause of the problems.
Thanks
meta._billing_full_name.value. Is itanalyzed string.curl -XGET 'http://serverIp:9200/index_name/_mapping/'