Automatically open single query results

General discussion related to "Everything".
Post Reply
Hybred
Posts: 12
Joined: Thu Apr 11, 2019 12:55 pm

Automatically open single query results

Post by Hybred »

Is it possible to automatically open the top item if it is the only result? Be it a setting, or API call?

For example: If someone runs a search for a specific PDF on a Everything instance, a dream scenario would be an option to automatically open the searched name if there was only a single result returned. Right now I'm working on implementing this into a workflow where the employee scans a QR code which takes them to the Everything HTTP page with the appropriate result. They then click the .PDF link (should always be a single result) and it opens the PDF. A method to skip the clicking would be amazing!

Thanks again. :)
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Automatically open single query results

Post by NotNull »

If you are using the embedded Everything HTTP server: you can customize the HTTP server.
Adding some (JavaScript) code should do it.

When using the ETP Server instead, there are easier options.
Hybred
Posts: 12
Joined: Thu Apr 11, 2019 12:55 pm

Re: Automatically open single query results

Post by Hybred »

I was looking into JavaScript.

What would your recommendation be at the software level for scanning a QR code to pull up a PDF?
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Automatically open single query results

Post by NotNull »

Bit depending on your situation, but in large steps (details when needed):


Scenario 1 (Simple): Use command-line tool ES.exe
  • Setup an ETP server
  • Download ES.exe from here.
  • Setup an Everything client to automatically connect to this ETP Server.
  • Let this client run at startup/logon (parameter -startup) and let it run in the background (ES.exe 'talks' to this client to get it's information).
Let's say the QR scan code gives you documentID ABC123
In - for example - PowerShell you now execute (using ABC123 as a parameter):

Code: Select all

 start ("c:\path to\es.exe" ABC123 )[0]
That will run/execute the first result.
( I would advice some extra checks, like:
$Results=("c:\path to\es.exe" ABC123 )
and check if $Results[1] is empty ànd that $Results[0] exists before running
)
You can also limit the number of result to - let's say 5 - with ES.exe's parameter -n 5



Scenario 2 : Use the Everything SDK

Using the SDK, you can write your own program to communicate with a running Everything client.
I'm not a developer so can't help you in detail, but there are examples in the SDK for multiple programming languages.
  • Setup an ETP server
  • Setup an Everything client to automatically connect to this ETP Server.
  • Create a program that talks to this Everything client and handles the results (from what I heard that should not be very hard and there is always support here on the forums)
If you need more detail, just ask.
Good luck!

Some notes:
- If needed, you can run this ETP client next to your regular Everything client
- For your case, it would be useful if you could talk to the ETP Server directly using the Everything SDK. But I don't think that's (technically) possible.
Post Reply