Skip to content
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

cuelang.org: search always corrects terms that it considers to be typos #3148

Open
jpluscplusm opened this issue May 15, 2024 · 0 comments
Open
Labels
cuelang.org frontend cuelang.org frontend UI/UX related

Comments

@jpluscplusm
Copy link
Collaborator

jpluscplusm commented May 15, 2024

What page were you looking at?

https://cuelang.org/search/?q=%22facet%22

What version of the site were you looking at?

cue-lang/cuelang.org@cfcc8af

What did you do?

I tried to see if we've defined or used the term facet anywhere.

What did you expect?

The search results would only be those pages containing the exact term specified.

What did you see instead?

Multiple pages containing the term fact; no pages that contain the term facet.

Solution

We should enable Algolia's "advanced syntax" option in the JS that makes the client-side query from /search/: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/#how-to-use. We should probably not enable it on the index by default, in case there are unintended side effects -- and in order to let this be tested in isolation, in a CL preview context.

This appears to fix #2875 as well, given the contents of the Algolia reference doc:

Phrase query: a specific sequence of terms that must be matched next to one another. A phrase query needs to be surrounded by double quotes (").
Note: Typo tolerance is disabled inside the phrase (i.e. within the quotes).

@jpluscplusm jpluscplusm added cuelang.org frontend cuelang.org frontend UI/UX related labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuelang.org frontend cuelang.org frontend UI/UX related
Projects
Status: Backlog
Development

No branches or pull requests

1 participant