I am afraid that full text index will not find "blue socks", because it does not cross text() node boundaries:
Exactly. You’ll need to do something like:
(: "... update () is used to transform the node to a "database node" (find more info in the Wiki) :)
for $xml in <xml> <p>He wore <sc>dark blue</sc> socks that day.</p> </xml> update () where $xml contains text 'blue socks' return ft:mark( $xml[.//text() contains text { 'blue', 'socks' }] )
-----Message d'origine----- De : basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de] De la part de Liam R. E. Quin Envoyé : jeudi 10 décembre 2015 21:37 À : Christian Grün christian.gruen@gmail.com; Ron Katriel rkatriel@mdsol.com Cc : basex-talk@mailman.uni-konstanz.de Objet : Re: [basex-talk] Returning text matches
On Thu, 2015-12-10 at 17:24 +0100, Christian Grün wrote:
Hi Ron,
You can use ft:mark and ft:extract to highlights matches in a full-text result [1].
And what happens if a full text match crosses an element boundary, e.g. a search for "blue socks" matching,
<p>He wore <sc>dark blue</sc> socks that day.</p> could not return, <p>He wore <sc>dark <match>blue</sc> socks</match> that day.</p>
(Yes, I should test it, sorry! but the docs should probably mention it. it was a big part of the XPath/XQuery Full Text design early on)
Liam
-- Liam R. E. Quin liam@w3.org The World Wide Web Consortium (W3C)