Windows file server search

Windows Search Overview

Windows Search is a desktop search platform that has instant search capabilities for most common file types and data types, and third-party developers can extend these capabilities to new file types and data types.

This topic is organized as follows:

Introduction

Windows Search is a standard component of WindowsВ 7 and WindowsВ Vista, and is enabled by default. Windows Search replaces Windows Desktop Search (WDS), which was available as an add-in for WindowsВ XP and Windows ServerВ 2003.

Windows Search is composed of three components:

Windows Search Service

The WSS organizes the extracted features of a collection of documents. The Windows Search Protocol enables a client to communicate with a server that is hosting a WSS, both to issue queries and to enable an administrator to manage the indexing server. When processing files, WSS analyzes a set of documents, extracts useful information, and then organizes the extracted information so that properties of those documents can be efficiently returned in response to queries.

A collection of documents that can be queried comprises a catalog, which is the highest-level unit of organization in Windows Search. A catalog represents a set of indexed documents that can be queried. A catalog consists of a properties table with the text or value and corresponding location (locale) stored in columns of the table. Each row of the table corresponds to a separate document in the scope of the catalog, and each column of the table corresponds to a property. A catalog may contain an inverted index (for quick word matching) and a property cache (for quick retrieval of property values).

The indexer process is implemented as a Windows service running in the LocalSystem account and is always running for all users (even if no user is logged in), which permits Windows Search to accomplish the following:

  • Maintain one index that is shared among all users.
  • Maintain security restrictions on content access.
  • Process remote queries from client computers on the network.

The Search service is designed to protect the user experience and system performance when indexing. The following conditions cause the service to throttle back or pause indexing:

  • High CPU usage by non-search-related processes.
  • High system I/O rate including file reads and writes, page file and file cache I/O, and mapped file I/O.
  • Low memory availability.
  • Low battery life.
  • Low disk space on the drive that stores the index.

Development Platform

The preferred way to access the Search APIs and create Windows Search applications is through a Shell data source. A Shell data source is a component that is used to extend the Shell namespace and expose items in a data store. A data store is a repository of data. A data store can be exposed to the Shell programming model as a container that uses a Shell data source. The items in a data store can be indexed by the Windows Search system using a protocol handler.

For example, ISearchFolderItemFactory is a component that can create instances of the search folder data source, which is a sort of «virtual» data source provided by the Shell that can execute queries over other data sources in the Shell namespace and enumerate results. It can do so either by using the indexer or by manually enumerating and inspecting items in the specified scopes. This interface permits you to set up the parameters of the search by using methods that create and modify search folders. If methods of this interface are not called, default values are used instead.

Accessing the Windows Search capability indirectly through the Shell data model is preferred because it provides access to full Shell functionality at the level of the Shell data model. For example, you can set the scope of a search to a library (which is a feature available in WindowsВ 7 and later) to use the library folders as the scope of the query. Windows Search then aggregates the search results from those locations if they are in different indexes (if the folders are on different computers). The Shell data layer also creates a more complete view of items’ properties, synthesizing some property values. It also provides access to search features for data stores that are not indexed by Windows Search. For example, you can search a Universal Serial Bus (USB) storage devices, portable device that uses the MTP protocol, or an File Transfer Protocol (FTP) server through the Shell data sources that provides access to those storage systems. Doing so ensures a better user experience.

Windows Search has a cache of property values that is used in the implementation of the Windows Search Service (WSS). These property values can be programmatically queried by using the Windows Search OLEВ DB provider, or through ISearchFolderItemFactory, which represents items in search results and query-based views. Windows Search then collects and stores properties emitted by filter handlers or property handlers when an item such as a Word document is indexed. This store is discarded and rebuilt when the index is rebuilt.

Third-party developers can create applications that consume the data in the index through programmatic queries, and can extend the data in the index for custom file and item types to be indexed by Windows Search. If you want to show query results in Windows Explorer, you must implement a Shell data source before you can create a protocol handler to extend the index. However, if all queries are programmatic (through OLEВ DB for example) and interpreted by the application’s code rather than the Shell, a Shell namespace is still preferred but not required.

