Immediately display the first hit from a search
In some instances, it would be useful if we could set up a search (probably embedded in a link) that would search and then immediately display the first page found from the search, rather than display a page of search results.
Does anyone know how to do this?
Last edited by pebraham; 04-18-2012 at 08:13 PM.
This is the "I'm feeling lucky" feature from Google. It isn't a feature of the Zoom software, you need to display the results before selecting one of the results.
It could be done with some additional scripting. The script would need to work out which result was the 1st result, check for some type 'flag' that would indicate that an auto-redirect should take place, then do the redirect. You would also need to work out when and how the flag should be set.
Well, I'll have a go at scripting.
Do you have any hints on how I can get the URL of the first result ?
You need to decide what type of scripting you are going to do. Server side or client side, and what script option in Zoom you are going to use.
Look for the comments "Display the results", from here on in, you can access the very first result, as seen with the code at the start of the loop, so it would be something like:
ipage = output(0, 0)
pgdata = GetPageData(ipage)
url = pgdata(PAGEDATA_URL)
Hope that helps.
Thanks! Works nicely.
OutResBuf = OutResBuf & "<script> window.open('" & urlToDisplay & "', '_self') </script>" & VbCrLf