Full-text search with ft:mark (linking back)
Wednesday, 30 December 2015 · 2 messages · last reply 31 Dec 2015
K
kleist30 Dec 2015 21:12 #
Dear members,
given for example:
ft:mark(//p[.//text() contains text 'real']). This will yield some results. Is there any way, to link back to the documents, where p was found? I know, it would work without ft:mark, but I need the <mark>-tag inside of the results, especially for fuzzy-search-results.
Any help would be appreciated.
- GünterCG
Christian Grün31 Dec 2015 13:00 #
Hi Günter,
Try something like this:
for $p in //p
for $hits in ft:mark($p[.//text() contains text 'real'])
return <hit path="{ db:path($p) }">{ $hits }</hit>Cheers,
Christian
Quoted text · kleist · 7 lines
On Wed, Dec 30, 2015 at 9:12 PM, kleist <kleist at mail.dunzwolff.de> wrote: > Dear members, > given for example: ft:mark(//p[.//text() contains text 'real']). This will yield some results. > Is there any way, to link back to the documents, where p was found? I know, it would work without ft:mark, but I need the <mark>-tag inside of the results, especially for fuzzy-search-results. > > Any help would be appreciated. > - Günter
Written for BaseX 8.3. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery