redoc icon indicating copy to clipboard operation
redoc copied to clipboard

This search cannot be used properly

Open HHC26 opened this issue 1 year ago • 2 comments

This search cannot be used properly, need to improve this bug image

HHC26 avatar May 16 '24 02:05 HHC26

Hi @HHC26, thank you for reporting. PRs are welcome or we can look into it later.

If you want to disable search and implement custom you can do it using disableSearch option.

AlexVarchuk avatar May 23 '24 10:05 AlexVarchuk

@AlexVarchuk,

The search term "get" would've never yielded results because Lunr is being configured with stopWordFilter. This change appears to have been in place for a long time now.

https://github.com/Redocly/redoc/blob/d193dd2627b88309eca3cec4973ba5bea2906740/src/services/SearchWorker.worker.ts#L31

If you take a look at the implementation of this filter, it includes the word "get".

https://github.com/olivernn/lunr.js/blob/aa5a878f62a6bba1e8e5b95714899e17e8150b38/lib/stop_word_filter.js#L78

If stopWordFilter is redacted, the search results for the demo should include GET-based endpoints.

Image

I'd be happy to submit a pull request to remove it altogether, or to put the removal behind some kind of global setting.

miqh avatar Oct 13 '24 04:10 miqh

I tested and cannot reproduce the issue.

ivankropyvnytskyi avatar Dec 12 '24 08:12 ivankropyvnytskyi