Maximum Search Results

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.
Post Reply
Ineffable
Sr. Propeller Head
Posts: 148
Joined: Mon Jan 15, 2007 3:08 pm
Location: Bay Area, CA

Maximum Search Results

Post by Ineffable »

Is there a way to set the maximum number of results a search returns?
Ineffable
Sr. Propeller Head
Posts: 148
Joined: Mon Jan 15, 2007 3:08 pm
Location: Bay Area, CA

Re: Maximum Search Results

Post by Ineffable »

bump
Ineffable
Sr. Propeller Head
Posts: 148
Joined: Mon Jan 15, 2007 3:08 pm
Location: Bay Area, CA

Re: Maximum Search Results

Post by Ineffable »

If anyone is interested, I was able to find a solution. In the MadCapDefault.js file, line 591, is the PrepareSearchResults function.

Before the closing bracket in the for statement for this function, I added this break statement:

Code: Select all

if (i==x)
   {break;}
where x is the maximum number of search results.
mlaird
Propeller Head
Posts: 49
Joined: Wed Feb 06, 2013 3:18 pm

Re: Maximum Search Results

Post by mlaird »

This is an interesting answer! I wouldn't have thought to try this. Does the MadCapDefault.js file get overwritten each time you build the output? I would have thought it would, and that would erase this change - or at least require the edit to be a post-generation step, every time you make the HTML...
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: Maximum Search Results

Post by Msquared »

Yes it does get overwritten when you build, but it doesn't change, I don't think. It is just copied from wherever MadCap hides the master copy. So once you have the version you want to use, with your changes, just add a post-build step to overwrite Flare's version with your modified version.

It may change across Flare releases though, so you will need to make a new modified version if you install a newer version of Flare.
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
Ineffable
Sr. Propeller Head
Posts: 148
Joined: Mon Jan 15, 2007 3:08 pm
Location: Bay Area, CA

Re: Maximum Search Results

Post by Ineffable »

Msquared wrote:It may change across Flare releases though, so you will need to make a new modified version if you install a newer version of Flare.
Good point. It occurred with the last maintenance update to 10.x.
Post Reply