On Mon, May 11, 2020 at 07:51:02PM +0200, Christian Grün scripsit:
Hi Graydon,
Hi Christian --
Thanks for sharing your use case.
However, so far as I can tell, full text only works directly on a database node. If I try to pass the node in a function, I get "No database node" errors from attempting full-text operations.
You can convert an XML node to the internal “database node” representation by applying a dummy operation:
let $xml := <xml>hello world</xml> update {} return ft:mark($xml[text() contains text 'hello'])
Does this already help? See the Wiki articles [1,2] for some revised information.
That helps and I will check, but not this week. (This part of the current deadline has been addressed by clubbing the problem with a rock, er, xsl:iterate, and that'll do for now. The general pattern is something I need to do a lot so I'll be coming back to this.)
Thank you very much for the docs update!
I have already asked myself in the past if we shouldn’t include a function that expose internal result positions to the user? Suggestions are welcome.
The thing that I would most want to see is some way to capture multi-word matches using full-text search; "full phrase search", in effect. I can see that as the start and end of a range of internal result positions but will admit to wanting something less at risk of my arithmetic errors.
-- Graydon