Hi All,

I want to use a custom constraint in a search:search options node to get
names which match an initial pattern. E.g. "smi" matches "Smith, Aaron",
"Smith, Andrew", ... The constraint references a parser which returns a
cts:query.

My documents may have more than one name per doc. E.g.

<doc>...<name>Smith, Aaron</name><name>Jones, Bill</name>...</doc>

At the moment I am using this and-query to get at the desired names:

let $lower := "smi"
let $upper := "smj"
return cts:and-query((
  cts:element-range-query(xs:QName("my:name"), ">=", $lower),
  cts:element-range-query(xs:QName("my:name"), "<", $upper)
))

But this will return "Jones, Bill" along with the Smi's because of the
doc which contains Smith and Jones.

Can anyone suggest a cts:query to add to the other two in order to
exclude names that do not start with the pattern (i.e. $lower)? Or must
I post-process the result set to filter ones that don't match the
pattern?

Best,

Tim Finney




_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to