Add Windows Search content

Here you can propose new features, make suggestions etc.

Moderators: sheep, Hacker, Stefan2, white

Post Reply
User avatar
Horst.Epp
Power Member
Power Member
Posts: 4021
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Add Windows Search content

Post by *Horst.Epp »

I found in my other file manager (XYplorer) how easy it is to get content searches using Windows search.
A realy small VBS script is enough to search by content and use the resuilts like Feed to listbox in TC
Its called "Paper Folder" in XYplorer.

This should be no big problem to add for Christian.
Suggestion:
Make a "Windows search" checkbox if "Find text" is used.
Feed the query to the VBS script
Execute a command similar to
$a = runret("cmd /c cscript.exe <xyscripts>\WinSearch.vbs //NoLogo //T:10");
Show the results as usual.

The final script for getting Windows search content is like the following example

Code: Select all

  On Error Resume Next
  Set objConnection = CreateObject("ADODB.Connection")
  Set objRecordSet = CreateObject("ADODB.Recordset")
  objConnection.Open "Provider=Search.CollatorDSO;Extended Properties='Application=Windows';"
  objRecordSet.Open _
    "SELECT TOP 200 System.ItemPathDisplay, System.Search.Rank FROM SYSTEMINDEX WHERE " & _
        " FREETEXT(*,  'text to be searched' ) " & _
        "ORDER BY System.Search.Rank DESC", objConnection
  objRecordSet.MoveFirst
  Do Until objRecordset.EOF
    Wscript.Echo objRecordset.Fields.Item("System.ItemPathDisplay")
    objRecordset.MoveNext
  Loop      
Windows 10 Home x64 Version 20H2 (OS Build 19042.844)
TC 9.51 x64 / x86, Everything 1.4.1.1006 (x64)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40284
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Add Windows Search content

Post by *ghisler(Author) »

This should be possible also via direct calls to the ADODB objects. However, isn't the amount of indexed files very limited, and not always up to date? Is there a way to determine programmatically what's indexed?
Author of Total Commander
http://www.ghisler.com
User avatar
Horst.Epp
Power Member
Power Member
Posts: 4021
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Add Windows Search content

Post by *Horst.Epp »

ghisler(Author) wrote: 2021-02-15, 09:02 UTC This should be possible also via direct calls to the ADODB objects. However, isn't the amount of indexed files very limited, and not always up to date? Is there a way to determine programmatically what's indexed?
The indexing service is updating all the time so its normaly actual.
What is indexed can be configured and I have added my repository of PDF files, Thunderbird e-mails and a special documents tree for example.
I think the normal user knows what he has configured and therefore what results can be expected from Windows search.
I use the Windows search a lot and have an context menu entry in the results to show this entry in Total Commander.
Some day in the future Everything will also support indexed contents but currently I see Windows search as a big possible improvement of TC.
Windows 10 Home x64 Version 20H2 (OS Build 19042.844)
TC 9.51 x64 / x86, Everything 1.4.1.1006 (x64)
User avatar
Hacker
Moderator
Moderator
Posts: 11891
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Add Windows Search content

Post by *Hacker »

Christian,
I'd like to humbly bring up my suggestion of including user-chosen WDX fields in an indexed search (yes, TC would have to keep its own index).

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
MVV
Power Member
Power Member
Posts: 8572
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: Add Windows Search content

Post by *MVV »

More indexing services - more search failues. I've got failures with Everything a lot of times: even though my entire volume is indexed, sometimes this index misses some files.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 4021
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Add Windows Search content

Post by *Horst.Epp »

MVV wrote: 2021-02-16, 08:38 UTC More indexing services - more search failues. I've got failures with Everything a lot of times: even though my entire volume is indexed, sometimes this index misses some files.
That may be your case but its not a general problem.
In Everything a force rebuild helps in most cases
and in Windows search I never miss entries for my indexed content.
Also you are not forced to make use of it if TC offers this as an option.
Todays PC hardware and Windows 10 have no problem to provide indexed search.
Windows 10 Home x64 Version 20H2 (OS Build 19042.844)
TC 9.51 x64 / x86, Everything 1.4.1.1006 (x64)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40284
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Add Windows Search content

Post by *ghisler(Author) »

Everything failed for me only when using junctions/symbolic links, e.g. when pointing c:\files to d:\files, Everything would only find anything in d:\files, but not in c:\files.
Author of Total Commander
http://www.ghisler.com
User avatar
Horst.Epp
Power Member
Power Member
Posts: 4021
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Add Windows Search content

Post by *Horst.Epp »

ghisler(Author) wrote: 2021-02-19, 09:58 UTC Everything failed for me only when using junctions/symbolic links, e.g. when pointing c:\files to d:\files, Everything would only find anything in d:\files, but not in c:\files.
But this is a known restriction of the current version.
Windows 10 Home x64 Version 20H2 (OS Build 19042.844)
TC 9.51 x64 / x86, Everything 1.4.1.1006 (x64)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40284
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Add Windows Search content

Post by *ghisler(Author) »

It may not be known to everyone. Even I asked myself, why no files were found when I was in c:\files instead of d:\files when starting a search, until I remembered that c:\files was only a link to d:\files.
Author of Total Commander
http://www.ghisler.com
Post Reply