Easy fix: search only works with ASCII characters
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
In searchable.rb, start with remove_invalid_search_characters and quote_query_tokens, where the ASCII-only word patterns are identified. Update the character handling so searches retain extended Latin, Greek, Cyrillic, and other non-ASCII letters, then verify that quoted and unquoted searches work with those characters.
Written by the indexing model from the issue text.
Description
Ruby’s \w is basically [a-zA-Z0-9_] which is useless for many languages.
Thus the following code ↓ inside searchable.rb means search won’t work for extended latin, greek, cyrillic, what have you
def remove_invalid_search_characters(terms)
terms.gsub(/[^\w"]/, " ") // ***********************←
end
def quote_query_tokens(terms)
terms.scan(/"[^"]*"|\w+/) // ***********************←
.filter_map { |token| token.delete('"').presence }
.map { |token| %("#{token}") }
.join(" ")
end
Replace it with [[:word:]] and this should fix it according to the benevolent AI (I don’t know shit about RoR)
- Dominant language
- Ruby
- Stars
- 551
- Forks
- 94
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 7
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.
More from basecamp/writebook
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
All issues in basecamp/writebook
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Homebrew/homebrew-cask#288729 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100