Copy link to clipboard
Copied
Hi - Can anyone help me on this please? Originally posted 24th August but no replies.
Thanks
Hi,
I am using responsive HTML5 help in Robohelp 2015. There is an option for users to tick a box for all search words for an AND search otherwise the default is OR.
Can this be set as default - so that the box is automatically ticked for an AND search?
There isn't an option for this so I guess it will require a code change but I haven't manage to locate the code yet.
Thanks
* I see the same question has been asked for Robohelp 11 but the solution given doesn't seem to work for Robohelp 2015.
I looked into the output and it seems that setting the value doesn't always correctly change the checkbox value. But there is a 'workaround'. By mimicking a user interaction, you can set the AND search when the page is loaded.
In the layouts usersettings.js file, go to line 35, with the text rh.model.publish(xxxx
Add a new line below that and add the code:
setTimeout(function(){
var rh = window.rh;
var isAND = rh.model.get(rh.consts('KEY_AND_SEARCH'));
if(isAND != 1) {
var checkbox = document.g
...Copy link to clipboard
Copied
Are there no topic.slp files in RH2015's \!Screenlayout!\ folder?
Copy link to clipboard
Copied
Yes this seems to be the file to change but cannot quite get it to work correctly.
Copy link to clipboard
Copied
Is the change to that file's coding having any effect on the output?
Copy link to clipboard
Copied
it does but not the desired effect.
Users complain the search is a bit slow -it's merged help. it faster when you use AND search, rather than the default OR so making all searches AND would help.
Copy link to clipboard
Copied
Have you looked at the customization options? From the SSL recipe, click Customize Selected Layout.
Then click the Search (All) and you see settings that allow you to change behavior.
Cheers... Rick
Copy link to clipboard
Copied
hi,
Yes thanks i've looked at that. That just turns off the option to select the AND search just leaving OR as the default, I believe?
Copy link to clipboard
Copied
Hmmm, I've been playing with that setting and oddly, it seems to make zero difference in my outputs when I'm testing. Maybe I need to create a fresh layout or perhaps try with the other one.
Copy link to clipboard
Copied
I think the checkboxes all remember the last setting you used, which would imply a cookie somewhere? So maybe you can find a jquery guru to write a script to re-tick the checkbox each time or reset the cookie? Not my area of expertise though, so just conducting a thought experiment.
Copy link to clipboard
Copied
You can set it from code if you want to enable it by default.
In the layouts usersettings.js file, go to line 35, with the text rh.model.publish(xxxx
Add a new line below that and add the code:
rh.model.publish(rh.consts('KEY_AND_SEARCH'), 1);
Whenever the help is opened, the AND search is enabled. Only happens when the page is loaded.
Copy link to clipboard
Copied
Hi Willam,
I tried the above on a new test project but it doesn't seem to work for me.
The AND search isn't enabled as default. Here's the code added:
Thanks.
Copy link to clipboard
Copied
Hi there
Not sure if it will make a difference, but you have a space before your 1. Did you try removing that?
Cheers... Rick
Copy link to clipboard
Copied
Additionally, ensure you delete the cache?
Copy link to clipboard
Copied
Hi,
I removed space and deleted cache but no difference.
Copy link to clipboard
Copied
Interesting. Can you share the output with me? Adding that code on my end enable the AND search for me.
Copy link to clipboard
Copied
Hi Willam,
Due to the problems with Update 4, I had to remove and reinstall Robohelp up to Update 3. Could be something to do with this if you have Update 4 installed?
Just to clarify, when you say the AND search is enabled, do you mean it's already checked as below:
Thanks - happy to share the output if that will help.
Copy link to clipboard
Copied
I'm not sure if it has to do with Update 4, but you never know...
I mean exactly what your image shown: checking AND search by default.
For the output, please contact me at: contact [at] wvanweelden [dot] eu.
Copy link to clipboard
Copied
I looked into the output and it seems that setting the value doesn't always correctly change the checkbox value. But there is a 'workaround'. By mimicking a user interaction, you can set the AND search when the page is loaded.
In the layouts usersettings.js file, go to line 35, with the text rh.model.publish(xxxx
Add a new line below that and add the code:
setTimeout(function(){
var rh = window.rh;
var isAND = rh.model.get(rh.consts('KEY_AND_SEARCH'));
if(isAND != 1) {
var checkbox = document.getElementById('andsearch');
checkbox.click();
}
}, 1000);