typesense / typesense/typesense
Feature Request: Allow Prefix Search on All Tokens
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.6k
- Forks
- 973
- Avg merge
- 18h 45m
- Merged PRs (30d)
- 4
Description
Feature Request
Hello! I would like to request the ability to do prefix searching on all tokens, similar to what Algolia provides with https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching/#querytypeprefixall
Use Case
My real world use case is similar to what Algolia mentions in the doc above:
If users are searching in a domain where many words are commonly shortened, prefixAll could be suitable - for example, “spec review” instead of “specification review.”
My use case is employee search. In the internal applications we build at my company, it is common to provide an employee search feature. When people search for employees, they tend to use their "nicknames" or common shortened versions of peoples names, some examples being:
- Search "ben johnson" to find the employee who is legally named "benjamin johnson"
- Search "andy jones" to find the employee who is legally named "anderson jones"
Currently, achieving something similar in Typesense is proving to be difficult without some unintuitive combination of search parameters or without returning several irrelevant results.
In the community Slack channel, I received a recommendation to reverse the order of the words before actually performing the search, which actually does provide the results I'm looking for, however that feels like a fragile solution that likely has some pitfalls to it. Even if that isn't the case, requiring that the frontend of an application take the extra step of reversing the searched words definitely makes it a little less "works out of the box".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by locating the existing search-parameter and token-matching paths, then define how prefix matching should apply to every token and validate it against the employee-name examples in the request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100