Skip to content

Instantly share code, notes, and snippets.

View eranhirs's full-sized avatar

Eran Hirsch eranhirs

View GitHub Profile
@eranhirs
eranhirs / ElasticsearchHelpers.py
Last active May 29, 2021 21:35
Sanitize a query string for Elasticsearch / Lucene . Based on a discussion on Stack Overflow: http://stackoverflow.com/questions/16205341/symbols-in-query-string-for-elasticsearch
import re
class ElasticsearchHelpers(object):
"""
Sanitize a query string for Elasticsearch / Lucene.
Based on:
http://stackoverflow.com/questions/16205341/symbols-in-query-string-for-elasticsearch
https://gist.github.com/bcoe/6505434