Skip to content

Exact matches not properly sorted in prefix search results #36

@ginkelsoft-development

Description

@ginkelsoft-development

Description

When performing a prefix search, exact matches appear in the results but are not properly sorted to the top of the list. For example, when searching for "Wilma", the exact match "Wilma" should appear first, but currently appears somewhere in the middle or bottom of the results alongside longer matches like "Wilmaaaa" or "Wilmar".

Expected Behavior

  • Exact matches should be prioritized and appear at the top of search results
  • Shorter matches should rank higher than longer matches in prefix searches
  • Results should be sorted by relevance (e.g., by field length)

Current Behavior

  • All prefix matches are returned in arbitrary order
  • Exact matches are not distinguished from partial matches
  • No relevance scoring is applied to search results

Suggested Solution

Implement relevance scoring for search results:

  • Sort by field length (shorter = more relevant)
  • Prioritize exact matches over prefix matches
  • Apply sorting consistently across single-field and multi-field searches

Impact

This affects the user experience when searching, as users expect exact matches to appear first in the results list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions