SPS和WSS中的搜索定制
使用SPS或WSS比较多的用户往往对sharepoint的搜索功能很难清楚的理解。感觉有时不是那么的“好用”。
这里顺便简单提一下sharepoint中的搜索机制:WSS站点上的关键字搜索启用的是SQL SERVER的全文检索,因此检索结果的效率与SQL SERVER的语言版本以及索引、分词技术有关。SPS则提供了一个强大的搜索引擎,不同于wss site级别的全文检索,我们还可以利用此搜索引擎去爬非SPS门户范围的外部站点、文件服务器等等。但是搜索结果的多少主要依靠是否配置在portal的搜索范围内,以及索引的更新频率。
SPS中的搜索引擎比较强大,但是也因此会在在输入一个keyword后搜索出“无数”的匹配结果,用户往往需要next很多页才会找到自己所需要的结果(有时甚至因为文档结果过多失去next寻找的耐心);虽然SPS的[高级搜索]功能可以帮助解决一些这样的问题,如果普通用户有时仍然不能很好的掌握其中的技巧。
当然也有小技巧,如果合理的运用在日常的使用中,还是可以提高搜索效率的:
1、搜索多词的词组时,可以适当的加上双引号["""]缩小搜索范围;
2、使用GET方法从search.aspx文件得到较精确的结果。
sr
Specifies the redirection URL to use for search results for user data when a user does not have a user profile. The page returns to the pivot query.
sn
Specifies the site name.
k
Specifies the keywords. You can only specify one value for this parameter.
s
Specifies the search scope. This parameter can contains multiple values.
rs
Specifies the real scope name of a topic, folder, or personal site.
w
Specifies the WHERE clause and condition.
wd
Specifies the WHERE clause and condition description.
pt
Specifies advanced properties. This parameter can contains multiple values. The parameter value must be either a URI, Operation, desired value (integer), or And/Or. The URI is prefixed by one character that indicates the property type: S for string; D for date; I for integer; and M for multi-valued string.
d
Specifies an advanced search by date. This parameter can contains multiple values. The parameter value must be a URI, desired value (integer), or Hour/Day/Month/Year/.
tp
Specifies an advanced search by type. You can only specify one value for this parameter. Parameter values include document, category, listing, site, person, event, tasks, announcement, picture, discussions, contacts, stsitems, or any.
db
Focuses query on documents by specified parameter.
wo
Overrides scopes specified in WHERE clause and searches all catalogs in FROM clause. Searches within current area.
pf
Supports folder browsing search for Microsoft SharePoint Portal Server 2001.
ct
Specifies the context sensitive scope type. The current topic is indicated by 1. The current folder is indicated by 2. The current personal site is indicated by 3.
“%2c
Separator for multiple scopes.
3、用户最多的一般是对已知文档的相关属性进行搜索,例如title或其他自定义属性。可开发定制一个当前站点or区域下文档属性搜索的webpart提供给用户。用户可以自行配置搜索哪些文档库or全部文档库,搜索哪些属性。(2和3目前我们都已经有了实际的例子了。)
在WSS搜索结果中高亮显示搜索关键字
无论是搜索引擎还是全文检索,一个很基本的用户需求是:希望可以在搜索结果中高亮显示搜索关键字。这样可以为用户快速在搜索结果找到最匹配的结果提供“即时”的方便。然后这样的一个基本需求在现有版本sps或wss中都没有得到体现。现在有很多公司也针对这个需求开发了自己的产品,实现了很多高级的搜索功能。可惜这些产品大都不是免费的。而且对中文支持的不多。
(下面的这张截图就是其中一个不错的产品,可以直接在搜索结果中高亮显示带有关键字的key word,并且可以直接预览文档。)
上面的这个产品是针对SPS的,如果用户仅仅想在WSS搜索结果中高亮显示搜索关键字,一个方法是通过javascript脚本来实现。也就是找到wss的搜索结果页searchresults.aspx文件(在layouts目录下)。相关js脚本可以参考下面:
|
function HighlightSearchTerm(strSearchTerm) |
这个例子是针对英文版的,如果想用在中文版的wss中,可以替换lcid为2052。
浙公网安备 33010602011771号