I'm testing the new ElasticSearch WildCard field type (https://www.elastic.co/blog/find-strings-within-strings-faster-with-the-new-elasticsearch-wildcard-field) that is supposed to offer better wildcard queries.
Strangely, it seems to be slower for wildcard queries than the default text field.
Is this expected behaviour, or am I doing something wrong?
I am searching about approx. 500,000 rows of log data.
With the default text type (though only searches over first 256 chars due to ignore_above):
"result" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
time curl -X GET "localhost:9200/text-index/_count?pretty" -H "Content-Type: application/json" -d'{ "query": { "wildcard": { "result": "*dfdskfjdskofsdjf*" } } } '
= 3.2 Seconds
With the new wildcard field type:
"result" : {
"type" : "wildcard"
}
time curl -X GET "localhost:9200/wildcard-index/_count?pretty" -H "Content-Type: application/json" -d'{ "query": { "wildcard": { "result": "*dfdskfjdskofsdjf*" } } } '
= 24.95 seconds