索引服务空文件名属性
我是第一次使用 Windows 索引服务,我需要从查询中返回文档标题和文件名。
我的查询是;
select doctitle, filename, vpath, rank, characterization from scope() where FREETEXT(Contents, '" & searchText & "') order by rank desc
我设置了一个相当基本的目录,仅指向一个文件夹。我正在使用网站上的代码,文件位于本地计算机上,身份验证应该不成问题。
我的搜索返回结果,但文件名属性中没有任何内容。文档标题已填充,但没有其他内容。
谢谢, 麦克风
I'm using the Windows Indexing Service for the first time and I need to return the doctitle and filename from the query.
My query is;
select doctitle, filename, vpath, rank, characterization from scope() where FREETEXT(Contents, '" & searchText & "') order by rank desc
I setup a fairly basic catalogue just pointing to a folder. I'm using this code from a website, the files are on the local machine and authentication shouldn't be a problem.
My search returns results but nothing in the filename property. The doctitle is populated but nothing else.
Thanks,
Mike
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这个问题已经有几个月了,但我目前正在 Windows Server 2008 R2 上使用 C# 使用 WIS,并在搜索中发现了这个问题。有时我无法接受“不”的答案,所以我在互联网上搜索并想出了这个解决方案。
我确信您可以根据需要转换代码,但是...
您必须从服务器管理器的角色安装 Windows Server 2003 文件服务索引服务。
对于目录属性,我禁用了可继承设置并相应地设置了 WWW 服务器。我还生成了 250 个字符的摘要,存储在“特征”列中。
当我设置目录时,我包含/排除了网站目录的某些文件夹(包括网站根目录),当我查询它时,我使用了以下 SQL 语句:
编辑: 注意使用
FREETEXT(Filename, '\""+q+"\"'))
查询文件的名称我使用 using 语句创建连接:
我遇到的问题之一是某些文件类型。如果文档创建者未在其 MS Office 产品中包含文档标题,您将无法获得 DocTitle。如果 pdf 中没有任何可识别的文本并且未填写文档属性,则 docTitle 和 Content 将为空。我的看法是,如果企业不使其文件符合 508 标准,它们就不会正确显示在结果中。
这是我正在使用的 ListView 模板的快速片段。
由于我的例子中的 docTitle 用于结果标题,因此我认为如果它为空,我可以采用该空字符串并将其替换为文件名,减去扩展名。
进行查询时,请确保您还使用关键字和描述正确使用元标记。 WIS 会读取该内容以及 .aspx 页面上的静态内容。您会注意到我使用特征化来检索内容。
此链接提供了有关设置 W2k8 WIS 以及 vb.net 代码的说明。
此链接是众多属性的良好来源可以查询和/或显示。
I know it's been a few months since this has been answered, but I'm currently using WIS on Windows Server 2008 R2 using C# and came across this on a search. Sometimes I can't take no for an answer, so I had scoured the internet and came up with this solution.
I'm sure you can convert the code as necessary, but...
You'll have to install the Windows Server 2003 File Services Indexing Service from the Server Manager's Roles.
For the catalog properties, I disabled the Inheritable Settings and set the WWW Server appropriately. I also generated 250 character abstracts to be stored in the Characterization column.
When I set up my catalog, I included/excluded certain folders of my web site's directory (include the site root) and when I queried it, I used the below SQL statement:
EDIT: Note the use of
FREETEXT(Filename, '\""+q+"\"'))
to query the name of the fileI create my connection using the using statement:
One of the issues that I have run into is with certain filetypes. If the document creator didn't include a document title in their MS Office product, you won't get the DocTitle. If the pdf doesn't have any recognizable text in it and the document properties are not filled out, the docTitle and Content will be empty. The way I look at it, is if the business doesn't make their files 508 compliant, they won't show up in the results properly.
Here's a quick snippet of the ListView template that I am using.
Since the docTitle in my case is used for the results header, I figured that if it's empty, I can take that empty string and replace it with the filename, minus the extention.
When making the query, make sure that you also properly use your meta tags using the keywords and description. This and the static content on the .aspx pages does get read by WIS. You'll note my use of Characterization to retrieve the contents.
This link provides instructions on setting up the W2k8 WIS along with vb.net code.
This link is a good source for the multitude of properties that can be queried and/or displayed.
我在这篇文章中找到了答案;
http://support.microsoft.com/kb/954822
索引服务的后继者是Windows Search。
Windows Search Wiki
看来我必须更改站点才能使用 Windows Search。
I found the answer in this article;
http://support.microsoft.com/kb/954822
The successor or the Indexing Service is Windows Search.
Windows Search Wiki
Looks like I'm going to have to change the site to use Windows Search.