标签: windows-search

如何启动/停止/暂停 Windows 搜索索引器

我想确定如何从 Microsoft Search 以编程方式启动/停止/暂停索引器。

我知道这是可能的,因为我已经看到它在这样的程序中完成:http : //brandontools.com/files/folders/sidebar_gadgets/entry511.aspx

但是,我在 MSDN 或任何地方都找不到任何文档。

有一个“Windows Search”服务,可以用传统的服务控制方法来控制。但是,启动/停止此服务也会改变搜索本身的可用性。我只想控制索引器。

有谁知道在哪里可以找到描述如何与索引器交互的文档?我的搜索技巧失败了。

windows-search

5
推荐指数
1
解决办法
2万
查看次数

在IIS7上部署ASP.NET OLEDB代码时会中断

我正在尝试编写一个简单的网站(ASP.NET v4),它将调用Windows搜索,找到一个特定的文件并将其返回给用户.我将以下内容放在一起作为示例:它在"remoteserver"上调用Windows Search服务,并返回"somefile.txt"的路径:

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString = "Provider=Search.CollatorDSO;Extended Properties='Application=Windows';";

OleDbCommand cmd = conn.CreateCommand();


cmd.CommandText = string.Format(
            "SELECT System.ItemPathDisplay, System.ItemType FROM " +
            " sytelhp.systemindex WHERE SCOPE='file://remoteserver/archive' AND CONTAINS(\"System.FileName\", " +
            " '\"*{0}*\"')", "somefile.txt");


conn.Open();

OleDbDataReader rdr = cmd.ExecuteReader();

string result=rdr[0].ToString();
Run Code Online (Sandbox Code Playgroud)

..这在Visual Studio 2010开发环境中效果很好,"结果"包含文件的路径.但是,如果我将其部署到本地IIS7服务器(在Server 2008上运行),我会收到此错误:

The parameter is incorrect. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in …
Run Code Online (Sandbox Code Playgroud)

asp.net oledb windows-search

5
推荐指数
1
解决办法
4305
查看次数

Windows 8.1应用内搜索控制和搜索窗格(搜索超级按钮)?

我正在尝试在WinJS中使用新的8.1 ​​SearchBox控件,但如果我已将搜索合约绑定到我的应用程序以获取搜索超级按钮,则会收到拒绝访问错误: Can't hide this app in the search pane because the app has already accessed the search pane.

我是否可以同时使用新的搜索控件和搜索窗格?

windows-search windows-8 winjs windows-8.1

5
推荐指数
1
解决办法
879
查看次数

如何使用Windows搜索API将文件夹添加到Windows索引列表中

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

c# windows-search

5
推荐指数
1
解决办法
1051
查看次数

当我指定机器名时,无法在我自己的机器上查询SystemIndex

我正在尝试编写一个简单的程序,它将连接到远程计算机并查询索引状态.

这是在我的机器上执行的代码.这很好用.

using System;
using Microsoft.Search.Interop;

namespace IndexStatus
{
    class Program
    {
        static void Main(string[] args)
        {
            CSearchManager manager = new CSearchManager();
            CSearchCatalogManager catalogManager = manager.GetCatalog("SystemIndex");
            _CatalogPausedReason pReason;
            _CatalogStatus pStatus;
            Console.WriteLine(catalogManager.NumberOfItems().ToString());
            int plIncrementalCount;
            int plNotificationQueue;
            int plHighPriorityQueue;
            catalogManager.NumberOfItemsToIndex(out plIncrementalCount, out plNotificationQueue, out plHighPriorityQueue);
            Console.WriteLine(plIncrementalCount.ToString());
            Console.WriteLine(plNotificationQueue.ToString());
            Console.WriteLine(plHighPriorityQueue.ToString());
            catalogManager.GetCatalogStatus(out pStatus, out pReason);
            Console.WriteLine(pStatus.ToString() + " " + pReason.ToString());
            Console.ReadLine();
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

然而,当我打电话GetCatalog"mycomputername.SystemIndex",而不是"SystemIndex",我得到

IndexStatus.exe中发生未处理的"System.Runtime.InteropServices.COMException"类型异常

附加信息:HRESULT的异常:0x80042103

在此输入图像描述

Visual Studio 2015在Windows 8.1上以管理员权限运行.目标计算机主要是Windows 7系统,程序主要从Windows 10系统运行.我正在使用从此处下载的Microsoft Windows Search 3.X …

c# windows windows-search

5
推荐指数
1
解决办法
491
查看次数

使用 Python 查询 Microsoft 搜索索引

我试图找到一种在 Windows 搜索索引上运行 SQL 查询的方法。

使用 .NET 或 Powershell 很容易做到这一点,但无论我做什么,我似乎都无法让它在 Python 中工作。

我尝试使用 PyODBC 并使用 JET4 驱动程序,但遇到了一大堆错误。然后,我尝试使用 win32con 客户端进行 ADO 连接,但这也没有成功。

我尝试在某些地方说明提供者作为MSIDXS.1或作为Search.CollatorDSO提供者,甚至尝试直接访问 EDB 文件,但没有运气。

有没有人曾经设法这样做,或者知道可能是什么问题?

作为参考,我附上了执行此操作的 Powershell 和 C# 脚本示例的链接: - https://www.petri.com/how-to-query-the-windows-search-index-using-sql-and -powershell - https://msdn.microsoft.com/en-us/library/windows/desktop/ff684395(v=vs.85).aspx

我可以使用 VB 脚本并将查询作为参数来处理它,但对我来说感觉很蹩脚...

编辑:我现在似乎连接到正确的数据库,但出现错误:

我的代码:

    conn = win32com.client.Dispatch('ADODB.Connection')
    #DSN = ('Provider=MSIDXS.1;Data Source=SYSTEMINDEX;')
    DSN = ('Provider=MSIDXS.1;Data Source=myCatalog;')
    conn.Open(DSN)
    rs = win32com.client.Dispatch(dispatch='ADODB.Recordset')
    strsql = r'SELECT 
Run Code Online (Sandbox Code Playgroud)

错误:

Traceback (most recent call last):
File "E:/Automation Scripts/123456/searchIndexQuery.py", line 48, in <module>
searchIndexConnector().ado()
File "E:/Automation Scripts/123456/searchIndexQuery.py", line …
Run Code Online (Sandbox Code Playgroud)

python ado windows-search

5
推荐指数
0
解决办法
635
查看次数

如何在Visual Basic应用程序中打开"Windows搜索"?

如何使用Visual Basic为应用程序中的特定文件夹打开"Windows Search Companion"或"Windows Basic Search"?

在此输入图像描述

我找到了这篇文章,但这不是我想要的.

vb.net vb6 vba windows-search

4
推荐指数
1
解决办法
1744
查看次数

标签 统计

windows-search ×7

c# ×2

ado ×1

asp.net ×1

oledb ×1

python ×1

vb.net ×1

vb6 ×1

vba ×1

windows ×1

windows-8 ×1

windows-8.1 ×1

winjs ×1