Читайте также:  Разбивка диска под линукс минт

A protocol handler is required for Windows to obtain information about file contents, such as items in databases or custom file types. While Windows Search can index the name and properties of the file, Windows has no information about the content of the file. As a result, such items cannot be indexed or exposed in the Windows Shell. By implementing a custom protocol handler, you can expose these items. For a list of handlers identified by the developer scenario you are trying to achieve, see «Overview of Handlers» in Windows Search as a Development Platform.

A Shell data source is sometimes known as a Shell namespace extension. A handler is sometimes known as a Shell extension or a Shell extension handler.

User Interface

In WindowsВ Vista and later, Windows Search is integrated into all Windows Explorer windows for instant access to search. This enables users to quickly search for files and items by file name, properties, and full-text contents. Results can also be filtered further to refine the search. Here are some more features of Windows Search:

  • An instant search box in every window enables instant filtering of all items currently in view. Instant search boxes appear in the Start menu to search for programs or files, and in the upper-right corner of all Windows Explorer windows to filter the results shown. Instant search is also integrated into some other Windows features, such as Windows Media Player, to find related files.
  • Documents can be tagged with keywords to group them by custom criteria that are defined by the user. Tags are metadata items that are assigned by the user or applications to make it easier to find files based on keywords that may not be in the item name or contents. For example, a set of pictures might be tagged as «Arizona Vacation 2009» to quickly retrieve later by searching for any of the included words.
  • Enhanced column headers in Windows Explorer views enable sorting and grouping documents in different ways. For example, files can be sorted according to name, date modified, type, size, and tags. Documents can also be grouped according to any of these properties and each group can be filtered (hidden or displayed) as desired.
  • Documents can be stacked according to name, date modified, type, size, and tags. Stacks include all documents that have the specified property and are located within any subfolder of the selected folder.
  • Searches can be saved (to be retrieved later) by clicking the Save Search button in the search pane in Windows Explorer. The results will be dynamically repopulated based on the original criteria when the saved search is opened. For instructions, see Save Your Search Results.
  • Preview handlers and thumbnail handlers enable users to preview documents in Windows Explorer without having to open the application that created them.

Technical Prerequisites

Before you start reading the Windows Search SDK documentation, you should have a fundamental understanding of the following concepts:

  • How to implement a Shell data source.
  • How to implement a handler.
  • How to work in native code.

A Shell data source is a component that is used to extend the Shell namespace and expose items in a data store. In the past, the Shell data source was referred to as the Shell namespace extension. A handler is a Component Object Model (COM) object that provides functionality for a Shell item. For a list of handlers identified by the developer scenario you are trying to achieve, see «Overview of Handlers» in Windows Search as a Development Platform.

For more information about the Windows Search SDK interoperability assembly for working with COM objects that are exposed by Windows Search and other programs that use managed code, see Using Managed Code with Shell Data and Windows Search. However, note that filters, property handlers, and protocol handlers must be written in native code. This is due to potential common language runtime (CLR) versioning issues with the process that multiple add-ins run in. Developers who are new to C++ can get started with the Visual C++ Developer Center and Windows Development Getting Started.

SDK Download and Contents

In addition to meeting the listed technical prerequirements, you must also download the Windows SDK to get the Windows Search libraries. The Windows Search SDK Samples contain useful code samples and an interoperability assembly for developing with managed code. For more information on using the code samples, see Windows Search Code Samples.

Windows Search SDK Documentation

The contents of the Windows Search SDK documentation are as follows:

Outlines the main development scenarios in Windows Search. Provides a list of handlers identified by the development scenario you are trying to achieve, add-in installer guidelines, and implementation notes.

Describes the Search API code samples that are available.

