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

Increase relevance of (partial) exact matches #2203

Closed
fredrikekre opened this issue Aug 7, 2023 · 12 comments
Closed

Increase relevance of (partial) exact matches #2203

fredrikekre opened this issue Aug 7, 2023 · 12 comments
Labels
Format: HTML Related to the default HTML output Type: Enhancement

Comments

@fredrikekre
Copy link
Member

I played around a bit with the new search functionality and this is issue is essentially the same request as in #2141 (comment)

In 99% of cases I know the exact function I am looking for so it would be great to increase the importance of exact matches. As it is right now it is IMO a bit annoying since you essentially have to type out the whole name until you get a match.

@mortenpi
Copy link
Member

mortenpi commented Aug 7, 2023

Cc @Hetarth02

@mortenpi
Copy link
Member

mortenpi commented Aug 7, 2023

Then filtering in #2202 should also help with that a bit. It would actually be good to get a bit of feedback on that, whether that's good UX or not.

@Hetarth02
Copy link
Contributor

I am confused about what the fuzzy search distance should be. If it is very much then one can get unwanted results and if its less(the case right now) we already know as mentioned above.

We should probably try out some distances with this, but I would suggest not going farther than 3.

@mortenpi
Copy link
Member

I think the point here is that we want the matches that match exactly to be prioritized, and fuzzy matches shown a bit lower? The exact fuzzy distance in that sense is irrelevant here.

@mortenpi mortenpi added Type: Enhancement Format: HTML Related to the default HTML output labels Aug 10, 2023
@Hetarth02
Copy link
Contributor

Hmm, so basically a mix of exact and fuzzy searches could be a good thing...?

Like have top 10 or so searches which are exact matches and others with fuzzy, sound reasonable?

@mortenpi
Copy link
Member

mortenpi commented Aug 10, 2023

Yep, I think so. I am not sure you need to limit the number of exact matches though? They should probably always be prioritized? The only thing to think about is e.g. module names.. if we have those in the "title", then they might be very repetitive.

@Hetarth02
Copy link
Contributor

Also, we might need to limit one or other search because either of them can have repetitive results which we don't want.

@mortenpi
Copy link
Member

I feel that, ideally, repetitive results should be removed, rather than working around the problem by just throwing away (potentially) correct results because were hitting some arbitrary limit.

@fingolfin
Copy link
Contributor

Just switched https://juliatesting.github.io/Aqua.jl/dev to use Documenter 1.0, and tried the new search:

  • test_ambiguities: unique hit found (yay)
  • test_ambiguitie: unique hit found (yay)
  • test_ambiguit: zero hits :-( -- old Documenter found this, down to test_ambi
  • test_amb: one hit, but it is test_all (same as in old Documenter)

All in all I think that perfect prefixes need to be considered much more strongly...

(OK, old Documenter search also was weird; e.g. test_ambiguit gives a unique correct hit; test_ambiguiti (one letter more) suddenly things test_all also is a match; and test_ambiguitie (yet one letter more) suddenly has zero hits. WHAT?)
`

@digital-carver
Copy link

digital-carver commented Nov 28, 2023

Minisearch has a separate option for enabling prefix searches, so it looks like just adding prefix: true to searchOptions should be sufficient to solve this particular issue.

Instead of true, the option can also be passed a function, so that we search only when the user has entered at least 3 letters.

They don't specify whether prefix-matched results are ranked lower than exact matches in their docs. It seems like that should be the case based on this discussion, but that's worth verifying.

@Hetarth02
Copy link
Contributor

Thanks for this, will probably look into it this weekend.

@mortenpi
Copy link
Member

#2375

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Format: HTML Related to the default HTML output Type: Enhancement
Projects
None yet
Development

No branches or pull requests

5 participants