-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search: fuzzy checkbox UI element #84
Comments
This is because our project has the fuzzy search flag enabled. We aren't checking for spelling errors, we are just doing a fuzzy search if you search a "single term". You can use |
Thanks for the explanation on the root cause @stsewd ! However I wonder if this is good UX. I was confused, and so extrapolating from N=1, I wonder if more people would get confused. |
This was actually so people aren't frustrated if they made a typo or don't know the exact word. This is controlled via https://github.com/readthedocs/readthedocs.org/blob/f0da2a478705c794ce046d67a3eededf5595fd33/readthedocs/search/faceted_search.py#L178-L184 https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness We were also exploring into having a UI for displaying the search options. So, not sure, personalty I like the default fuzzy and prefix search, and use |
I see how users might get frustrated if they made a typo, or if they used a different spelling (British vs American for example). So doing the fuzzy search is a great addition. However, for cases in which the user didn't make a typo:
So, I think it would be cool to have an admonition on top of the search page saying something like
|
+1 on adding that admonition in our search extension |
We could also inject that message in search page without requiring our search extension, but not sure about changing that content in behalf of users. |
I think Adding it on the modal communicates the extra options before the user searches for a term. Also, if the user doesn't hit enter on that modal, they will never see the On the In any case, I think it would also be good to have an icon or something in the search box in the left (in our theme) that can hover/click and go directly to the documentation. |
Adding info here is a good idea! Maybe each word could even have an (x) nearby that the user could click to exclude that word? |
I don't know how the fuzzy search works, but maybe we don't have the list of "extra words" that are being searched? I'll let others clarify that though. |
@astrojuanlu yeah, not sure if we have the list (but we can extract them from the matches), but we also do a prefix search (words that start with the current search), so the list could get pretty large. |
We don't need to display the full list, just the 1st N search terms. |
This would be a really good UI element (
This is tracked in #33 |
@stsewd if I understand correctly, we can control the fuzzy at search time (when the user performs the query), based on this code: https://github.com/readthedocs/readthedocs.org/blob/83805a643d56764f893ff65f764bf993c74fb582/readthedocs/search/faceted_search.py#L115-L130 It seems we can have a Am I correct? What do you think? |
yeah, we can control that at search time, it's under a feature flag, since it can be slow |
OK. Then, the work required here would be:
Anything else you have in mind? |
I think we should still have it under a feature flag until we prioritize optimizing ES. |
@stsewd well, the goal of this issue is to remove the feature flag and expose the feature to users. What does it mean it can be slow? Will that kill our servers? Can we add a timeout to ES queries as we do with PostgreSQL? |
It seems we can specify a timeout on each query, https://www.elastic.co/guide/en/elasticsearch/reference/current/search-your-data.html#search-timeout, but also there is a |
This would be also useful for the case described in readthedocs/readthedocs.org#10321 👍🏼 |
@stsewd where does live the configuration of Elastic for production? How I can define the I have the same questions for our development instance. Reading the docs, I didn't get where should I define these settings. Do you know how to do this? |
Looks like that's a search option, so probably somewhere in search/faceted_search.py. But I don't think we should expose this to all users yet. If the timeout makes the feature unusable, don't think we should expose a broken feature. |
This is similar to what we are doing in PostgreSQL to avoid running long queries and degrading the service. Related readthedocs/addons#84
I searched for "context" but started getting results for "content", which was confusing.
The text was updated successfully, but these errors were encountered: