Fulltext search
Wednesday, 19 September 2012 · 3 messages
B
JE
Jens Erat19 Sep 2012 09:55 #
Hi Marcus,
ft:search(…) is built for returning text nodes, have a look at the [documentation]. If you want to get the nodes, you should use the more general [full text expressions].
If you need help transforming your query, would you please paste your query (or better: the full text search relevant part of it)?
Regards,
Jens
[documentation]: http://docs.basex.org/wiki/Full-Text_Module#ft:search [full text expressions]: http://docs.basex.org/wiki/Full-Text--
Jens Erat
[phone]: tel:+49-151-56961126
[mail]: mailto:email at jenserat.de
[jabber]: xmpp:jabber at jenserat.de
[web]: http://www.jenserat.de
PGP: 350E D9B6 9ADC 2DED F5F2 8549 CBC2 613C D745 722B
Quoted text · basex · 15 lines
Am 19.09.2012 um 09:33 schrieb <basex at phpexpert.net>: > Hi @all, > > is there a way if i use ft:search on the database to get the nodes of results back instead of just the results? > > > Regards > > > Marcus > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
JE
Jens Erat19 Sep 2012 10:58 #
Hi Marcus,
this is because
ft:search can scan the index directly, contains text needs to construct some objects before.
ft:search doesn't return strings but text nodes, so you can use a parent axis step to get the containing node: ft:search($x, 'double')/parent::node()Kind regards from Lake Constance, Germany,
Jens
--
Jens Erat
[phone]: tel:+49-151-56961126
[mail]: mailto:email at jenserat.de
[jabber]: xmpp:jabber at jenserat.de
[web]: http://www.jenserat.de
PGP: 350E D9B6 9ADC 2DED F5F2 8549 CBC2 613C D745 722B
Quoted text · Jens Erat · 60 lines
Am 19.09.2012 um 10:22 schrieb <basex at phpexpert.net>: > My searches are > > <no>{let $quasi := (for $x in /record where ft:search($x, 'double') and ($x/item[@name="STATUS"]/value/string() = "edited") return <quasi>{data($x/@id)}<content>{$x//value[text() contains text 'double']}</content></quasi>) return $quasi }</no> > > > <no>{let $quasi := (for $x in /record where ($x//value[text() contains text 'double']) and ($x/item[@name="STATUS"]/value/string() = "edited") return <quasi>{data($x/@id)}<content>{$x//value[text() contains text 'double']}</content></quasi>) return $quasi }</no> > > > These searches take a lot of time (about 300 seconds) cause of nearly 600.000 objects (about 4 GB data) to search through > > A Fulltext search wich only delivers the textnodes only takes 2 seconds to deliver text results > > > > On Wed, 19 Sep 2012 09:55:50 +0200, Jens Erat <jens.erat at uni-konstanz.de> wrote: >> Hi Marcus, >> >> `ft:search(…)` is built for returning text nodes, have a look at the >> [documentation]. If you want to get the nodes, you should use the more >> general [full text expressions]. >> >> If you need help transforming your query, would you please paste your >> query (or better: the full text search relevant part of it)? >> >> Regards, >> Jens >> >> [documentation]: http://docs.basex.org/wiki/Full-Text_Module#ft:search >> [full text expressions]: http://docs.basex.org/wiki/Full-Text >> >> -- >> Jens Erat >> >> [phone]: tel:+49-151-56961126 >> [mail]: mailto:email at jenserat.de >> [jabber]: xmpp:jabber at jenserat.de >> [web]: http://www.jenserat.de >> >> PGP: 350E D9B6 9ADC 2DED F5F2 8549 CBC2 613C D745 722B >> >> >> >> Am 19.09.2012 um 09:33 schrieb <basex at phpexpert.net>: >> >>> Hi @all, >>> >>> is there a way if i use ft:search on the database to get the nodes of results back instead of just the results? >>> >>> >>> Regards >>> >>> >>> Marcus >>> >>> _______________________________________________ >>> BaseX-Talk mailing list >>> BaseX-Talk at mailman.uni-konstanz.de >>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
Written for BaseX 7.3. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery