📜 ⬆️ ⬇️

Incorrect work of the standard search for Windows operating systems

Attention!

1. Introduction


By writing this article I was motivated by the desire to contribute my five kopecks to the discussion of one of the latest issues (at the moment) of the most popular Windows operating system among users. And also the state of confusion and bewilderment, if it turns out that the bug I described below in the search system is really an “architectural feature of the product,” as Microsoft support specialists responded. The following material is presented on the basis of my experiments with the search in the Windows-8-Pro-64bit operating system (installed independently on a “clean” laptop, licensed, activated). Similar experiments conducted earlier on a laptop with a pre-installed system Windows-7-HomeBasic-64bit. In both cases, the result was the same.
In my opinion, in the search module of the above operating systems (I suspect they are not alone) a serious search engine bug. Although, as I mentioned above, Microsoft experts believe that this is not a bug, but a feature.

Here is a brief summary:

1. Search only for file names does not work correctly, namely, the file will be found only if one of the conditions is met:
a) the desired sequence of characters is the beginning of a word;
b) the desired sequence of characters is located after some characters such as hyphens, periods, underscores, and possibly others.
')
2. Search by file names and file contents does not work correctly, namely, the file with the content we need will be found only if two conditions are met:
a) the file type is included in the list of types for which the operating system performs a text search;
b) the desired sequence of characters is either the beginning of a word, or is located after some characters such as hyphens, periods, underscores, and possibly others.

Whoever is interested, can get acquainted with the technical details of my experiments in the material presented below.
A small note: since there is more than one way to open the windows of elements and settings that I describe, I chose the Windows Control Panel as a reference point. It can be opened by pressing the Win + X key combination and selecting the "control panel" item in the list that appears.

2. Description of the search system


To begin with, the search system is a component of the operating system. Open the Windows component settings: control panel → programs and components → enable or disable Windows components. Our component is called Windows Search. If you disable it (remove the check mark from the corresponding box), then after restarting the native Windows search stops working, and the search box in the upper right corner of the window disappears from the Explorer window.
ComponentSearch

Search field

By default, the component is naturally enabled. And when you enter the first character in the search field, the system proceeds to search, without waiting for the full query. This is the so-called "live" search, now so fashionable. Recall that in Windows XP, to start the search process, it was necessary to give the command - click the "Find" button.

A component of the search system that serves to speed up the search process is the content indexing service with the same name Windows Search, the launch type is automatic, deferred. (In the figure below, this service is disabled).
Index service

To configure services, open: control panel → administration → services. The properties of the selected service can be viewed by opening the context menu - click the right mouse button. As I understand it, this service indexes certain content (names, properties, content of files) in the locations indicated to it and enters this information into its database. And in the subsequent search is already on this database, which is stored in the "C: \ ProgramData \ Microsoft \ Search", thereby reducing the search time.

3. Search system settings


Search settings are already concentrated in three places, apparently for convenience. However, some of them are found in more than one of these three places, some only in one. We write down a minus into the Microsoft account. (Some settings remained a mystery to me). Here are the locations of these settings:
3.1. Control Panel → indexing options;
3.2. Control Panel → folder settings (search tab);
3.3. Windows Explorer window → activate the search bar (put the cursor in it) → the “search” tab appears in the main menu of the window, click it if not opened.
Go through these places and briefly look at the search parameters.

3.1. Control Panel → indexing options.

In the indexing parameters, we are given the opportunity to specify what will be indexed and where. While plus in a coin box Microsoft. Microsoft does not recommend choosing a lot of indexed locations, such as the Windows folders, Program Files, because, in its opinion, there’s nothing for users to look for. In addition, indexing (rebuilding the index) is a long process.
Index parameters1

Index parameters2

As you can see from the picture, each type of file is associated with the necessary filter, and you can index only the properties of the file or both the properties and the contents. This means (wonder!) That we, for example, can type in the search bar of the conductor the name of our musical deity, and it will be found by musical tags. The truth does not take into account the state / presence of those very musical tags in our favorite, often faceless mp3-files. After all, not a rarity and names like track_01.mp3.
By the way, the path (location) of the file is also a property of the file, so you should be ready to see in the search results all files in the path of which is the word typed in the search query. For me, this is already superfluous.
As a result, we have a sophisticated search. And, as he says, the philosophy of the language Python - simple is better than complex . Therefore, the indexing service is stopped by me.

