-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
search query escape function #23
Comments
Yes. The search query ought to be escaped, though I would prefer a regexp like this one: import re
def solr_escape(value):
ESCAPE_CHARS_RE = re.compile(r'(?<!\\)(?P<char>[&|+\-!(){}[\]^"~*?:])')
return ESCAPE_CHARS_RE.sub(r'\\\g<char>', value) |
So. |
@thomasbilk, @ergo: take a look at solrq. It escapes queries for you and also has some other nice features. It can be used with pysolr or any other python solr client. |
Please note that |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
would it make sense to make an escape function for raw data used in searches and include it within lib itself?
something like this
The text was updated successfully, but these errors were encountered: