CivicDataLab / CivicDataLab/DataSpaceBackend
Dataset search returns nothing for uppercase or multi-word queries
@saqibmanan is already working on this.
Since Sep 18, 2026.
- Dominant language
- Python
- Stars
- 2
- Forks
- 1
- Avg merge
- 52m
- Merged PRs (30d)
- 40
Description
What: dataset search misses obvious matches. Uppercase and multi-word queries return nothing, and long words match only through the description.
Why it matters: users on prod searching a title they can see get no results.
Evidence (/api/search/dataset/?query=…, 2026-09-18), against the title "KHOJ - Dataset about the judges of the Telangana High Court":
| query | dev | prod |
|---|---|---|
khoj |
2 | 3 |
KHOJ |
0 | 0 |
high court |
0 | 0 |
Cause: generate_q_expression in api/views/search_dataset.py builds fuzzy queries, which aren't analyzed, so the raw input is compared as one term. The title is indexed by ngram_analyser as lowercase 4-character grams (search/documents/analysers.py), so only short, lowercase, single-word queries can match a gram within the fuzzy edit distance.
Fix: not fixed. Likely a multi_match (analyzed) query for text fields, keeping fuzziness as an option.
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.
Assessment
This issue has not been assessed yet.