Webhelp Search returning no results

Post here questions and problems related to editing and publishing DITA content.
dkb123
Posts: 11
Joined: Sat Jul 17, 2010 7:30 pm

Webhelp Search returning no results

Post by dkb123 »

Hi there,

I have an odd one occurring with our webhelp at the moment.
On my local IIS Server, everything works as expected; however, when put on our company server for testing purposes, Search does not work.

When you enter in a phrase and click Search you always get the search term not found message. I have tried all variants of phrases (none, acceptable ones, too long ones, etc...) and the appropriate warning message is displayed. So that means it is running through some of the code in nwSearchFnt.js correctly, but is not able to find or correctly query the index-n.js files.

All of the files are there as expected, so is there anything specifically in the code I should be checking to see what the issue is? I would think if our company's web server blocked javascript from running for some cross-sight-scripting protection reason, then none of the code in nwSearchFnt.js would run.

Thanks!
dkb123
Posts: 11
Joined: Sat Jul 17, 2010 7:30 pm

Re: Webhelp Search returning no results

Post by dkb123 »

After further investigation, it looks like this is the culprit:

Code: Select all


if (fileAndWordList == undefined) {
var cpt = 0;
Regardless of there being index files full of matching words, it is treating fileAndWordList as 'undefined' and spitting out the cannot find anything message.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Webhelp Search returning no results

Post by sorin_ristache »

Hello,

It is strange that the same WebHelp output works as expected when deployed on your local IIS Server but not when put on the company server. It could be a file encoding problem when serving the JavaScript index-n.js files to the user agent.

Please run the WebHelp transform on one of the built-in samples that come with Oxygen in the samples.xpr project, for example [Oxygen-install-dir]/samples/dita/flowers/flowers.ditamap or [Oxygen-install-dir]/samples/dita/garage/hierarchy.ditamap, and see if the search works as expected on this output when deployed on the company server. If it does not work correctly please send us a zip archive with that WebHelp output to look into it. Also please specify the search string(s) that you tried and did not work.

If it works correctly we need to look into the WebHelp output that you deployed initially on your company server where you stumbled on the problem. Please send us a zip archive with that WebHelp output that you deployed initially on your company server (or better the WebHelp output of only a cut-down sample of the initial DITA map that still reproduces the problem). Please specify also the search strings that you tried.


Regards,
Sorin
dkb123
Posts: 11
Joined: Sat Jul 17, 2010 7:30 pm

Re: Webhelp Search returning no results

Post by dkb123 »

Hi there,
I get the same results with the Flowers sample map.
Works on my IIS, does not work on our corp server.
I have filed a ticket and attached a zip file of our current webhelp build.
Thanks!
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Webhelp Search returning no results

Post by sorin_ristache »

Hi,

Thanks for the files. We will look at your output files and we will ask more details if that is necessary.

If you get the same result with the DITA sample files that come with Oxygen I suppose it could be a problem in the execution the JavaScript code for the search on your server.


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

Re: Webhelp Search returning no results

Post by jpond »

I have the same problem with 14.1 webhelp. The search only works in Chrome and Safari with local webhelp builds. And in Chrome, the customizations I made to tocWDiv.css are not visible; it seems to be using some other style sheet entirely.

I copied the local file path to 4 different browsers, with these results:

Chrome: no css customization, search works
IE: css customizations rendered, search doesn't work
Safari: css customizations rendered, search works :mrgreen:
Firefox: css customizations rendered, search doesn't work.

Any help for this? what were the results of your in-house, out-of-box cross-browser testing with the webhelp search?

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

Re: Webhelp Search returning no results

Post by sorin_ristache »

Hello Julia,

In our in-house tests the search worked correctly with both local files and the Webhelp pages deployed on a web server. The user dkb123 who started this thread still has to look into some server log files to gather some more details. The search works for him both with local files and with remote ones deployed on a server, but not on all servers that he tried.

Do you get the problem with one of the DITA samples that come with Oxygen, for example the map [Oxygen-install-dir]/samples/dita/flowers/flowers.ditamap? If yes can you send us a zip archive with your complete set of output files and also specify what customizations you applied: parameters set to a custom value in the DITA WebHelp transformation, custom CSS stylesheet set in this transformation, etc?


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

Re: Webhelp Search returning no results

Post by jpond »

Hi Sorin,

I will try the sample files as well; it just seemed odd to me that there were different results with different browsers.

I have only customized the .css, so that shouldn't affect it.

What is the latest build number for 14.1?

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

Re: Webhelp Search returning no results

Post by sorin_ristache »

Hi Julia,

The latest build number of 14.1 is 2012101809.


Regards,
Sorin
dkb123
Posts: 11
Joined: Sat Jul 17, 2010 7:30 pm

Re: Webhelp Search returning no results

Post by dkb123 »

Apologies for the long long long delay - I had to leave the help alone for a couple release cycles.
Now that I am looking at it again, I have landed on a solution.
I added the Javascript defer attribute to every non-jquery tag and search now works as expected in both locations, on multiple browsers.

Example:
<script type="text/javascript" src="oxygen-webhelp/search/index-3.js" defer="defer">
<!----></script>
dkb123
Posts: 11
Joined: Sat Jul 17, 2010 7:30 pm

Re: Webhelp Search returning no results

Post by dkb123 »

Oops forgot to add, that after lots of googling it looks like the difference could have been between a Windows based server and a Linux server. Linux server required defer and Windows did not.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Webhelp Search returning no results

Post by sorin_ristache »

Hi dkb123,

Thank you for letting us know but I don't see why deferring would be necessary for the JavaScript code (only the code which is not JQuery) loaded by the Webhelp pages. These scripts contain only some global variable and function declarations, they do not modify the DOM tree of the HTML page. Please can you let us know on what platform + server combination the defer="defer" attribute was necessary (what Linux distribution, what name and version of web server)?


Thank you,
Sorin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Webhelp Search returning no results

Post by sorin_ristache »

Hi Julia
jpond wrote:I will try the sample files as well; it just seemed odd to me that there were different results with different browsers.

I have only customized the .css, so that shouldn't affect it.
Can you try the fix suggested by dkb123 by adding the defer="defer" attribute to the <script> elements (in the index.html file) that include JavaScript code? You should not modify the <script> elements that include the JQuery files (the jquery*.js files). Does that fix the problem for you? What is your combination of platform + web server (platform name and version, web server name and version)?


Thank you,
Sorin
Post Reply