3.2. Control Panel → folder options (search tab).

The most important, in my opinion, search parameters are concentrated in the folder settings.

The parameters of the "How to search" section apply to both indexed and non-indexable locations. The “Search for partial matches” parameter, which is necessary and understandable to all, does not need comments. The value of the option "Do not use the index when searching system files in folders" remains a mystery to me. Indeed, in the indexing parameters it is already indicated what and how to index.

From the name it follows that the parameters of the section “Search in non-indexed locations” apply only to non-indexed places.
The parameter values ​​are clear. In the presence of the ability to search in the archives is another plus. The next important parameter is “Search by file name and content”. What to say? Pleased, and honestly warned - not all at once and now.
Folders settings

3.3. Windows Explorer window → when the search bar is activated, the “Search” tab appears in the main menu of the window.

Well, the third place to set the search parameters is any Windows Explorer window, you should activate the search query field and the search tab appears in the window’s main menu:
Window menu Search

There are a lot of useful chips, including only here and customizable. For example, search only in the current folder, or in all nested ones too. You can limit the search by file modification date, type, size, and other properties. I do not use them, so that they do not torment myself with doubts. Chip repeating the search on the Internet (but!), The log of search queries, as well as additional parameters (these are exactly the ones that we have already discussed above).

4. Troubleshooting and the actual bug


To begin with, modules are built into the operating system for finding and fixing various problems. I think the trick is necessary, but I will tell you right away - it did not save me.
So open: control panel → troubleshooting → browse all categories → search and indexing. Why not show all categories at once? Not so many of them, in my 14 inch screen fit. We start the troubleshooting search, in the window that opens, click "Advanced", click "Run as administrator", click "Next." Again, a new window with a choice of problems, put a tick "Files are not displayed in the search results" - finally reached my grief! Click "Next" and we get the following diagnostic result:
Diagnostics

As you can see, this concerns the indexing service (which at that moment was turned on and worked). I did not touch the permissions for the indexing service directories, and did not know about the existence of these directories until I saw this window with the results of diagnostics. Let me remind you where these directories are: “C: \ ProgramData \ Microsoft \ Search”.
I did not find a way to correct this error, and I think there is no need for it (the indexing service is disconnected from me now). Yes, and in the sense that this applies only to indexed locations. And my problem is relevant for all locations.
It is time to clarify my problem in detail. Immediately I will explain that the state of the indexing service (“working” or “disabled”) does not matter.

4.1. Search by file name.

So, in the first part of the experiment, in the global search parameters (related to any placements, indexed and not), activate the parameter “Search for partial matches”. Next, for non-indexed locations (in my case, for all), uncheck the “Search by file names and content” box so that the search is performed only by file names. We start the experiments. There are several files of different types in the folder under study:
ExperiencedFiles

We type fa in the search bar and see:
Ex-fa

It would seem that Windows Search coped with the task, even the results are highlighted in yellow. What else to dream? But where is the SearchFalse.vsd file? Is fa not part of the name SearchFalse.vsd? Maybe it's in the register? But in the example above, names are found, where f is in both upper and lower case. To calm down, we will enter Fa and see that the result has not changed. At least we have no problems with the register!

Let's try to enter cm , we get:
Ex-cm

As if everything is normal.

Enter ro :
Ex-ro

“There are no items that match the search criteria” - how is it, brothers and sisters? Three files satisfy the search terms (Error.cmd, Error_critical.txt, Wrong.txt), but they were not found. Everything is lost?
Here is what we have for now: a sequence of characters is entered in the search field, which is obviously in the file name. But the search results contain only files whose specified sequence is the beginning of the name, or the beginning of the extension, or is located after the hyphen.
But this contradicts, I am sure not only to my, the idea of ​​the principle of the search operation!

Let's try a trick, enter the first character of the query "asterisk" * ro :
-Ex- * ro

It is finished, files found! But without the wonderful yellow light. In the certificate of such tricks there is no mention. The development of events in general is alarming.

4.2. Search by file name and content.

The knowledge nut is hard, but we are not accustomed to retreat ... We turn on the setting “Search by file names and content” to now search by the content of the file. In the folder already familiar to us in five files (Error.cmd, Fail.xlsx, Foul.jpg, Mistake.bat, Wrong.txt) there is the same content:

