搜索“路径以...开头".与LIKE谓词一起被截断64个字符 [英] Search "PATH starts with ..." with the LIKE predicate is truncated by 64 characters

查看:85
本文介绍了搜索“路径以...开头".与LIKE谓词一起被截断64个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



环境是:
-Microsoft Search Server Express 2008,但我也尝试使用Mircrosoft Office SharePoint Server 2007
-文件共享内容源到文件://myserver/c $/temp


我有一个Web部件,该Web部件通过使用FullTextSqlQuery类执行搜索.我只想搜索位于特定子文件夹或该子文件夹的所有子文件夹中的项目.我通过使用LIKE谓词来尝试此操作.但是似乎SharePoint会截断Managed Property并将搜索到的值截断为64个字符.

因此,如果我有以下两个文件:
file://myserver/c $/temp /我的第一个子文件夹/第二个子文件夹/2008/我的第一个测试文件.docx
文件://myserver/c $/temp/我的第一个子文件夹/第二个子文件夹/2009/我的第二个测试文件.docx
请注意,这是64个字符:file://myserver/c $/temp/my第一个子文件夹/第二个子文件夹/

现在我有一个where子句,像这样:
WHERE路径类似'file://myserver/c $/temp/my第一个子文件夹/第二个子文件夹/ 2009 %'
此查询将返回两个文件以及子文件夹2008中的文件!同样,以下查询返回两个文件:
WHERE Path LIKE'file://myserver/c $/temp/my第一子文件夹/第二子文件夹/2 xy 009%'
仅当我在前64个字符中输入'xy'时,查询才会返回任何结果:
WHERE路径类似'file://myserver/c $/temp/my第一个子文件夹/第二个子文件夹 xy 文件夹/2009%'

在安装WSS和MOSS SP2之前,等号子句也是如此:
WHERE Path ='file://myserver/c $ /temp/我的第一个子文件夹/第二个子文件夹/ 2009/我的第二个测试文件.docx'
这将返回两个文件!但是,在我安装WSS和MOSS SP2之后,此行为发生了变化.现在,上面的查询仅返回正确的一个文件.
但是带有LIKE谓词的子句仍然仅比较前64个字符.

显然,我不是唯一一个遇到此问题的人. .以下是一些其他链接:
http://social.technet.microsoft.com/forums/en-US/sharepointsearch/thread/322d882b-20d2-4065- ba64-c7bafc4ac1c0/
http://social.technet.microsoft.com/Forums/zh-CN/sharepointsearch/thread/303c5b8d-1ce3-4d9d-a929-72cd1fad9749

是否有此问题的修补程序未包含在SP2中?当然也要重新爬网.

我也尝试安装以下hotf ix(在SP2之前)没有运气: http://support.microsoft.com/kb/952294

关于Marc的问题


Hi

The environment is:
- Microsoft Search Server Express 2008, but I tried also with Mircrosoft Office SharePoint Server 2007
- File Share Content Source to file://myserver/c$/temp


I have a webpart which executes a search by using the FullTextSqlQuery class. I would like to search only items that are located in a specific subfolder or in all childs of this subfolder. I try this by using the LIKE predicate. But it seems, that SharePoint truncates the Managed Property and also the searched value to 64 characters.

So if I have the following two files:
file://myserver/c$/temp/my first subfolder/the second subfolder/2008/my first test file.docx
file://myserver/c$/temp/my first subfolder/the second subfolder/2009/my second test file.docx
note that this are 64 characters: file://myserver/c$/temp/my first subfolder/the second subfolder/

Now I have a where clause like this:
WHERE Path LIKE 'file://myserver/c$/temp/my first subfolder/the second subfolder/2009 %'
This query returns both files also the file in the subfolder 2008! Also the following query returns both files:
WHERE Path LIKE 'file://myserver/c$/temp/my first subfolder/the second subfolder/2xy 009%'
Only if I put the 'xy' in the first 64 characters, then the query returns no results:
WHERE Path LIKE 'file://myserver/c$/temp/my first subfolder/the second subxy folder/2009%'

The same was with an equal clause before I installed WSS and MOSS SP2:
WHERE Path = 'file://myserver/c$/temp/my first subfolder/the second subfolder/2009/my second test file.docx '
This returned both files! But after I installed WSS and MOSS SP2 this behaviour changed. Now the query above returns only the correct one file.
But the clause with the LIKE predicate still compares only the first 64 characters.

Obviously I'm not the only one who has this problem. Here are some other links:
http://blogs.msdn.com/sharepoint/archive/2006/10/25/microsoft-office-sharepoint-server-2007-search-can-support-up-to-50-million-documents-in-a-single-index.aspx#8079390
http://social.technet.microsoft.com/forums/en-US/sharepointsearch/thread/322d882b-20d2-4065-ba64-c7bafc4ac1c0/
http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/303c5b8d-1ce3-4d9d-a929-72cd1fad9749

Is there a Hotfix for this issue which is not included in the SP2?
Ah after installing SP2 I reset the crawl content of course and recrawled.

I also tried to install the following hotfix (before SP2) without luck: http://support.microsoft.com/kb/952294

Regards Marc


推荐答案

是的,这是一个已知的限制.您应该避免在FullTextSQL中使用LIKE谓词,而应使用CONTAINS谓词.它与Path托管属性一起使用时效果很好.在这种情况下,只需执行CONTAINS(Path,'http://servername/sitename/listname/folder').
Yes this is a known limitation. You should avoid using the LIKE predicate in FullTextSQL and use the CONTAINS predicate. It works very well with the Path managed property. In you case just do CONTAINS(Path,'http://servername/sitename/listname/folder').


这篇关于搜索“路径以...开头".与LIKE谓词一起被截断64个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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