Okay, I figured it out. Evidently, I should have tested the evaluated value of 'text()' or '.' with the 'contains text' expression, not just the element itself. That's why both the simplified queries below use the full-text index. When I modify the WHERE clause of my query to read
where $pa/person-template:externalperson/externalperson-template:name/core:lastName/text() contains text {'Meric'}
it works lickety-split.
Thank you Christian for your help.
Chuck
On Wed, Oct 21, 2015 at 9:05 AM, Christian GrĂ¼n christian.gruen@gmail.com wrote:
Thanks for the suggestion. The full-text index is apparently not being used.
It is sometimes not obvious for the query optimizer how to rewrite a query to take full advantage of an index. You could try to start with a simple version of your query, see if the optimizer is used, and enhance it step by step..
//*:lastName[text() contains text 'Meric']
declare namespace core="http://atira.dk/schemas/pure4/model/core/current"; //core:lastName[text() contains text 'Meric']
The full-text index is applied in both of the above queries. Oh wait, I get it.
...
Does the results returned by core:lastName contain other descendant elements [1]?
core:lastName & core:firstName are just PCDATA.
Christian