exclude and include sections or exact text with special characters in queries
- Dominant language
- Python
- Stars
- 41.7k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
special characters like the hyphen (-) which search engines use, tilta (~) is also used by search engines for similar results, but cheat.sh use it for keyword lookup.
how about hyphen for inclusion and lowercase (_) for exclusion, mnemonically meaning up and down respectively.
while I'm working on #137, cheat.sh didn't return useful results most of the time, it returned results for bash (Bourne *again* shell) that don't work in Posix compliant bourne shell.
a section and exact text inclusion and exclusion feature would be very useful,
which can be used like `-bash` for section inclusion `-"bash"` for exact text result inclusion,
and `_bash` to exclusion results that belong to the bash section and `_"readarray"` to exlude results that include the exact text in the quotes.
of course, you'd need to restrict where these optional operators can be in the query, ether in the begging or the end, in order to parse the query correctly.
I know cheat.sh is not a search engine with a page rank algorithm, simple limited implementation will be very useful. :smiley:
Contributor guide
Research direction
No file or test is named in the issue. Start by locating cheat.sh's query parser and the code that selects sections or results, then check how special characters are currently handled. Done means the proposed inclusion, exclusion, and exact-text query forms work consistently and are covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, search
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100