# Term filter with 'special' characters

**URL:** <https://discuss.elastic.co/t/term-filter-with-special-characters/11769>\
**Category:** Elasticsearch\
**Created:** [May 1, 2013, 4:46pm UTC](https://discuss.elastic.co/t/term-filter-with-special-characters/11769 "2013-05-01T16:46:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stik\_kos](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@Stik\_kos](https://discuss.elastic.co/u/Stik_kos)\
**Post date:** [May 1, 2013, 4:46pm UTC](https://discuss.elastic.co/t/term-filter-with-special-characters/11769/1 "2013-05-01T16:46:28Z")

</div>

Hello,

I am trying to use a term filter but i don't receive any results and i  
think the problem is due to the use of 'special' characters...

My search item has a property called "code" with a value  
"test#b7ee8e9f-acd6-489b-b37f-d9c651f1b23b"

In my mapping, i specify the analyzer to be simple in order not to loose  
the "special" characters as follows:

.startObject("code")  
.field("analyzer", "simple")  
.field("type", "string")  
.endObject()

I have tried to use the code property in a term filter both i don't get any  
results. I've also tried to escape the special characters (as described  
[http://lucene.apache.org/core/old\_versioned\_docs/versions/3\_4\_0/queryparsersyntax.html#Escaping%20Special%20Characters](http://lucene.apache.org/core/old_versioned_docs/versions/3_4_0/queryparsersyntax.html#Escaping%20Special%20Characters))  
but that didn't change anything.

What am i doing wrong please?

Thanks!  
Stik

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [May 1, 2013, 6:56pm UTC](https://discuss.elastic.co/t/term-filter-with-special-characters/11769/2 "2013-05-01T18:56:59Z")

</div>

Term filters terms are not analyzed, so it should be applied against a  
field that is not-analyzed or with KeywordAnalyzer.

--  
Ivan

On Wed, May 1, 2013 at 9:46 AM, Stik kos [stikkos@gmail.com](mailto:stikkos@gmail.com) wrote:

> Hello,
> 
> I am trying to use a term filter but i don't receive any results and i  
> think the problem is due to the use of 'special' characters...
> 
> My search item has a property called "code" with a value  
> "test#b7ee8e9f-acd6-489b-b37f-d9c651f1b23b"
> 
> In my mapping, i specify the analyzer to be simple in order not to loose  
> the "special" characters as follows:
> 
> .startObject("code")  
> .field("analyzer", "simple")  
> .field("type", "string")  
> .endObject()
> 
> I have tried to use the code property in a term filter both i don't get  
> any results. I've also tried to escape the special characters (as described  
> [Apache Lucene - Query Parser Syntax](http://lucene.apache.org/core/old_versioned_docs/versions/3_4_0/queryparsersyntax.html#Escaping%20Special%20Characters))  
> but that didn't change anything.
> 
> What am i doing wrong please?
> 
> Thanks!  
> Stik
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:38am UTC](https://discuss.elastic.co/t/term-filter-with-special-characters/11769/3 "2017-07-06T02:38:46Z")

</div>


