Skip to content

Added special handling for search tokens beginning with @#857

Open
smallsaucepan wants to merge 1 commit into
MLTSHP:masterfrom
smallsaucepan:forgiving-search
Open

Added special handling for search tokens beginning with @#857
smallsaucepan wants to merge 1 commit into
MLTSHP:masterfrom
smallsaucepan:forgiving-search

Conversation

@smallsaucepan

Copy link
Copy Markdown
Contributor

Implicitly double quoting before passing to mysql stops @whatever being mistaken for a fulltext search proximity operator.

Resolves #606

double quoting before passing to mysql stops @whatever being mistaken
for a fulltext search proximity operator. Resolves MLTSHP#606
Comment thread handlers/search.py
# quotes first.
# More info: @distance fulltext search proximity operator
# https://dev.mysql.com/doc/refman/8.4/en/fulltext-boolean.html
q = re.sub(r'(?<!")(\B@[\w\-]+)(?!")', r'"\1"', q)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be done in lib.utilities.clean_search_term?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@ (at symbol) throws error in searches

2 participants