Fix some issues with search
This fixes two issues with the search.
- Search was only looking for the first letter of the query. It seems getQueryParameters previously returned params['q'] as an array, but only the first index was used. So, fixed not by returning an array, but just using the single string in params['q'].
- Search content display was looking for pages with a URL root of "undefined" (leading to things like
/undefinedreference_manual/
), so could not find them and displayed the 404 page. Fixed by making sureDOCUMENTATION_OPTIONS.URL_ROOT
is not undefined, but I am not sure why it is despite that layout.html seems to set it to ''.
Locally, I had to comment out the line
rv = rv.highlightText(this, 'highlighted');
as it complained the highlightText function did not exist, however
search content highlighting appears to work currently on the actual website.
I could not build 5.2-branch locally without applying commit f0dbf74d, but otherwise it worked the same as master.