I answered this question on Stack Overflow: http://stackoverflow.com/a/34206432/3582140http://stackoverflow.com/a/34206432/3582140
Sam Mefford Senior Engineer MarkLogic Corporation sam.meff...@marklogic.com Cell: +1 801 706 9731 www.marklogic.com<http://www.marklogic.com> This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation. ________________________________ From: general-boun...@developer.marklogic.com [general-boun...@developer.marklogic.com] on behalf of tanaya.mon...@cognizant.com [tanaya.mon...@cognizant.com] Sent: Thursday, December 10, 2015 4:08 AM To: general@developer.marklogic.com Subject: [MarkLogic Dev General] MarkLogic highlights wrong content when searched Hi, I am trying to search some content and highlight the search strings present in the content(like google) in MarkLogic using REST API. The problem is when I am including "ME" in the search-string, it's highlighting the <i> (html italic tags) along with the "Me" in the content. I have created a field with some elements and running a word-query on the field. For example: <resources> <title> some data from me</title> <desc> more data <i> from </i> somewhere by me </desc> </resources> I have created a field called 'suggestions' with elements 'title' and 'desc' and searching the search strings within the field using word-query. Now when i search for "some me" ,its retrieving the content like <resources> <title> <<span class="highlight">some</span> data from <<span class="highlight">me</span></title> <desc> more data <<span class="highlight">i</span>> from <<span class="highlight">i</span>> somewhere by <<span class="highlight">me</span> </desc> </resources> Url: localhost:9000/v1/search?q=some me&collection=Data&start=0&pageLength=10&options=Transformation&format=json I am using cts:highlight for highlighting, something like : cts:highlight($final-result, $query, fn:concat('<span class="highlight">',$cts:text,'</span>')), $custom-config) Trying to understand if there is any grammar for which βMeβ and βIβ are treated as same? Or there is some problem with HTML tag parsing. Looking forward for a prompt reply. Thanks in Advance. Regards, Tanaya Mondal Programmer Analyst This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.
_______________________________________________ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general