Page 1 of 2

External search with Agent Ransack & FileLocator (Pro)

Posted: 04 Mar 2014 23:30
by highend
Inspired by this thread: http://www.xyplorer.com/xyfc/viewtopic.php?f=3&t=11128

MASSIVE UPDATE

I've created a script that let's you use an external search engine (that is a bit more flexible in terms of boolean / boolean regex searches when it comes to the content of files).

Atm it works with Agent Ransack, File Locator and it's commercial version File Locator Pro.
File Locator Pro's boolean regex is really a powerhorse^^

Prerequisite:
- Current beta version of XY (with support for paper folders)!
- Be in the folder that'll be the base for your search
It's not a necessity but the corresponding field is prefilled with the current path...

To set the script up, run it once, quit it and then edit the corresponding .ini file "<same name as the script file.ini>"
(in the same folder as the script).

"SearchEngine=" is the minimum requirement! If you are using FileLocator Pro and want to use indexed searches,
you need "IndexPath=" as well...


A screenshot of the search dialog window (XY side):
screenshot.png
screenshot.png (9.15 KiB) Viewed 18367 times
Current version:
v2018.05.12 Build 10.08
External search_v2018.05.12 Build 10.08.xys
(26.95 KiB) Downloaded 947 times
Older versions:
v2018.03.04 Build 10.07
External search_v2018.03.04 Build 10.07.xys
(14.15 KiB) Downloaded 806 times
v2015.06.26 Build 10.06
ExternalSearch_v2015.06.26 Build 10.06.zip
(3.45 KiB) Downloaded 838 times
v2014.06.29 Build 20.31
ExternalSearch_2014.06.29 Build 20.31.zip
(3.22 KiB) Downloaded 863 times
v2014.06.29 Build 17.12
ExternalSearch_v2014.06.29 Build 17.12.zip
(3.24 KiB) Downloaded 790 times
v2014.03.07 Build 21.16
ExternalSearch_v2014.03.07 Build 21.16.xys
(11.84 KiB) Downloaded 936 times
v2014.03.05 Build 09.23
ExternalSearch.xys
(7.46 KiB) Downloaded 913 times

Re: External search (atm Agent Ransack)

Posted: 05 Mar 2014 09:29
by highend
Pushed a little fix...
@Changelog:
v2014.03.05 Build 09.23
• Changed: Better detection of local / remote paths -> necessary because the
search engine's output delivers additional line numbers for all
hits when content search is used

Re: External search (atm Agent Ransack)

Posted: 07 Mar 2014 17:37
by kotlmg
can you please give the above code for filelocator pro, instead of agent ransack.

Re: External search (atm Agent Ransack)

Posted: 07 Mar 2014 18:51
by highend
Apart from the additional features that are currently not supported in the html dialog it's just a simple change for the $agentRansackFolder & $agentRansackExe ...

I'll post a new version soon that makes it a bit clearer (and support the additional drop down fields for FileLocator Pro).

Re: External search (atm Agent Ransack)

Posted: 07 Mar 2014 21:04
by highend
New version:
v2014.03.07 Build 21.16
• Added: Support for FileLocator & FileLocator Pro
• Changed: Made it easier to select the external search engine by only
supplying the full path to the .exe file

Code: Select all

    // Use the full path to either Agent Ransack or FileLocator (Pro)!
    $searchEngine = "C:\Program Files\Mythicsoft\Agent Ransack\AgentRansack.exe";
The different drop-down fields for FileLocator Pro
(File name | Containing text | Look in) are now fully supported.

Re: External search with Agent Ransack & FileLocator (Pro)

Posted: 08 Mar 2014 03:37
by kotlmg
sir,
i have modified the code to file locator pro as follows.

Code: Select all

    $searchEngine = "C:\Program Files\Mythicsoft\FileLocator Pro\FileLocatorPro.exe";
thanks a lot sir, your code is superb.

Re: External search with Agent Ransack & FileLocator (Pro)

Posted: 29 Jun 2014 17:20
by highend
@Changelog:
v2014.06.29 Build 17.12
• Added: Paper folder support, now you can do something really useful^^

