Skip to content

Conversation

@mudler
Copy link
Owner

@mudler mudler commented Oct 16, 2025

Description

This pull request improves the search functionality in the gallery module by introducing fuzzy matching, making searches more flexible and user-friendly. The main change is the replacement of simple substring matching with fuzzy matching for several fields, along with the addition of a new dependency.

Search functionality enhancement:

  • Replaced strings.Contains with fuzzy.Match for matching the search term against model name, description, and gallery name in the Search method of GalleryElements in core/gallery/gallery.go. This allows for more flexible and tolerant search results.

Dependency management:

  • Added the github.com/lithammer/fuzzysearch package as an indirect dependency in go.mod to support fuzzy matching in search.
  • Imported the fuzzy package from github.com/lithammer/fuzzysearch/fuzzy in core/gallery/gallery.go to enable fuzzy search functionality.

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@netlify
Copy link

netlify bot commented Oct 16, 2025

Deploy Preview for localai ready!

Name Link
🔨 Latest commit fc4d442
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/68f1111fa3155500086c89b0
😎 Deploy Preview https://deploy-preview-6481--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mudler mudler added the enhancement New feature or request label Oct 16, 2025
@mudler mudler changed the title chore(model gallery): add fuzzy search feat(gallery): add fuzzy search Oct 16, 2025
@mudler mudler merged commit 83534f8 into master Oct 16, 2025
31 checks passed
@mudler mudler deleted the gallery_fuzzy branch October 16, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants