typesense / typesense/typesense
Add `exact_match` option to schema's field parameters
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.6k
- Forks
- 973
- Avg merge
- 18h 45m
- Merged PRs (30d)
- 4
Description
Description:
Currently, the only way to achieve exact string matching in Typesense is by adding characters to symbols_to_index. However, this approach applies to all fields in the collection, which may not always be desirable.
Steps to Reproduce:
- Set a field of type
string[]in your schema, such assizes. - Insert documents with values like
["11.5", "12", "4.5"]for thesizesfield. - Try filtering using the
sizesfield with the value45.
Expected Behavior:
The filter should return documents that exactly match the value 45. No documents containing 4.5 should be included in the results.
Actual Behavior:
The filter returns documents that include 4.5, despite not being an exact match to 45.
Proposed Solution:
Introduce an exact_match parameter to field definitions within the schema. When set to true, this parameter should enforce exact matching for the field during filtering operations.
Metadata:
- Typesense Version: v27.0
- OS: Cloud
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
Start by reproducing the string[] sizes case described in the issue, then trace schema field definitions into the filtering operations that handle field parameters. Done means an exact_match option can be enabled for an individual field and filtering for 45 excludes values such as 4.5 without changing other fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- search
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100