Capturing search phrase and number of results

Oxygen general issues.
jpond
Posts: 16
Joined: Fri Apr 06, 2012 9:10 pm

Capturing search phrase and number of results

Post by jpond »

Hi,

Regarding the search function in the webhelp plugin: Does anyone know of a way to programmatically capture the string(s) the user typed in the search box and the number of results returned?

Thanks,
Julia
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Capturing search phrase and number of results

Post by sorin_ristache »

Hi Julia,

The search string typed by the user is processed by JavaScript code that is included in the Webhelp page displayed in the browser and that takes this user input and works out the list of results. I suppose you could enhance this JavaScript code and further process this data besides displaying the search results on the Search tab in the Webhelp page.

In what language do you need to capture the user string and the (number of) search results? How would you like to process the captured data?


Regards,
Sorin
jpond
Posts: 16
Joined: Fri Apr 06, 2012 9:10 pm

Re: Capturing search phrase and number of results

Post by jpond »

We'd like to know the best function to use to make a tracking call after the results are displayed.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Capturing search phrase and number of results

Post by sorin_ristache »

Hi,

The search results are computed and added to the Webhelp page in the function called realSearch() in the file [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\oxygen-webhelp\search\nwSearchFnt.js. You can insert a new JavaScript function in this file that is a proxy for the realSearch() function and handles the search results in the variable called results inside the realSearch() function.


Regards,
Sorin
jpond
Posts: 16
Joined: Fri Apr 06, 2012 9:10 pm

Re: Capturing search phrase and number of results

Post by jpond »

Thanks very much, this is helpful!

Best regards,
Julia
Post Reply