Hi Geert, Even search:highlight is not highlighting the character.
Do you have any suggestions how to achieve this? Thanks, Pragya Message: 5 Date: Tue, 18 May 2010 09:09:41 +0200 From: Geert Josten <[email protected]> Subject: Re: [MarkLogic Dev General] Query on cts:highlight To: General Mark Logic Developer Discussion <[email protected]> Message-ID: <0260356c6dfe754ba6fa48e659a143386077393...@helios.olympus.borgus.nl> Content-Type: text/plain; charset="us-ascii" Hi Pragya, I don't think you can use cts:highlight to do that. Your $ctsquery is interpreted as cts:word-query("a") which only matches words consisting of the single character 'a'. By the way, the search library has built-in capabilities to highlight searched terms. Look for search:highlight within search:result. More explanation of search:search can be found here: http://developer.marklogic.com/pubs/4.1/apidocs/SearchAPI.html#search:search. Perhaps also the search dev guide is of any help to you http://developer.marklogic.com/pubs/4.1/books/search-dev-guide.pdf.. Kind regards, Geert drs. G.P.H. (Geert) Josten Consultant [cid:[email protected]] Daidalos BV Hoekeindsehof 1-4 2665 JZ Bleiswijk T +31 (0)10 850 1200 F +31 (0)10 850 1199 [email protected]<mailto:[email protected]> www.daidalos.nl<http://www.daidalos.nl/> KvK 27164984 P Please consider the environment before printing this mail. De informatie - verzonden in of met dit e-mailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Pragya Kapoor Sent: dinsdag 18 mei 2010 7:22 To: [email protected] Subject: [MarkLogic Dev General] Query on cts:highlight Hi, I have following query on cts:highlight I am running this command: Let $ctsquery := "a" let $suggestions := search:search($query,$options) let $response := $suggestions//search:result/title/text() return cts:highlight($response, $ctsquery, <b>{$cts:text}</b>)} }; Response: All is well All the Best .... .... Here I am unable to highlight 'a' in the response. But if my ctsquery is 'all' it gets highlighted. So my question is how to highlight ctsquery(characters/words) I need the following output: Query output A <b A </b> ll is well Al <b> Al </b> l is well Be All the <b> Be </b> st Best All the <b> Best </b> How to achieve this? Thanks, Pragya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://developer.marklogic.com/pipermail/general/attachments/20100518/66eb282a/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: [email protected] Type: image/jpeg Size: 45711 bytes Desc: [email protected] Url : http://developer.marklogic.com/pipermail/general/attachments/20100518/66eb282a/attachment.jpe ------------------------------ _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general End of General Digest, Vol 71, Issue 39 *************************************** _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
