Hi all,
I have a very simple index structure only containing the fields (project_id:int and name:string). What I want to do is a wildcard (infix) query on the name field and that scoped with the project_id. What I am using for this is this search:
{
"query": {
"bool": {
"must": [
{ "wildcard": { "name": "*test*" } }
],
"filter": [
{
"term": { "project_id": 4711 }
}
]
}
}
}
The problem is, no matter how many documents are selected by the project_id filter, the initial queries for the wildcard always take ~ 200ms (having 17mio records in the index). That even happens when the filter does not select any documents at all (like when using -1 for the project ID).
Is there anything I can do to make those initial queries to perform better?