Re: External search with Agent Ransack & FileLocator (Pro)

Posted: 29 Jun 2014 19:17
by Stef123
When I run it, I get an error, telling me it cannot find this path
if (listfolder("<xydata>\Paper\$paperSubFolderName", "*.txt", 32) >= $paperFilesLimit) {

Re: External search with Agent Ransack & FileLocator (Pro)

Posted: 29 Jun 2014 20:30
by highend
Replace

Code: Select all

    // Check if we have more than $paperFilesLimit files
    if (listfolder("<xydata>\Paper\$paperSubFolderName", "*.txt", 32) >= $paperFilesLimit) {
        msg "There are more than $paperFilesLimit search results stored...<br>Press OK to delete them now or<br>Cancel to exit this script", 1;
        delete 1, 0, "<xydata>\Paper\$paperSubFolderName\*.*";
    }
with

Code: Select all

    // Check if we have more than $paperFilesLimit files
    if (exists("<xydata>\Paper\$paperSubFolderName") == 2) {
        if (listfolder("<xydata>\Paper\$paperSubFolderName", "*.txt", 32) >= $paperFilesLimit) {
            msg "There are more than $paperFilesLimit search results stored...<br>Press OK to delete them now or<br>Cancel to exit this script", 1;
            delete 1, 0, "<xydata>\Paper\$paperSubFolderName\*.*";
        }
    }
Or download the fixed version.

Re: External search with Agent Ransack & FileLocator (Pro)

Posted: 30 Jun 2014 07:14
by Stef123
Thank you, highend
both - for providing this script and for fixing it - works like a charm now. :appl:

Re: External search with Agent Ransack & FileLocator (Pro)

Posted: 01 Dec 2014 12:27
by binocular222
there's a problem when input search term is in unicode.
Example: search term = "thất nghiệp"
$searchParams="-s -o "C:\Users\nnguyen11\AppData\Local\Temp\~search_AR.txt" -oe8 -ofb -fed -ceb -lee -c "th%E1%BA%A5t+nghi%E1%BB%87p" -d "D:\Doc\Law""

Re: External search with Agent Ransack & FileLocator (Pro)

Posted: 01 Dec 2014 14:03
by highend
Even when I use quote(utf8decode(urldecode($fileName)))
instead of just the quote($fileName))

E.g. for the file name part, I don't get your original search term back.

Original: "thất nghiệp"
After utf8decode/urldecode: "thất nghi�?p"

Re: External search with Agent Ransack & FileLocator (Pro)

Posted: 19 Jan 2015 21:27
by Walrez
Hi, and thanks for the replies.

I installed Agent Ransack and the script.

When I search for something, I get a list (paper folder, I guess. Didn't try those yet), with the resulting files.
What should I do after that to visualize a file (and search inside it)?

Re: External search with Agent Ransack & FileLocator (Pro)

Posted: 26 Jun 2015 10:15
by highend
When I search for something, I get a list (paper folder, I guess. Didn't try those yet), with the resulting files.
What should I do after that to visualize a file (and search inside it)?
Sorry, never saw this response. You can't use an external search engine for a paper folder view. You have to know what you're searching for before you actually process the search (and enter the terms in the containing text: field, too).

A small update (didn't touch the code for almost a year):
@Changelog:
v2015.06.26 Build 10.06
• Changed: Changed the help file's link to the name of the search engine
• Changed: Processing of the output is done via regex, not with a foreach loop
• Changed: utf8decode(urldecode(...)) added
Changed the help file's link to the name of the search engine:
This may be cosmetic but sometimes I'm unsure which external search I'm invoking so this gives me the needed hint xD

Re: External search with Agent Ransack & FileLocator (Pro)

Posted: 04 Mar 2018 06:46
by xyplorerköln
When running the v2015.06.26 Build 10.06 version of ExternalSearch, I get the error:
The system cannot find the file specified. (C:\Users\system\AppData\Local\Temp\~search_AR.txt)
when the script executes line 102:
$content = readfile($outputFile);