Help me understand webhelp responsive search

<oXygen/> general issues.
revaljilji
Posts: 14
Joined: Mon Sep 09, 2019 3:07 pm

Help me understand webhelp responsive search

Post by revaljilji » Fri Dec 13, 2019 1:28 pm

Hello,

for our company it is very important to have a functional search. There is a lot of parameters that contain special characters ($, #, %, etc..) and we are not able to find them because webhelp search doesn't support it. So I'm trying to figure out why and how your search works? For example upon writing \word or *word, search automatically deletes the character, while $word will stay the same? Could you please explain the logic behind it? I would also like to know if its possible to enable the search for the special characters?

BR,
R

radu_pisoi
Posts: 369
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Help me understand webhelp responsive search

Post by radu_pisoi » Tue Dec 17, 2019 6:28 pm

Hi,

To implement the search function, we use a search engine implemented in Javascript. For security reasons we filter the search query by removing special characters like $.

You can find more details about search engine in our user guide.
I would also like to know if its possible to enable the search for the special characters?
Unfortunately, there is no way to enable the search for the special characters.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

revaljilji
Posts: 14
Joined: Mon Sep 09, 2019 3:07 pm

Re: Help me understand webhelp responsive search

Post by revaljilji » Wed Dec 18, 2019 4:37 pm

For everyone wondering if we found the solution. We create a tag that would be used only for parameters in our .dita files. Then we included this tag into the scoring.properties as described here: https://www.oxygenxml.com/doc/versions/ ... ch-results and we set it to a really high number.

Then we needed to change the search.js file:
1. Add global variable, var specialCharacter = false;
2. Then in function searchAndDisplayResults (line 155), check if there are any of the special characters you use in the string, and if yes set the specialCharacter = true
3. In function computeHTMLResult, check if the specialVariable is set to true (before last else statement, where 'Search no results' localization is set). If so, append the desired message to $wh_search_results_items variable. We for example stated that the current search implementation doesn't support the special characters and instead "#USER_INPUT", they should search for "USER and INPUT". You can achieve this with a built in js function .replace.

Hopefully this helped.

ionela
Posts: 315
Joined: Mon Dec 05, 2011 6:08 pm

Re: Help me understand webhelp responsive search

Post by ionela » Thu Dec 19, 2019 4:27 pm

Hi,

Thank you for your feedback.

I just wanted to mention that we do not recommend to modify the built-in files as this might to several problem when you update your oXygen XML/WebHelp installation.

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support

Post Reply