Get off my cloud
As Tears Go By
Paint_It_Black
Mother's little helper
Lady-jane

The file Foul.jpg is a text file with a modified extension.

We type tea in the search field (to match the beginning of the word Tears):
Ex-tea

It seems to be lucky, only the file Foul.jpg is not found. But this can be explained by the fact that Windows clearly does not consider it text and the text is not looking there. Here there are questions: where the search for Windows takes information about file types and second, the main thing - how to make the search for text where we want it. As for the first, it seems to be in the registry. But the second is not clear where to find this magical setting? I did not find the answer again. As a note, I note that you can find text in .pdf files.

Let's complicate the task, type in the bla search field, (so that the characters follow the underscore character):
Ex-bla

Files found, but it's still too early to talk about luck. Enter jan , we get the same result. What is expected.

We try to further complicate the task, type in the ear request:
Ex-ear

Those four files that should be found are missing. Again, failure, but for which we must be prepared. We have a retaliatory move! Enter * ear :
Ex- * ear

This time the failure, the unexpected, which is already disheartening. Is there really need another magic symbol, replacing the beginning of the word? I tried: ~, @, $,%, -,!, Even a space. But all in vain - no files found. By the way, if you enter a dash in front, the search result - all files except pe.pdf, again a mystery.

4.3. Findings.

Based on the above, we can conclude that the search mechanism is the same for searching by file name and for searching by name and content. The error, in my opinion, is one and very critical, since it leads to incomplete search results. In addition, it misleads a person who is logical in his thinking and forces him to build cunning guesses.
The result is a fat minus Microsoft. The only good news is that the bug is treated at least for searching by file names.

5. Diagnosis


You can sum up disappointing results:

1. Searching only by file names (with the “search by file names and content” option disabled) does not work correctly. Namely, the file will be found only if one of the conditions is met:
a) the desired sequence of characters is the beginning of a word;
b) the desired sequence of characters is located after some characters such as hyphens, periods, underscores, and possibly others, which I think is a waste of time.
This bug is treated using the asterisk * symbol at the beginning of the desired sequence of saving.

2. Search by file names and file contents (with the “Search by file names and contents” option enabled) does not work correctly. Namely - the file with the content we need (we are interested in the content of the file) will be found only if two conditions are met:
a) the file type is included in the list of types for which the operating system performs a text search;
b) the desired sequence of characters is either the beginning of a word, or is located after some characters such as hyphens, periods, underscores, and possibly others, which I consider to be a list of futile waste of time.
A cure for this bug has not yet been found by me.

I almost forgot, a brief description of this problem was sent by me (after system authentication) in support of Microsoft. The answer was received, I must say, promptly, but faith in humanity was lost. The response reported:
“We inform you that this is a normal operation of the product - such is its architectural feature. You can find additional information on the question that interests you by contacting our portals - support.microsoft.com and technet.microsoft.com . ”
How to live on? Is it really an architectural feature or was it politely sent? I tend to think that the first is the same. Although it would be better to be second, because architectural bugs, as I understand it, are not treated with patches! So the cons are no longer writing - this is “Epic Fail” !

6. As a conclusion, some thoughts, including the causes of the phenomenon


In the Windows XP operating system, this behavior of the search system is not observed, the search works, as is customary in the field of information technology. The settings are concentrated in one place and understandable. Unless the search is not “live”, but this “live” search only hinders me: I have not entered a request yet, and some attempts have already begun. In Google search, this feature even turns off. It seems that Microsoft experts were instructed to introduce some kind of innovation into the search engine. So it would “revive” him, plus he made a cool highlighting of the results - and happiness to everyone! Why break the principle itself, why touch the basics? An innovative search that opens from the sidebar of Windows 8, searches for files only in indexed locations, given the bug, its value for me is lost.
Another small note and finish. While googled his problem I read a number of articles by Vadim Sterkin (aka Vadikan on oszone.net). For example: http://www.outsidethebox.ms/9973/ and http://www.oszone.net/10893/Windows7_Search_Part2 . In his blog and on the forum oszone.net directly praise songs about Microsoft. In fairness it must be said that the articles contain the necessary and useful information. But with respect to Windows Search, it seems that the search examples are deliberately left behind the scenes, when the desired sequence of characters is located, say at the end of a word. The fable about the cuckoo and the rooster is involuntarily remembered ...

Source: https://habr.com/ru/post/167039/


All Articles