backdrop-ops / docs.backdropcms.org

Website for displaying Backdrop CMS documentation and API source code.
https://docs.backdropcms.org/
6 stars 6 forks source link

Search returns top matching result, not page of matching results #46

Open ghost opened 6 years ago

ghost commented 6 years ago

Go to https://api.backdropcms.org/ and enter 'config' into the search field on the right. A list of matching results is displayed below the search field, but you want to view a page showing all/more matches, so you just press Enter without clicking on any of them.

You expect to be taken to https://api.backdropcms.org/search/node/config

You actually get taken to https://api.backdropcms.org/api/backdrop/core%21includes%21config.inc/function/config/1

docwilmot commented 6 years ago

yes, always noticed that. If you do "config*" you do get those results.

ghost commented 6 years ago

Thanks for the tip @docwilmot! I had no idea you could use wildcards like that. Good workaround, but I think this still needs addressing as it's not user-friendly to have to do that all the time...

ghost commented 5 years ago

It seems this only happens when the top matching result is either an exact match, or the beginning of a match. E.g. searching for config takes you to https://api.backdropcms.org/api/backdrop/core%21includes%21config.inc/function/config/1 (exact match), and hook_ takes you to https://api.backdropcms.org/api/backdrop/core%21modules%21system%21system.api.php/function/hook_init/1 (beginning of a match).

But non-perfect matches work as expected, they take you to the search results page. E.g. file takes you to https://api.backdropcms.org/search/node/file (top result is File, but case-sensitivity means it's not a perfect match), and test takes you to https://api.backdropcms.org/search/node/test (no near matches).