Describes WindowsВ 7 support for search federation to remote data stores using OpenSearch technologies that enable users to access and interact with their remote data from within Windows Explorer.

Lists technologies related to Windows Search: Enterprise Search, SharePoint Enterprise Search, and legacy applications such as Windows Desktop Search 2.x and Platform SDK: Indexing Service.

Defines essential terms used in Windows Search and Shell technologies.

Windows Search replaces Windows Desktop Search (WDS), which was available as an add-in for WindowsВ XP and Windows ServerВ 2003. WDS replaced the legacy Indexing Service from previous versions of Windows with enhancements to performance, usability, and extensibility. The new development platform supports requirements that produce a more secure and stable system. While the new querying platform is not compatible with MicrosoftВ Windows Desktop Search (WDS) 2.x, filters and protocol handlers written for previous versions of WDS can be updated to work with Windows Search. Windows Search also supports a new property system. For information on filters, property handlers, and protocol handlers, see Extending the Index.

Читайте также:  Grub uefi add windows

Windows Search is built into WindowsВ Vista and later, and is available as a redistributable update to WDS 2.x, to support the following operating systems:

  • 32-bit versions of WindowsВ XP with Service Pack 2 (SP2).
  • All x64-based versions of WindowsВ XP.
  • Windows ServerВ 2003 with Service Pack 1 (SP1) and later.
  • All x64-based versions of Windows ServerВ 2003.

Systems running these operating systems must have Windows Search installed in order to run applications written for Windows Search. For more information, see KB article 917013: Description of Windows Desktop Search 3.01 and the Multilingual User Interface Pack for Windows Desktop Search 3.01.

Как отключить (включить) индексирование поиска (службу Windows Search) в Windows

Проблемы: как они себя проявляют

Как оказалось, наиболее типичные проблемы с индексированием Windows нередки, но пользователь редко придаёт им значение. При этом ошибки в индексировании большинство склонно относить к “криворукости разработчиков” Windows. Но вот, пожалуй, самые из них распространённые:

  • в результатах поиска через Windows/File Explorer в индексе нужные файлы не обнаруживаются. Но вы точно знаете, что они там есть…
  • в результатах поиска появляются, наоборот, файлы-фантомы, которые давно с компьютера удалены
  • служба Windows Search “падает” с ошибкой 0x80070002 или 0x80070005

Где находится поисковый индекс, и как изменить его содержимое?

По умолчанию он располагается по пути C:ProgramDataMicrosoftSearch, хотя сама утилита запускается из папки C:WindowsSystem32. Его расположение также можно изменить, при этом придётся перезапустить саму службу, очистить результаты и сформировать индекс заново. Самый простой вариант добавить что-либо к индексу, это добавить папку в его библиотеку прямо из указанного окна. В соседней вкладке можно “отрегулировать” список расширений, которые в индекс попадут. Нужное нам окно открывается аплетом

после вызова строки ВыполнитьWIN + R :

Отключаем индексирование Windows 10 в параметрах панели управления

Стандартный метод настройки и отключения индексирования Windows 10 — использование соответствующего раздела в панели управления:

  1. Откройте панель управления, а затем — Параметры индексирования. Можно просто начать набирать в поиске на панели задач слово «Индексирование», чтобы быстро открыть нужный пункт.
  2. В открывшемся окне вы увидите список расположений, для которых включено индексирование. Чтобы изменить этот список нажмите кнопку «Изменить».
  3. Снимите отметки с тех расположений, которые не требуется индексировать и примените настройки.

Дополнительно, вы можете отключить индексирование содержимого файлов на отдельных дисках (например, только для SSD) как самую затратную по ресурсам операцию индексирования. Для этого достаточно выполнить следующие шаги.

  1. Откройте свойства нужного диска.
  2. Снимите отметку «Разрешить индексировать содержимое файлов на этом компьютере в дополнение к свойствам файлам» и примените сделанные настройки.

Как видите, все сравнительно несложно, но при этом сама служба индексирования на компьютере продолжает работать.

