Using elastic search's query DSL this is how I am currently constructing my query:

elastic_sort = [ { "timestamp": {"order": "desc" }}, "_score", { "name": { "order": "desc" }}, { "channel": { "order": "desc" }}, ] elastic_query = { "fuzzy_like_this" : { "fields" : [ "msgs.channel", "msgs.msg", "msgs.name" ], "like_text" : search_string, "max_query_terms" : 10, "fuzziness": 0.7, } } res = self.es.search(index="chat", body={ "from" : from_result, "size" : results_per_page, "track_scores": True, "query": elastic_query, "sort": elastic_sort, })

I've been trying to implement a filter or an analyzer that will allow the inclusion of "#" in searches (I want a search for "#thing" to return results that include "#thing"), but I am coming up short. The error messages I am getting are not helpful and just telling me that my query is malformed.

I attempted to incorporate the method found here : http://www.fullscale.co/blog/2013/03/04/preserving_specific_characters_during_tokenizing_in_elasticsearch.html but it doesn't make any sense to me in context.

Does anyone have a clue how I can do this?