突出显示各种文档类型的搜索结果 [英] highlighting search results for diverse document types

查看:87
本文介绍了突出显示各种文档类型的搜索结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我将单词文档甚至pdf文档保存在SQL 2005数据库的表中,该数据库由Windows应用程序预先定义,用户可以在其中键入关键字,然后使用FTS来搜索单词在word文档中(存储在varbinary(max)列中),我需要的是在浏览器中将结果文档显示为只读(可以将其放在win窗体上)以黄色突出显示匹配项,例如您回复听起来很有趣,但是有一种通用的方法可以突出显示任何类型的文档(.doc,.xsl,.pdf等)中的匹配项.您对此有任何想法吗?谢谢

Hello I'm saving word documents and even pdf document in a table of a SQL 2005 database the database is fore-ended by a windows application in which the user may type a keyword and then using FTS I can search for the word inside the word document (which is stored in a varbinary(max) column) what I need is to display the resulting documents as readonly in browser (it's a control that can be put on the win form) highliting the hits in yellow for example you reply sounds interesting but is there a general way to highlight hits in any type of document (.doc, .xsl, .pdf,...) Do you have any idea for doing that? thank you

推荐答案

亲爱的阿里,

        最简单的方法是拥有一个自定义控件,该控件呈现从数据库中接收到的内容.如果您想在数据库中执行此操作(我建议您这样做),那么您可以轻松地 请在T-SQL中使用替换"功能,并用彩色的html标记替换您找到的所有内容.在应用程序中,您可以修改自定义控件中的呈现方式,然后再次用html标签替换关键字.希望对您有所帮助.

          The simplest way to do this is to have a custom control which renders the content recieved from the database. If you wanna do this in the database (I would recommend you this one), so you can easily use Replace function in the T-SQL and replace whatever you found by a colored html tag. In the application, you can modify the way of rendering in the custom control and again replace keywords by html tags. Hope it helps.

问候"


这篇关于突出显示各种文档类型的搜索结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