Как отключить индексирование

Чтобы отключить индексирование поиска (службу поиска Windows Search), откройте консоль «Службы», для этого нажмите сочетание клавиш

+ R, в открывшемся окне Выполнить введите services.msc и нажмите клавишу Enter↵.

В окне Службы дважды щёлкните левой кнопкой мыши службу Windows Search.

В открывшемся окне Свойства: Windows Search (локальный компьютер) остановите службу нажав кнопку Остановить.

Затем в выпадающем списке Тип запуска: выберите пункт Отключена и нажмите кнопку OK.

Включение индексирования поиска

Чтобы включить индексирование поиска (службу поиска Windows Search), откройте консоль «Службы», для этого нажмите сочетание клавиш

+ R, в открывшемся окне Выполнить введите services.msc и нажмите клавишу Enter↵.

В окне Службы дважды щёлкните левой кнопкой мыши службу Windows Search.

В открывшемся окне Свойства: Windows Search (локальный компьютер) в выпадающем списке Тип запуска: выберите пункт Автоматически (отложенный запуск) и нажмите кнопку Применить.

Затем запустите службу нажав кнопку Запустить.

Управление через командную строку

Также отключить или включить индексирование поиска (службу поиска Windows Search) можно используя командную строку.

Чтобы отключить индексирование поиска (службу поиска Windows Search), запустите командную строку от имени администратора и выполните следующую команду:

sc stop «wsearch» && sc config «wsearch» start=disabled

Чтобы включить индексирование поиска (службу поиска Windows Search), запустите командную строку от имени администратора и выполните следующую команду:

sc config «wsearch» start=delayed-auto && sc start «wsearch»

Отключение службы индексирования Windows 10 (Windows Search)

Если вам требуется полностью отключить индексирование Windows 10, сделать это можно путем отключения соответствующей системной службы, которая называется Windows Search:

  1. Нажмите клавиши Win+R на клавиатуре, введите services.msc
  2. Найдите в списке служб «Windows Search».
  3. В типе запуска установите «Отключена», примените настройки и перезагрузите компьютер (если просто отключить и остановить, она запустится снова).

После этого индексирование в Windows 10 будет полностью отключено, но поиск по параметрам, системным элементам и установленным программам в панели задач продолжит работать, равно как и поиск по файлам, если использовать окно поиска в проводнике (в последнем случае вы будете видеть уведомление о том, что поиск может быть медленным, так как индексирование не выполняется).

Самый «правильный», но не самый эффективный способ уменьшить размер файла Windows.edb – запустить процесс переиндексации данных в системе. Для этого откройте Панель Управления -> IndexingOptions -> Advanced -> Rebuild (для открытия этого диалога достаточно выполнить команду rundll32.exe shell32.dll,Control_RunDLL srchadmin.dll).

Через некоторое время (как правило довольно продолжительное), система закончит переиндексацию данных и размер edb файла несколько уменьшится.

Дефрагментация Windows.edb с помощью Esentutl

Так как индексный файл службы поиска Windows представляет собой базу в формате EDB, можно выполнить ее дефрагментацию с помощью стандартной утилитой для обслуживания таких баз esentutl.exe — Extensible Storage Engine Utilities (должна быть хорошо знакома администраторам Exchange). Дефрагментация базы выполняется в офлайн режиме (база не должна использоваться), поэтому сначала придется остановить службы поиска. Все эти операции можно объединить в один скрипт:

sc config wsearch start=disabled
sc stop wsearch
esentutl.exe /d %AllUsersProfile%MicrosoftSearchDataApplicationsWindowsWindows.edb
sc config wsearch start=delayed-auto
sc start wsearch

Совет. Для выполнения дефрагментации на диске должно быть достаточно свободного места, т.к. будет создана копия edb файла.

Утилита esentutl в процессе работы отображает прогресс выполнения дефрагментации на экране.

Читайте также:  Windows user picture frame

