问题标签 [windows-search]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
68 浏览

visual-c++ - 仅搜索文件名

我想通过 visual c++ 仅搜索“Windows Search API”中的文件名。而且我不想搜索内容,因为它很耗时。“windows search API”有这个选项吗?

0 投票
1 回答
515 浏览

vb.net - WIndows Search(Win 2008R2)/Indexing Service(Win2003) 对 Directory.GetFiles(searchPattern, SearchOption.AllDirectories) 方法有影响吗?

Directory.GetFiles 方法尝试从 Win2008R2 VMServer 上的 UNC 文件夹共享(NTFS 磁盘)搜索 Word 文档时遇到了一个奇怪的问题。该共享在父文件夹中包含超过 10K 文件,在子目录中包含 75K 文件。

在 Win2003 Server 中一切正常。当迁移到 Win2008R2 服务器时,WinForms 应用程序会冻结此方法,并且需要将近 13 分钟才能从通过下载速度带宽为 1Mbps(不是吞吐量)的 VPN 网络连接到文件共享的客户端计算机上打开单个文件。

经过搜索和研究,我们发现 Windows Search 服务没有打开,服务已启动,共享已被索引。我们看到了性能改进,使用 GetFiles 方法打开文件所需的时间从 13 分钟降至 3 分钟。

但这并不一致。在带宽远低于 1MBPS(例如 0.5 MBPS)的白天时间,打开文档的时间跨度再次介于 8-12 分钟之间。

在这一点上,我们不确定是哪一个导致了问题?

不可能的解决方案:1)创建多个目录并组织文件。2)增加带宽。3) 使用直接文件路径而不是 Directory.GetFiles/EnumerateFiles

非常感谢任何帮助。谢谢!

0 投票
1 回答
1373 浏览

c# - 如何使用 windows search api 将文件夹添加到 windows 索引列表中

在索引选项中,“索引这些位置”中有一个位置列表,有没有办法通过 c# 将我的应用程序创建的文件夹添加到列表中?

0 投票
1 回答
452 浏览

asp.net-mvc - 文档索引 Asp.net

我的任务是索引大量文档(允许全文搜索),然后使用 ASP.net 搜索此索引

我使用的是 Windows Server 2012 环境。

我已经做了一些阅读,但我仍然不确定要使用什么索引服务。

我已阅读有关“Microsoft 索引服务”(我已阅读已过时)和“Windows Search”服务的信息。

任何人都可以推荐一个合适的服务来使用,最好是一些关于如何使用它的指针?

0 投票
1 回答
736 浏览

java - 使用 Java Jacob 库设置 MaxRecords

我正在尝试通过使用java Jacob 库来使用 Windows Search。但我无法指定maxRecords限制返回行数的选项。

我试图通过使用这条线来做到这一点:

建立连接后:

我究竟做错了什么?编译没有错误,但在执行时我收到以下消息:

com.jacob.com.ComFailException:遇到 COM 异常:
调用时:MaxRecords
描述:80020007 / 无命名参数。
...
内部服务器错误 (500) - 服务器遇到意外情况,无法完成请求

而这个通过我的restful通过URL访问时:

内部服务器错误

服务器遇到了一个意外情况,导致它无法完成请求。您可以在此处获取技术详细信息。请继续访问我们的主页。

没有那条线,一切都很好。

0 投票
1 回答
338 浏览

windows - 在 Windows 搜索上更改 System.DateModified 格式

我正在使用 Windows 索引搜索和 PHP 来搜索数千个文件。

我通过使用 PHP COM 类让它工作:

我正在检索DateModified每个元素的字段,并且我已经意识到它的格式取决于系统配置。可以通过 Windows 的控制面板进行设置。

我想知道是否有任何方法可以将其转换为所需的格式,以避免通过在我要运行脚本的每个系统中使用控制面板来更改它。

我注意到该对象具有该属性formatAs,但我不确定如何更改它并且文档不是很完整。

谢谢。

0 投票
1 回答
319 浏览

c# - C# SystemIndex catlog 未检索最近添加的文件

我正在查询 SystemIndex catlog 以显示我的应用程序中最近添加的文件。但有时,SystemIndex 不会显示最近添加的文件。我们有解决这个问题的办法吗?

我的查询如下

SELECT "System.ItemName", "System.ItemFolderPathDisplay" FROM "SystemIndex" WHERE CONTAINS(*,'"searchterm"',1033) AND (System.FileName LIKE '%.doc' OR System.FileName LIKE '%.txt' ) AND Contains(System.Kind, 'document') ORDER BY System.FileName ASC

