# Is TEST a reserved keyword?

**URL:** <https://discuss.elastic.co/t/is-test-a-reserved-keyword/10301>\
**Category:** Elasticsearch\
**Created:** [January 10, 2013, 9:46pm UTC](https://discuss.elastic.co/t/is-test-a-reserved-keyword/10301 "2013-01-10T21:46:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emanuele\_Massara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emanuele_massara/32/2542_2.png) [@Emanuele\_Massara](https://discuss.elastic.co/u/Emanuele_Massara)\
**Post date:** [January 10, 2013, 9:46pm UTC](https://discuss.elastic.co/t/is-test-a-reserved-keyword/10301/1 "2013-01-10T21:46:25Z")

</div>

Hi there, today we run into an issue that took almost one hour to debug and  
solve.

Like I posted on [https://gist.github.com/4505957](https://gist.github.com/4505957) , we had a really simple  
schema, BUT one of the fields contained "TEST" as its value.  
It wasn't possible to get a match from any queries.

The problem can be easily replicated in a new clean ElasticSearch  
installation, I just downloaded the 0.20.2 from the web site.  
I just started Elastic Search, created an index and put the two documents  
as they are, with no mapping defined before the first PUT call.  
If I change the value to "test", all works as expected and the result is  
found.

I have this issue also with a 0.17.X version that I have on my notebook,  
sorry I don't remember the second revision number.

I also had an issue some weeks ago with a field named "created\_at" (we had  
to change it to "creation\_date"), probably it is the same problem.  
If there are really some reserved words, please take some time to document  
them.

Thanks for the attention

Emanuele

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 11, 2013, 2:16am UTC](https://discuss.elastic.co/t/is-test-a-reserved-keyword/10301/2 "2013-01-11T02:16:50Z")

</div>

By default, you use a standard analyzer. So TEST is indexed as test.  
A TermFilter is not analyzed. So ES is trying to compare TEST with test which is different.

Use a matchFilter (which is analyzed), change the analyzer to not analyzed or keyword analyzer, or search for test (as you did).

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 10 janv. 2013 à 22:46, Emanuele Massara [emas80@gmail.com](mailto:emas80@gmail.com) a écrit :

Hi there, today we run into an issue that took almost one hour to debug and solve.

Like I posted on [https://gist.github.com/4505957](https://gist.github.com/4505957) , we had a really simple schema, BUT one of the fields contained "TEST" as its value.  
It wasn't possible to get a match from any queries.

The problem can be easily replicated in a new clean ElasticSearch installation, I just downloaded the 0.20.2 from the web site.  
I just started Elastic Search, created an index and put the two documents as they are, with no mapping defined before the first PUT call.  
If I change the value to "test", all works as expected and the result is found.

I have this issue also with a 0.17.X version that I have on my notebook, sorry I don't remember the second revision number.

I also had an issue some weeks ago with a field named "created\_at" (we had to change it to "creation\_date"), probably it is the same problem.  
If there are really some reserved words, please take some time to document them.

Thanks for the attention

Emanuele

--

--

---

<div class="post-metadata">

**Author:** ![Emanuele\_Massara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emanuele_massara/32/2542_2.png) [@Emanuele\_Massara](https://discuss.elastic.co/u/Emanuele_Massara)\
**Post date:** [January 11, 2013, 10:57am UTC](https://discuss.elastic.co/t/is-test-a-reserved-keyword/10301/3 "2013-01-11T10:57:45Z")

</div>

Hi, thanks for the reply.  
It seems that I will have to configure better the collection, maybe setting  
a mapping etc.  
I have other problems with a field containing the "-" character.

The documentation on the web site is not so clear, all the examples are  
very easy to replicate and it seems that much of the work is done by  
Elasticsearch "magic".  
I didn't found anything about upper and lowercases and "-", and created\_at  
of course.

Maybe you should add some sort of "better practices"

Thanks

Emanuele

On Friday, January 11, 2013 3:16:50 AM UTC+1, David Pilato wrote:

> By default, you use a standard analyzer. So TEST is indexed as test.  
> A TermFilter is not analyzed. So ES is trying to compare TEST with test  
> which is different.
> 
> Use a matchFilter (which is analyzed), change the analyzer to not analyzed  
> or keyword analyzer, or search for test (as you did).
> 
> HTH
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 10 janv. 2013 à 22:46, Emanuele Massara \<[ema...@gmail.com](mailto:ema...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> Hi there, today we run into an issue that took almost one hour to debug  
> and solve.
> 
> Like I posted on [It seems that in Elastic Search TEST is a reserved keyword · GitHub](https://gist.github.com/4505957) , we had a really simple  
> schema, BUT one of the fields contained "TEST" as its value.  
> It wasn't possible to get a match from any queries.
> 
> The problem can be easily replicated in a new clean Elasticsearch  
> installation, I just downloaded the 0.20.2 from the web site.  
> I just started Elastic Search, created an index and put the two documents  
> as they are, with no mapping defined before the first PUT call.  
> If I change the value to "test", all works as expected and the result is  
> found.
> 
> I have this issue also with a 0.17.X version that I have on my notebook,  
> sorry I don't remember the second revision number.
> 
> I also had an issue some weeks ago with a field named "created\_at" (we had  
> to change it to "creation\_date"), probably it is the same problem.  
> If there are really some reserved words, please take some time to document  
> them.
> 
> Thanks for the attention
> 
> Emanuele
> 
> --

--

---

<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:56am UTC](https://discuss.elastic.co/t/is-test-a-reserved-keyword/10301/4 "2017-07-06T02:56:54Z")

</div>