Примечание. Если при выполнении команды esentutl появляется ошибка: Operation terminated with error -1213 (JET_errPageSizeMismatch, The database page size does not match the engine) after 10.125 seconds, это означает что ваша система 64 битная и для выполнянения дефрагментации нужно использовать x32 версию esentutl. Т.е. третья команда будет выглядеть так:
«C:WindowsSysWOW64esentutl.exe» /d %AllUsersProfile%MicrosoftSearchDataApplicationsWindowsWindows.edb

В моем случае размер edb файла после дефрагментации уменьшился на 30%.

Удаление и пересоздание файла Windows.edb

Если места на диске критически мало, можно безопасно удалить файл Windows.edb. Для этого, остановите службу Windows Search и удалите файл.

net stop «Windows Search»
del %PROGRAMDATA%MicrosoftSearchDataApplicationsWindowsWindows.edb
net start «Windows Search»

После перезапуска, служба Windows Search начнет процесс переиндексации системы и пересоздаст файл Windows.edb (в процессе полной переиндексации производительность системы может снизится).

Перенос файла Windows.edb на другой диск

В некоторых случаях, когда размер файла постоянно увеличивается Windows.edb, имеет смысл перенести индексную базу поиска Windows на другой том. Тем самым экстремальный рост базы не приведет к остановке системы при исчерпании свободного места на системном разделе. Как правило, это необходимо выполнять на терминальных серверах RDS, на которых пользователи активно работают с файлами, личными папками и другим индексируемым контентом.

Для смены местоположения файла откройте Control PanelIndexing OptionsAdvanced Index location->New Location и укажите путь к новому местоположению файла Windows.edb.

Исправление для предотвращения чрезмерного роста файла Windows.edb в Windows 8 / Windows Server 2012

Для решения проблема постоянного роста размера файла Windows.edb в Windows 8 и Windows Server 2012 было выпущено специальное исправление, которое включено в состав пакета обновлений от мая 2013 года – KB 2836988. Рекомендуется скачать и установить его в данных версиях Windows.

Поле поиска отсутствует

В проводнике Windows:

Откройте Панель управления> Программы и компоненты> Включение или отключение функций Windows.

Установите флажок «Поиск Windows», чтобы получить его обратно.

Чтобы отключить поиск Windows, снимите этот флажок. Нажмите OK и для Windows, чтобы настроить параметры.

SearchIndexer.exe нагружает процессор

Что это значит? Профессионалы могут со мной поспорить, но более 15-20%% загрузки процессора индексирование Windows по опыту забирать не должно. Так что…

  • перезапускаем знакомую службу, Остановив и заново Запустив прямо из окна служб Windows
  • перестроим индекс Windows (без сброса); вариант доступен прямо из окна с расположением индексирования
  • если вы желаете перестроить индекс и плюсом сбросить имеющиеся данные индексирования, лучше отключить службу через реестр (в разделе HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows Search

    параметру SetupCompletedSuccessfully присвоить значение 0, а после этого в службах Windows перезапустить Windows Search)

  • проследим за проблемой из Монитора ресурсов. Запускаем его быстрой командой:

Во вкладке Обзор в разделе ЦП найдём ИД процесса SearchIndex.exe. Сразу переходим ниже в раздел Диск. Отсюда выцепляем по ИД с какими файлами процесс работает. Если заметите что-то необычное, отправьтесь в окно Индекса (см.выше) и отключите директорию с файлом целиком из индекса. Вы это уже умеете в окне Индексируемые расположения:

Проверьте, разрешилась ли проблема. Также в мониторе ресурсов проверьте всё, что связано с процессом searchprotocolhost.exe, если тот запущен.

  • прогоним систему утилитами DISM и SFC. Для Windows 7 сработает только одна утилита из списка ремонтных программ Windows. Запустите последовательно из консоли команд от имени администратора:

sfc /scannow sfc /scannow /offbootdir=c: /offwindir=c:windows

