Help me understand webhelp responsive search
Oxygen general issues.
-
- Posts: 23
- Joined: Mon Sep 09, 2019 3:07 pm
Help me understand webhelp responsive search
Post by revaljilji »
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
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
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Help me understand webhelp responsive search
Post by radu_pisoi »
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.
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.
Unfortunately, there is no way to enable the search for the special characters.I would also like to know if its possible to enable the search for the special characters?
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 23
- Joined: Mon Sep 09, 2019 3:07 pm
Re: Help me understand webhelp responsive search
Post by revaljilji »
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.
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.
-
- Posts: 407
- Joined: Mon Dec 05, 2011 6:08 pm
Re: Help me understand webhelp responsive search
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
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
oXygen XML Editor and Author Support
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service