# Lucene query for string containing # (hash symbol)

**URL:** <https://discuss.elastic.co/t/lucene-query-for-string-containing-hash-symbol/316429>\
**Category:** Elasticsearch\
**Created:** [October 12, 2022, 11:28am UTC](https://discuss.elastic.co/t/lucene-query-for-string-containing-hash-symbol/316429 "2022-10-12T11:28:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ykara84](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ykara84/32/106391_2.png) [@ykara84](https://discuss.elastic.co/u/ykara84)\
**Post date:** [October 12, 2022, 11:28am UTC](https://discuss.elastic.co/t/lucene-query-for-string-containing-hash-symbol/316429/1 "2022-10-12T11:28:42Z")

</div>

How to query in Lucene for strings containing special characters such as @ and # for example #rescheduled i.e. it has to have the # in front of the word and not just the word itself, currently getting:

Tried all sorts of escape combinations but no luck

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5dc48e3c316b2d2723f2bf0fa8df17b59e893886.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 9, 2022, 11:28am UTC](https://discuss.elastic.co/t/lucene-query-for-string-containing-hash-symbol/316429/2 "2022-11-09T11:28:44Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