Перезагрузитесь для применения изменений. Если вы владелец Windows 10, ремонт файловой системы можно продолжить последовательными командами

Dism /Online /Cleanup-Image /CheckHealth Dism /Online /Cleanup-Image /ScanHealth Dism /Online /Cleanup-Image /RestoreHealth Dism /Image:C:offline /Cleanup-Image /RestoreHealth /Source:c:testmountwindows Dism /Online /Cleanup-Image /RestoreHealth /Source:c:testmountwindows /LimitAccess

  • Следующий вариант прокатывает для Windows 10. Создайте скрытую учётную запись администратора. Зайдя через ней, отправьтесь по пути

C:Пользователиучётка-проблемного-пользователяAppDataLocalPackages

Переименуйте папку Microsoft.Windows.Cortana_cw5n1h2txyewy вMicrosoft.Windows.Cortana_cw5n1h2txyewy.old. Некоторые папки по этому пути скрыты, так что убедитесь, что Свойства папки позволят вам найти нужные файлы и директории. Остаётся перезагрузиться и вновь войти в прежнюю учётку. В PowerShell от имени администратора наберите команду:

Add-AppxPackage -Path “C:WindowsSystemAppsMicrosoft.Windows.Cortana_cw5n1h2txyewyAppxmanifest.xml” -DisableDevelopmentMode -Register

перезагрузите компьютер и проверьте, не исправилась ли проблема.

  • отключите и включите опцию в Свойствах диска:

К слову сказать, если вы недовольны скоростью индексирования, это не означает, что с самой службой что-то не так. Так что как индексированиеускорить системы мы рассмотрим в следующей статье.

Отключить поиск Windows

Использование реестра Windows

В качестве альтернативы или дополнения вам также может понадобиться проверить, существует ли этот раздел реестра. Откройте редактор реестра и перейдите к следующему разделу реестра:

HKEY_CURRENT_USER Software Microsoft Windows CurrentVersion Policies Explorer,

Если на правой панели существует значение с именем NoFind , удалите его. Значение 1 будет означать, что поиск и следующие функции отключены:

  • Элемент поиска удаляется из меню «Пуск» и контекстного меню, вызываемого правой кнопкой мыши.
  • Система не отвечает, когда пользователи нажимают F3 или Win + F
  • Элемент поиска не отображается в контекстном меню правой кнопки мыши на диске или папке.
  • Элемент поиска может отображаться на панели инструментов «Стандартные кнопки», но Windows не будет отвечать при нажатии клавиш CTRL + F.

Если ключ не существует или имеет значение 0 , то это состояние по умолчанию; то есть поиск включен.

Всегда рекомендуется создать резервную копию реестра или создать точку восстановления системы, прежде чем касаться реестра Windows.

Использование редактора групповой политики

Вы также можете открыть редактор групповой политики и перейти к:

Конфигурация пользователя> Административные шаблоны> Меню «Пуск» и панель задач> Удалить ссылку «Поиск» из меню «Пуск»

Убедитесь, что Удалить ссылку поиска из меню «Пуск» отключено или не настроено.

Это должно помочь.

Если вы отключите Windows Search, могут произойти следующие события:

  1. Все окна поиска в Windows исчезнут
  2. Программы, использующие поиск Windows, включая Internet Explorer, не будут работать должным образом.
  3. Распознавание рукописного ввода на планшетном ПК не работает.
  4. Windows Media Center не будет иметь расширенные возможности поиска.
  5. Вы больше не сможете упорядочивать представления библиотеки по метаданным, а заголовки столбцов будут только сортировать элементы, а не складывать или группировать их.
  6. Параметры, влияющие на функции поиска Windows, будут удалены, включая индексирование на панели управления и вкладку «Поиск» в параметрах папки.
  7. Windows больше не будет распознавать эти типы файлов на основе поиска, такие как search-ms, searchconnector-ms и osdx.

Проверьте этот пост, если окна справки продолжают открываться автоматически.

Оцените статью