A regexp search is the most expensive. If that is what you need, then so be it, but for your case, a term index will get you what you want.
It might seem odd for
anyofterms (any of terms) or
allofterms (all of terms) to be just a single term, but either function will work for that.
And to get term based indexes using
P.S. You can also apply multiple indexes to have what you need available when you need it like:
@search(by: [exact,regexp,term,fulltext]) You just can’t use both
exact will generate a few more options such as
lt (less than),
le (less than or equal to),
ge (greater than or equal to),
gt (greater than), and
between but if those are not needed then a hash index may work better especially if you are working with longer strings.
P.P.S Your regex can be simplified to just use
"/Core/". The additional
.* are not doing anything in this case at the beginning and end of a regular expression.