Page 1 of 1

Add Windows Search content

Posted: 2021-02-14, 14:08 UTC
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      

Re: Add Windows Search content

Posted: 2021-02-15, 09:02 UTC
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?

Re: Add Windows Search content

Posted: 2021-02-15, 10:51 UTC
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.

Re: Add Windows Search content

Posted: 2021-02-15, 15:21 UTC
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

Re: Add Windows Search content

Posted: 2021-02-16, 08:38 UTC
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.

Re: Add Windows Search content

Posted: 2021-02-16, 09:00 UTC
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.

Re: Add Windows Search content

Posted: 2021-02-19, 09:58 UTC
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.

Re: Add Windows Search content

Posted: 2021-02-19, 10:55 UTC
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.

Re: Add Windows Search content

Posted: 2021-02-23, 16:33 UTC
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.