Skip to content

Instantly share code, notes, and snippets.

View nilansaha's full-sized avatar

Nilan Saha nilansaha

View GitHub Profile
@nilansaha
nilansaha / ElasticsearchHelpers.py
Created May 29, 2021 21:35 — forked from eranhirs/ElasticsearchHelpers.py
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