感谢您的帮助和提前的时间。

0 投票
1 回答
3425 浏览

sql-server-2008-r2 - Full-text search using Windows Search Service and SQL Server 2008 R2

Currently I'm trying to query the Windows Search Service from a SQL Server 2008 R2 instance (also tested on SQL Server 2012) . Windows Search is being exposed as an OLE DB datasource, giving me several options to query the search index. When configuring a new Linked Server in SQL Server, Management Studio gives me the option to select the Microsoft OLE DB Provider for Search, implying that I should be able to connect to it from SQL Server. It turns out to be a challenge to get this up and running however. Below you'll find the error message I stumbled upon.

OLE DB provider "Search.CollatorDSO" for linked server "TESTSERVER" returned message "Command was not prepared.".
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "Search.CollatorDSO" for linked server "TESTSERVER" reported an error. Command was not prepared.
Msg 7350, Level 16, State 2, Line 2
Cannot get the column information from OLE DB provider "Search.CollatorDSO" for linked server "TESTSERVER".

Things get even more interesting. Although the Linked Server solution isn't working, I'm able to wrap code that queries Windows Search in a CLR Function (using MSDN: Querying the Index Programmatically) and use if successfully within SQL Server. This is however less desirable, because of the steps needed to set it up (deploying the library, configuring permissions, etc.). I've tried several parameter settings, without any luck. I've also tried enabling some of the Search.CollatorDSO provider options, like allowing the provider to be instantiated as an in-process server. I'm currently using the settings below. For security I'm using the login's current security context.

  • Provider: Microsoft OLE DB Provider for Search
  • Data source: (local)
  • Provider string: Provider=Search.CollatorDSO.1;EXTENDED?PROPERTIES="Application=Windows"
  • Location: -

Additionally I need to search network drives, can this be done using shared Windows libraries?

I'm aware more people have been struggling with this problem over the last few years. I'm wondering if someone has been able to get this up and running, or could point me in the right direction.

OLEDB Works

Normal ADO/OLEDB components can query the Windows Search service with the connection string:

And an example query:

You can try the query directly on SQL Server in SQL Server Management Studio by attempting to run:

Which gives the errors:

Bonus Reading

0 投票
0 回答
292 浏览

php - 获取variant_date_to_timestamp() 函数的错误值

关于这个问题,在查询用于索引文件的 Windows ADODB 连接时,我得到了修改日期的错误值。

这是行或查询:

我在本地主机(php 5.5.6)上得到了很好的结果,但在其他服务器上却没有(php 5.5.8)。我得到了错误的timestamp值,因此当我使用 PHP 函数创建我的自定义格式时,它会将其转换为错误的日期:

预期结果和我得到的结果之间有几个小时的不同。(2小时)

这似乎与variant_date_to_timestampPHP的功能有关。我已经date.timezonephp.ini文件中设置了正确的,并在date_default_timezone_set调用之前添加了调用 variant_date_to_timestamp

我正在使用PHP 5.5.8。

在 2004 上发现了一个类似的问题/错误。它还谈到了两个小时的差异。我很难相信它还没有解决。

0 投票
0 回答
354 浏览

c# - C# Windows Search:如何在没有互操作库的情况下检测某个位置是否在搜索索引中?

我们在我们的应用程序中使用 Windows 搜索,并且需要一种方法来检测文件夹是否被索引。
我知道两种方法:
1. 使用Microsoft.Search.Interop.dll库。
2. 使用Windows Search 示例代码(可能有点改变)作为从 C# 应用程序调用的 .exe 文件。

这两个解决方案需要使用外部文件(.dll.exe),但我需要一个更简单的解决方案,因为它将是由向导为我们的客户生成的 WebDAV 服务器的简单新的可选搜索功能。此外Microsoft.Search.Interop.dll是针对 .NET 2.0 的,从 .NET 4.0 池下的 IIS 使用它可能会出现问题(取决于池设置)。

有没有什么方法可以使用接口而不像在C++ 示例中那样ISearchCrawlScopeManager链接到任何(只是到 COM)?.dllCrawl Scope Command Line

UPDATE1:看起来ISearchCrawlScopeManager界面位于Search Interface Type Library. 它还没有完成,但我已经接近了。感谢汉斯·帕桑特。