# Elasticsearch query to capture '#' character

**URL:** <https://discuss.elastic.co/t/elasticsearch-query-to-capture-character/305906>\
**Category:** Kibana\
**Created:** [May 30, 2022, 8:02am UTC](https://discuss.elastic.co/t/elasticsearch-query-to-capture-character/305906 "2022-05-30T08:02:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [June 1, 2022, 11:58am UTC](https://discuss.elastic.co/t/elasticsearch-query-to-capture-character/305906/2 "2022-06-01T11:58:44Z")

</div>

Hi,

That is because "match" query is a [Full text query](https://www.elastic.co/guide/en/elasticsearch/reference/current/full-text-queries.html). Both document fields and query sentences are analyzed to tokens. Maybe the analyzer ignored "#-" and not indexed it as a token.

For exact partial match search, use wildcard queries for wildcard fields or use match phrase query with ngram analyzer. [This post](https://discuss.elastic.co/t/ngram-vs-wildcard-using-ngrams-instead-of-wildcards/260809) is related.

If "Error #-" is a prefix, use keyword mapping and [prefix query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html) is another option.

If performance is acceptable, use [runtime field](https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime.html) with your own script to parse the `message` field is also another option.

---

_[View the full topic](https://discuss.elastic.co/t/elasticsearch-query-to-capture-character/305906)._
