Hi Sam,
Does your code use a full-text index?
I guess that the index should be applied by the "contains text" expression. Feel free to open the InfoView in the GUI to see what's happening internally.
Is it possible to use full-text index for search attributes?
Others have asked for this before, so chances are increasing that we will eventually add this in a future version. For now, if you should experience bad performance, a popular BaseX approach is to create new databases from all relevant data and create a full-text index for those instances.
Hope this helps, Christian