Dear Christian,

Thank you for the info.  I will make the changes you suggest and I will let you know the information from the InfoView when I get the chance.

All the best,
Chris


On Wed, Aug 13, 2014 at 12:18 PM, Christian Grün <christian.gruen@gmail.com> wrote:
Hi Chris,

there are various caches involved when evaluating queries, but I can't
see for the given query where a cache may be utilized. However, your
query may be evaluated faster if you simplify the nested where clause:

<results>{
  subsequence(
    ft:mark(
      for $x in collection($col)//entry
      where $x//text() contains text { $term } using wildcards
      order by fn:lower-case(
        fn:replace(($x//orth[1]/text())[1], '\\p{P}|\\d+','')
      ) collation "?lang=ga"
      return $x
    ), 1, 5000
  )
}</results>

You could as well use a predicate with position(), it may be evaluated
faster than subsequence (I'm not sure, though, because most time will
probably be spent for ordering all results):

<results>{
  ft:mark(
    for $x in collection($col)//entry
    where $x//text() contains text { $term } using wildcards
    order by fn:lower-case(
      fn:replace(($x//orth[1]/text())[1], '\\p{P}|\\d+','')
    ) collation "?lang=ga"
    return $x
  )[position() = 1 to 5000]
}</results>

Could you please open the InfoView in the GUI, execute the query again
and check if the full-text index is applied?

Christian



On Wed, Aug 13, 2014 at 12:02 PM, Christopher Yocum <cyocum@gmail.com> wrote:
> declare variable $term as xs:string external; declare variable $col as
> xs:string external; <results>{subsequence(ft:mark(for $x in
> collection($col)//entry where $x//text()[. contains text {$term} using
> wildcards] order by fn:lower-case(fn:replace(($x//orth[1]/text())[1],
> '\\p{P}|\\d+','')) collation \"?lang=ga\" return $x), 1, 5000)}</results>