readthedocs / readthedocs-sphinx-search

Deprecated: Enable search-as-you-type feature for docs hosted by RTD.
https://readthedocs-sphinx-search.readthedocs.io/
MIT License
33 stars 16 forks source link

Automatically "wildcard search"? #142

Closed thephez closed 1 year ago

thephez commented 1 year ago

Is there a way to configure search to act as if a wildcard (*) is present at the end of the user-entered search string? Based on feedback I've received, this behavior is expected by some and they think the search is broken since it doesn't do that (by default). I didn't see anything about this in the docs, but may have overlooked something.

stsewd commented 1 year ago

Hi, this isn't possible at the moment. We have a feature for "fuzzy" search, but it's under a feature flag since it's slow. I see that ES also has a boolean prefix query, https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-bool-prefix-query.html, that may be faster than the fuzzy search, and could be improved by using https://www.elastic.co/guide/en/elasticsearch/reference/7.17/index-prefixes.html.

We did an experiment some years ago using multiple fields and wildcard search, but it ended up slowing down everything https://github.com/readthedocs/readthedocs.org/pull/8284 :/

thephez commented 1 year ago

That's not entirely surprising, but I figured it didn't hurt to ask. Thanks for the info!

stsewd commented 1 year ago

Opened https://github.com/readthedocs/readthedocs.org/issues/10568, since I think this feature would be useful.

thephez commented 1 year ago

Opened readthedocs/readthedocs.org#10568, since I think this feature would be useful.

Great, thanks!