﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>InstantASP Community Forums / Old Forums / InstantKB.NET 1.x  / Search Result Highlighting Problem / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>InstantASP Community Forums</description><link>http://community.instantasp.co.uk/</link><webMaster>sales@instantasp.co.uk</webMaster><lastBuildDate>Fri, 09 Jan 2009 09:42:18 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>If you have the source and are comfortable editing and recompiling you may be interested in the following fix that seems to work for our site.&lt;P&gt;What it does is to post-process after the highlights are inserted, and remove any highlighting that is within a HTML tag.&lt;/P&gt;&lt;P&gt;I inserted this in utilities.vb in the function &lt;STRONG&gt;Highlight&lt;/STRONG&gt;, immediately above the line  &lt;FONT face="Courier New"&gt;bolFirst = False&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;[code] 'clean up highlights within tags added by CC 07/30/07&lt;BR&gt;ResultStr = Regex.Replace(ResultStr, "&amp;lt;([^&amp;gt;]*)&amp;lt;font style='background-color:#FFFC00;'&amp;gt;([^&amp;gt;]*)&amp;lt;/font&amp;gt;([^&amp;gt;]*)&amp;gt;", "&amp;lt;$1$2$3&amp;gt;", RegexOptions.IgnoreCase)[/code]&lt;P&gt;[edit] Noting that I am using the actual highlight string. If you want to do it more elegantly see the starttag and endtag variables found in the function...</description><pubDate>Sun, 19 Aug 2007 15:56:40 GMT</pubDate><dc:creator>Charles</dc:creator></item><item><title>RE: Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>Cheers for the reply Tom!&lt;/P&gt;&lt;P&gt;Yeah, I've got the source code, and might do that. We've been carefull to use GUIDS when naming the images (We use a standalone article authoring and publishing tool rather than the wysiwig provided) but any searches including the words or partwords such as knowledge, attachments or our company name QGate result in the image urls being corrupted, so I've got to fix this problem or remove the search highlighting.&lt;/P&gt;&lt;P&gt;Tom</description><pubDate>Wed, 13 Jun 2007 08:05:12 GMT</pubDate><dc:creator>Toad</dc:creator></item><item><title>RE: Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>I do find it a bit disheartening to find I raised this question over two years ago and no one has implemented what should be an easy fix.&lt;br&gt;&lt;br&gt;I can only tell you that I found a simple workaround, but it can only be done if you also bought the source code.  Since the source is copyrighted I can't post my answer, but I can tell you to search for "Highlight" in article.ascx.vb and you'll see where the highlight occurs.  I simply commented it out, so I do not get [i]any[/i] article highlighting.</description><pubDate>Wed, 13 Jun 2007 07:51:13 GMT</pubDate><dc:creator>Tom in Dallas</dc:creator></item><item><title>RE: Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>Would there be any chance of an update on this please?&lt;/P&gt;&lt;P&gt;I would raise a ticket, but I don't have the relavant login details, as I took over this project midway through without a handover period.&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;Tom</description><pubDate>Wed, 13 Jun 2007 04:12:32 GMT</pubDate><dc:creator>Toad</dc:creator></item><item><title>RE: Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>[quote][b]Carlos (12/20/2006)[/b][hr][quote][b]gemmal (12/19/2006)[/b][hr]Can I also have a fix for this?&lt;P&gt;We are using an external software package to convert documents to HTML, before inserting the HTML code into the WYSIWYG editor in the knowledge base. The software converts all images into .png format and uses the naming convention of imagename_1.png, imagename_2.png where the 'imagename' is the title of the saved file etc&lt;/P&gt;&lt;P&gt;Before the code is finalised in the WYSIWYG editor, we do have to change the path of the images for them to apear in the knowledge base.&lt;/P&gt;&lt;P&gt;If the 'imagename' of the image is included within the search, &amp;lt;font&amp;gt; tags are placed around the 'imagename', which breaks the img tags for the images.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gemma [/quote]&lt;P&gt;Dear Gemma,&lt;P&gt;Yes, we have a fix for some problems including this one, please open a ticket in our ticketing system (&lt;a target="_blank" href="http://my.instantasp.co.uk/" target=_blank&gt;http://my.instantasp.co.uk&lt;/A&gt;) asking me for this fix.[/quote]&lt;P&gt; &lt;P&gt;Hi Carlos, I have now taken over from Gemma on this project, and we intend to get around this issue by altering the file paths to ../attachments/ and using Guids as the filenames, would it still be worth asking fot the fix?&lt;P&gt;Thanks&lt;P&gt;Tom.</description><pubDate>Mon, 15 Jan 2007 08:08:11 GMT</pubDate><dc:creator>Toad</dc:creator></item><item><title>RE: Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>[quote][b]gemmal (12/19/2006)[/b][hr]Can I also have a fix for this?&lt;P&gt;We are using an external software package to convert documents to HTML, before inserting the HTML code into the WYSIWYG editor in the knowledge base. The software converts all images into .png format and uses the naming convention of imagename_1.png, imagename_2.png where the 'imagename' is the title of the saved file etc&lt;/P&gt;&lt;P&gt;Before the code is finalised in the WYSIWYG editor, we do have to change the path of the images for them to apear in the knowledge base.&lt;/P&gt;&lt;P&gt;If the 'imagename' of the image is included within the search, &amp;lt;font&amp;gt; tags are placed around the 'imagename', which breaks the img tags for the images.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gemma [/quote]&lt;P&gt;Dear Gemma,&lt;P&gt;Yes, we have a fix for some problems including this one, please open a ticket in our ticketing system (&lt;a target="_blank" href="http://my.instantasp.co.uk"&gt;http://my.instantasp.co.uk&lt;/A&gt;) asking me for this fix.</description><pubDate>Wed, 20 Dec 2006 07:51:46 GMT</pubDate><dc:creator>Carlos Muniz</dc:creator></item><item><title>RE: Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>Can I also have a fix for this?&lt;/P&gt;&lt;P&gt;We are using an external software package to convert documents to HTML, before inserting the HTML code into the WYSIWYG editor in the knowledge base. The software converts all images into .png format and uses the naming convention of imagename_1.png, imagename_2.png where the 'imagename' is the title of the saved file etc&lt;/P&gt;&lt;P&gt;Before the code is finalised in the WYSIWYG editor, we do have to change the path of the images for them to apear in the knowledge base.&lt;/P&gt;&lt;P&gt;If the 'imagename' of the image is included within the search, &amp;lt;font&amp;gt; tags are placed around the 'imagename', which breaks the img tags for the images.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gemma </description><pubDate>Tue, 19 Dec 2006 05:14:39 GMT</pubDate><dc:creator>gemmal</dc:creator></item><item><title>RE: Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>If there is in fact a fix for this - and the last post in this thread says there is - &lt;/P&gt;&lt;P&gt;Could I have the fix please?  Actually what I need is a code fix for the highlight utility, since I have changed some of the other subs in the utility code. I've fiddled with a regex myself to fix the highlighting, but with imperfect success.&lt;/P&gt;&lt;P&gt;My support has expired, but according to the post dates, the fix was created before I bought the product.&lt;/P&gt;&lt;P&gt;TIA.....</description><pubDate>Fri, 11 Aug 2006 04:05:31 GMT</pubDate><dc:creator>Charles</dc:creator></item><item><title>RE: Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>&lt;P&gt;I had the same problem, opened a problem ticket under My.InstantASP and and Ryan had to get a custom DLL rebuilt for the search function and sent to me to remove the highlighting to solve the issue.  The ticket is still 'Under investigation' so I'm hoping that there will be an update in the next version, when ever that shows up.  &lt;/P&gt;&lt;P&gt;I'm also pondering if the patch that Ryan sent me is now interfering with category searches because now any time a category is selected instead of "All Categories", I get an error: &lt;STRONG&gt;Error Message: Thread was being aborted.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;Jeffrey Carlton&lt;BR&gt;Intranet Administrator&lt;BR&gt;Time Warner Cable Charlotte Division&lt;/P&gt;</description><pubDate>Fri, 11 Feb 2005 11:32:43 GMT</pubDate><dc:creator>JCarlton</dc:creator></item><item><title>RE: Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>I have version 1.3. Unless you have released an interim update, the problem still exists.&lt;BR&gt;&lt;BR&gt;I have tracked it down in the source code. First, look in article.ascx.vb in Public Sub ArticleRepeater_ItemDataBound(). On lines 141-143 you'll notice the use of the function InstantASP.InstantKB.Utilities.Strings.Highlight() to highlight a word or phrase in the article text corresponding to the word or phrase found in the session variable "Query". Next, go to Utilities.vb and Public Shared Function Highlight(). You'll notice that the entire text of the article is split on various characters, including the &amp;lt;&amp;gt; characters. No allowance is made for not highlighting text within a tag. This is what leads to the problem. If you include an html link in your article to a file that has spaces within its name, or has a name that matches the search string, then that file name will be highlighted WITHIN the tag, as I demonstrated in the first post. In this particular case, it leads to a mangled and unuseable href value.&lt;BR&gt;&lt;BR&gt;Test it yourself. Go over to the InstantKB.NET online demo. Go to the search tab and search on the word "article". Click the first item to come up, "Q10042 - HOWTO: Creating Knowledge Base Articles". When this article comes up, note the link in the third paragraph with the text "(create_new_article.gif)". If you try to follow the link it doesn't work. If you hover your mouse over the link and look at the address, you'll see why. Right in the middle of the address is the font tag around the word "article", rendering the href value unuseable.</description><pubDate>Wed, 09 Feb 2005 13:59:59 GMT</pubDate><dc:creator>Tom in Dallas</dc:creator></item><item><title>RE: Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>&lt;P&gt;Which version of InstantKB are you using?  This shouldn't occur in InstantKB 1.3.  Please open a ticket in &lt;a target=_blank href="http://my.instantasp.co.uk"&gt;http://my.instantasp.co.uk&lt;/A&gt; to receive InstantKB 1.3 if you have a previous version.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Carlos Muniz&lt;/P&gt;</description><pubDate>Mon, 07 Feb 2005 14:28:31 GMT</pubDate><dc:creator>Carlos Muniz</dc:creator></item><item><title>Search Result Highlighting Problem</title><link>http://community.instantasp.co.uk/Topic4480-26-1.aspx</link><description>When a user brings up a page as a result of a search, the search word or words are automatically highlighted. For the most part, this is a good thing. However, should that word (or words) be an actual part of a URL within the KB article, the URL itself is mangled with the highlighting code.&lt;BR&gt;&lt;BR&gt;For example:&lt;BR&gt;&lt;BR&gt;&lt;a target=_blank href="http://10.0.1.189/SDI/KnowledgeBase/AttachmentsProtected/PC-ACE%20Pro32%20&lt;font%20style='background-color:#FFFC00;'&gt;Command&lt;/font&gt;%20&lt;font style='background-color:#FFFC00;'&gt;Line&lt;/font&gt;%20Options.pdf" target=_blank&gt;PC-ACE Pro32 &lt;FONT style="BACKGROUND-COLOR: #fffc00"&gt;Command&lt;/FONT&gt; &lt;FONT style="BACKGROUND-COLOR: #fffc00"&gt;Line&lt;/FONT&gt; Options&lt;/A&gt; &lt;BR&gt;&lt;BR&gt;Code:&lt;BR&gt;&lt;CODE&gt;&amp;lt;A href="http://10.0.1.189/SDI/KnowledgeBase/AttachmentsProtected/PC-ACE%20Pro32%20&amp;lt;font style='background-color:#FFFC00;'&amp;gt;Command&amp;lt;/font&amp;gt;%20&amp;lt;font style='background-color:#FFFC00;'&amp;gt;Line&amp;lt;/font&amp;gt;%20Options.pdf"&amp;gt;PC-ACE Pro32 &amp;lt;font style='background-color:#FFFC00;'&amp;gt;Command&amp;lt;/font&amp;gt; &amp;lt;font style='background-color:#FFFC00;'&amp;gt;Line&amp;lt;/font&amp;gt; Options&amp;lt;/A&amp;gt;&lt;/CODE&gt;&lt;BR&gt;&lt;BR&gt;Has anyone run across this before and is there anything that can be done about it?</description><pubDate>Mon, 07 Feb 2005 14:27:04 GMT</pubDate><dc:creator>Tom in Dallas</dc:creator></item></channel></rss>