# Searching JSON value "A" / "a"

**URL:** <https://discuss.elastic.co/t/searching-json-value-a-a/3053>\
**Category:** Elasticsearch\
**Created:** [June 30, 2010, 3:21am UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053 "2010-06-30T03:21:20Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franz\_Allan\_Valencia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franz_allan_valencia/32/3326_2.png) [@Franz\_Allan\_Valencia](https://discuss.elastic.co/u/Franz_Allan_Valencia)\
**Post date:** [June 30, 2010, 3:21am UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/1 "2010-06-30T03:21:20Z")

</div>

Good day,

I have a field that accepts a single character - either 'A' or 'P'.

I can index them no properly (i think) with:

> curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1, "statusCode"  
> : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P", "nocamelcase" :  
> "A", "aValue" : "A", "bValue" : "B", "pValue" : "P", "zValue" : "Z" }'  
> curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2, "statusCode"  
> : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A", "nocamelcase" :  
> "P", "aValue" : "a", "bValue" : "b", "pValue" : "p", "zValue" : "z" }'

Accessing these two documents with [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) and  
[http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put in. That  
part is fine.

Also, for the most part, searching is ok because I can retrieve the values  
that I want (i.e. searching with  
[http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me a hit which  
is 'test dummy 2').

However, when I do search for documents wherein the value is 'A' (or 'a')  
like [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A), I am not  
getting any hits. I've also tried searching against the fields  
'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they  
all can't make a match (for both "A" and "a"). Also, other letters like B,  
b, P, p, Z, z seems to be ok.

Are the letters "A" & "a" reserved words?

Some info on my setup:

franz@see:~$ uname -a  
Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010  
x86\_64 GNU/Linux  
franz@see:~$ echo $JAVA\_HOME  
/opt/java/64/jdk1.6.0\_17  
franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version  
java version "1.6.0\_17"  
Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)  
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)  
franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml  
#gateway:

# type: hdfs

# hdfs:

# uri: hdfs://localhost:8020

# path: /opt/vc/aptab/es-gateway

(Note: at first I was working on HDFS. But when I encountered this problem,  
i tried reverting to the default setting which is an empty elasticsearch.yml  
and still does not work).

Thanks,

--  
Franz Allan Valencia See | Java Software Engineer  
[franz.see@gmail.com](mailto:franz.see@gmail.com)  
LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [June 30, 2010, 5:44am UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/2 "2010-06-30T05:44:03Z")

</div>

Hi,

isn't 'a' a stop word? Depending on your analysis used during indexing  
single 'a' may be removed.

Regards,  
Lukas

On Wed, Jun 30, 2010 at 5:21 AM, Franz Allan Valencia See \<  
[franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:

> Good day,
> 
> I have a field that accepts a single character - either 'A' or 'P'.
> 
> I can index them no properly (i think) with:
> 
> > curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1, "statusCode"  
> > : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P", "nocamelcase" :  
> > "A", "aValue" : "A", "bValue" : "B", "pValue" : "P", "zValue" : "Z" }'  
> > curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2, "statusCode"  
> > : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A", "nocamelcase" :  
> > "P", "aValue" : "a", "bValue" : "b", "pValue" : "p", "zValue" : "z" }'
> 
> Accessing these two documents with [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) and  
> [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put in. That  
> part is fine.
> 
> Also, for the most part, searching is ok because I can retrieve the values  
> that I want (i.e. searching with  
> [http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me a hit  
> which is 'test dummy 2').
> 
> However, when I do search for documents wherein the value is 'A' (or 'a')  
> like [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A), I am not  
> getting any hits. I've also tried searching against the fields  
> 'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they  
> all can't make a match (for both "A" and "a"). Also, other letters like B,  
> b, P, p, Z, z seems to be ok.
> 
> Are the letters "A" & "a" reserved words?
> 
> Some info on my setup:
> 
> franz@see:~$ uname -a  
> Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010  
> x86\_64 GNU/Linux  
> franz@see:~$ echo $JAVA\_HOME  
> /opt/java/64/jdk1.6.0\_17  
> franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version  
> java version "1.6.0\_17"  
> Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)  
> Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)  
> franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml  
> #gateway:
> 
> # type: hdfs
> 
> # hdfs:
> 
> # uri: hdfs://localhost:8020
> 
> # path: /opt/vc/aptab/es-gateway
> 
> (Note: at first I was working on HDFS. But when I encountered this problem,  
> i tried reverting to the default setting which is an empty elasticsearch.yml  
> and still does not work).
> 
> Thanks,
> 
> --  
> Franz Allan Valencia See | Java Software Engineer  
> [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

---

<div class="post-metadata">

**Author:** ![Franz\_Allan\_Valencia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franz_allan_valencia/32/3326_2.png) [@Franz\_Allan\_Valencia](https://discuss.elastic.co/u/Franz_Allan_Valencia)\
**Post date:** [June 30, 2010, 7:52am UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/3 "2010-06-30T07:52:19Z")

</div>

ohh.....right right. Ok, I'll look into that. Thanks 🙂

On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com) wrote:

> Hi,
> 
> isn't 'a' a stop word? Depending on your analysis used during indexing  
> single 'a' may be removed.
> 
> Regards,  
> Lukas
> 
> On Wed, Jun 30, 2010 at 5:21 AM, Franz Allan Valencia See \<  
> [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> 
> > Good day,
> > 
> > I have a field that accepts a single character - either 'A' or 'P'.
> > 
> > I can index them no properly (i think) with:
> > 
> > > curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1,  
> > > "statusCode" : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P",  
> > > "nocamelcase" : "A", "aValue" : "A", "bValue" : "B", "pValue" : "P",  
> > > "zValue" : "Z" }'  
> > > curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2,  
> > > "statusCode" : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A",  
> > > "nocamelcase" : "P", "aValue" : "a", "bValue" : "b", "pValue" : "p",  
> > > "zValue" : "z" }'
> > 
> > Accessing these two documents with [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) and  
> > [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put in.  
> > That part is fine.
> > 
> > Also, for the most part, searching is ok because I can retrieve the values  
> > that I want (i.e. searching with  
> > [http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me a hit  
> > which is 'test dummy 2').
> > 
> > However, when I do search for documents wherein the value is 'A' (or 'a')  
> > like [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A), I am not  
> > getting any hits. I've also tried searching against the fields  
> > 'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they  
> > all can't make a match (for both "A" and "a"). Also, other letters like B,  
> > b, P, p, Z, z seems to be ok.
> > 
> > Are the letters "A" & "a" reserved words?
> > 
> > Some info on my setup:
> > 
> > franz@see:~$ uname -a  
> > Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010  
> > x86\_64 GNU/Linux  
> > franz@see:~$ echo $JAVA\_HOME  
> > /opt/java/64/jdk1.6.0\_17  
> > franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version  
> > java version "1.6.0\_17"  
> > Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)  
> > Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)  
> > franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml  
> > #gateway:
> > 
> > # type: hdfs
> > 
> > # hdfs:
> > 
> > # uri: hdfs://localhost:8020
> > 
> > # path: /opt/vc/aptab/es-gateway
> > 
> > (Note: at first I was working on HDFS. But when I encountered this  
> > problem, i tried reverting to the default setting which is an empty  
> > elasticsearch.yml and still does not work).
> > 
> > Thanks,
> > 
> > --  
> > Franz Allan Valencia See | Java Software Engineer  
> > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

--  
Franz Allan Valencia See | Java Software Engineer  
[franz.see@gmail.com](mailto:franz.see@gmail.com)  
LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 30, 2010, 10:16am UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/4 "2010-06-30T10:16:41Z")

</div>

Usually, this type of fields (status code) should be configured to be  
"not\_analyzed" in the index section. Note, in this case, you will get hits  
only on `A`, not on `a`.

-shay.banon

On Wed, Jun 30, 2010 at 10:52 AM, Franz Allan Valencia See \<  
[franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:

> ohh.....right right. Ok, I'll look into that. Thanks 🙂
> 
> On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com)wrote:
> 
> > Hi,
> > 
> > isn't 'a' a stop word? Depending on your analysis used during indexing  
> > single 'a' may be removed.
> > 
> > Regards,  
> > Lukas
> > 
> > On Wed, Jun 30, 2010 at 5:21 AM, Franz Allan Valencia See \<  
> > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > 
> > > Good day,
> > > 
> > > I have a field that accepts a single character - either 'A' or 'P'.
> > > 
> > > I can index them no properly (i think) with:
> > > 
> > > > curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1,  
> > > > "statusCode" : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P",  
> > > > "nocamelcase" : "A", "aValue" : "A", "bValue" : "B", "pValue" : "P",  
> > > > "zValue" : "Z" }'  
> > > > curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2,  
> > > > "statusCode" : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A",  
> > > > "nocamelcase" : "P", "aValue" : "a", "bValue" : "b", "pValue" : "p",  
> > > > "zValue" : "z" }'
> > > 
> > > Accessing these two documents with [http://localhost:9200/test/dummy/1and](http://localhost:9200/test/dummy/1and)  
> > > [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put in.  
> > > That part is fine.
> > > 
> > > Also, for the most part, searching is ok because I can retrieve the  
> > > values that I want (i.e. searching with  
> > > [http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me a hit  
> > > which is 'test dummy 2').
> > > 
> > > However, when I do search for documents wherein the value is 'A' (or 'a')  
> > > like [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A), I am not  
> > > getting any hits. I've also tried searching against the fields  
> > > 'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they  
> > > all can't make a match (for both "A" and "a"). Also, other letters like B,  
> > > b, P, p, Z, z seems to be ok.
> > > 
> > > Are the letters "A" & "a" reserved words?
> > > 
> > > Some info on my setup:
> > > 
> > > franz@see:~$ uname -a  
> > > Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010  
> > > x86\_64 GNU/Linux  
> > > franz@see:~$ echo $JAVA\_HOME  
> > > /opt/java/64/jdk1.6.0\_17  
> > > franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version  
> > > java version "1.6.0\_17"  
> > > Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)  
> > > Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)  
> > > franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml  
> > > #gateway:
> > > 
> > > # type: hdfs
> > > 
> > > # hdfs:
> > > 
> > > # uri: hdfs://localhost:8020
> > > 
> > > # path: /opt/vc/aptab/es-gateway
> > > 
> > > (Note: at first I was working on HDFS. But when I encountered this  
> > > problem, i tried reverting to the default setting which is an empty  
> > > elasticsearch.yml and still does not work).
> > > 
> > > Thanks,
> > > 
> > > --  
> > > Franz Allan Valencia See | Java Software Engineer  
> > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> 
> --  
> Franz Allan Valencia See | Java Software Engineer  
> [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

---

<div class="post-metadata">

**Author:** ![Franz\_Allan\_Valencia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franz_allan_valencia/32/3326_2.png) [@Franz\_Allan\_Valencia](https://discuss.elastic.co/u/Franz_Allan_Valencia)\
**Post date:** [July 14, 2010, 1:40pm UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/5 "2010-07-14T13:40:26Z")

</div>

seems like im still stuck with this whole not\_analyzed thing 🙂

I did the following commands:

> $ curl -XPUT '[http://localhost:9200/dummy/dummy/1](http://localhost:9200/dummy/dummy/1)' -d '  
> {  
> "statusCode" : "A"  
> }  
> '  
> {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"1"}
> 
> $ curl -XPUT '[http://localhost:9200/dummy/dummy/2](http://localhost:9200/dummy/dummy/2)' -d '  
> {  
> "statusCode" : "P"  
> }  
> '  
> {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"2"}
> 
> $ curl -XPUT '[http://localhost:9200/dummy/dummy/\_mapping](http://localhost:9200/dummy/dummy/_mapping)' -d '  
> {  
> "_default_" : {  
> "properties" : {  
> "statusCode" : {"type" : "string", "store" : "yes", "index" :  
> "not\_analyzed" }  
> }  
> }  
> }  
> '  
> {"ok":true,"acknowledged":false}

I'm not sure what "ok":"true" but "acknowledged":false is, but searching for  
[http://localhost:9200/dummy/dummy/\_search?q=statusCode:A](http://localhost:9200/dummy/dummy/_search?q=statusCode:A) still yields no  
results.

What am i doing wrong?

Thanks,

--  
Franz Allan Valencia See | Java Software Engineer  
[franz.see@gmail.com](mailto:franz.see@gmail.com)  
LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

On Wed, Jun 30, 2010 at 6:16 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Usually, this type of fields (status code) should be configured to be  
> "not\_analyzed" in the index section. Note, in this case, you will get hits  
> only on `A`, not on `a`.
> 
> -shay.banon
> 
> On Wed, Jun 30, 2010 at 10:52 AM, Franz Allan Valencia See \<  
> [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> 
> > ohh.....right right. Ok, I'll look into that. Thanks 🙂
> > 
> > On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com)wrote:
> > 
> > > Hi,
> > > 
> > > isn't 'a' a stop word? Depending on your analysis used during indexing  
> > > single 'a' may be removed.
> > > 
> > > Regards,  
> > > Lukas
> > > 
> > > On Wed, Jun 30, 2010 at 5:21 AM, Franz Allan Valencia See \<  
> > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > 
> > > > Good day,
> > > > 
> > > > I have a field that accepts a single character - either 'A' or 'P'.
> > > > 
> > > > I can index them no properly (i think) with:
> > > > 
> > > > > curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1,  
> > > > > "statusCode" : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P",  
> > > > > "nocamelcase" : "A", "aValue" : "A", "bValue" : "B", "pValue" : "P",  
> > > > > "zValue" : "Z" }'  
> > > > > curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2,  
> > > > > "statusCode" : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A",  
> > > > > "nocamelcase" : "P", "aValue" : "a", "bValue" : "b", "pValue" : "p",  
> > > > > "zValue" : "z" }'
> > > > 
> > > > Accessing these two documents with [http://localhost:9200/test/dummy/1and](http://localhost:9200/test/dummy/1and)  
> > > > [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put in.  
> > > > That part is fine.
> > > > 
> > > > Also, for the most part, searching is ok because I can retrieve the  
> > > > values that I want (i.e. searching with  
> > > > [http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me a hit  
> > > > which is 'test dummy 2').
> > > > 
> > > > However, when I do search for documents wherein the value is 'A' (or  
> > > > 'a') like [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A), I am  
> > > > not getting any hits. I've also tried searching against the fields  
> > > > 'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they  
> > > > all can't make a match (for both "A" and "a"). Also, other letters like B,  
> > > > b, P, p, Z, z seems to be ok.
> > > > 
> > > > Are the letters "A" & "a" reserved words?
> > > > 
> > > > Some info on my setup:
> > > > 
> > > > franz@see:~$ uname -a  
> > > > Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010  
> > > > x86\_64 GNU/Linux  
> > > > franz@see:~$ echo $JAVA\_HOME  
> > > > /opt/java/64/jdk1.6.0\_17  
> > > > franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version  
> > > > java version "1.6.0\_17"  
> > > > Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)  
> > > > Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)  
> > > > franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml  
> > > > #gateway:
> > > > 
> > > > # type: hdfs
> > > > 
> > > > # hdfs:
> > > > 
> > > > # uri: hdfs://localhost:8020
> > > > 
> > > > # path: /opt/vc/aptab/es-gateway
> > > > 
> > > > (Note: at first I was working on HDFS. But when I encountered this  
> > > > problem, i tried reverting to the default setting which is an empty  
> > > > elasticsearch.yml and still does not work).
> > > > 
> > > > Thanks,
> > > > 
> > > > --  
> > > > Franz Allan Valencia See | Java Software Engineer  
> > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > 
> > --  
> > Franz Allan Valencia See | Java Software Engineer  
> > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 14, 2010, 1:45pm UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/6 "2010-07-14T13:45:00Z")

</div>

You need to set the mapping before you index data, and don't set _default_,  
using the actual type you want to change.

-shay.banon

On Wed, Jul 14, 2010 at 4:40 PM, Franz Allan Valencia See \<  
[franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:

> seems like im still stuck with this whole not\_analyzed thing 🙂
> 
> I did the following commands:
> 
> > $ curl -XPUT '[http://localhost:9200/dummy/dummy/1](http://localhost:9200/dummy/dummy/1)' -d '  
> > {  
> > "statusCode" : "A"  
> > }  
> > '  
> > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"1"}
> > 
> > $ curl -XPUT '[http://localhost:9200/dummy/dummy/2](http://localhost:9200/dummy/dummy/2)' -d '  
> > {  
> > "statusCode" : "P"  
> > }  
> > '  
> > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"2"}
> > 
> > $ curl -XPUT '[http://localhost:9200/dummy/dummy/\_mapping](http://localhost:9200/dummy/dummy/_mapping)' -d '  
> > {  
> > "_default_" : {  
> > "properties" : {  
> > "statusCode" : {"type" : "string", "store" : "yes", "index" :  
> > "not\_analyzed" }  
> > }  
> > }  
> > }  
> > '  
> > {"ok":true,"acknowledged":false}
> 
> I'm not sure what "ok":"true" but "acknowledged":false is, but searching  
> for [http://localhost:9200/dummy/dummy/\_search?q=statusCode:A](http://localhost:9200/dummy/dummy/_search?q=statusCode:A) still yields  
> no results.
> 
> What am i doing wrong?
> 
> Thanks,
> 
> --  
> Franz Allan Valencia See | Java Software Engineer  
> [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> 
> On Wed, Jun 30, 2010 at 6:16 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> > Usually, this type of fields (status code) should be configured to be  
> > "not\_analyzed" in the index section. Note, in this case, you will get hits  
> > only on `A`, not on `a`.
> > 
> > -shay.banon
> > 
> > On Wed, Jun 30, 2010 at 10:52 AM, Franz Allan Valencia See \<  
> > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > 
> > > ohh.....right right. Ok, I'll look into that. Thanks 🙂
> > > 
> > > On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com)wrote:
> > > 
> > > > Hi,
> > > > 
> > > > isn't 'a' a stop word? Depending on your analysis used during indexing  
> > > > single 'a' may be removed.
> > > > 
> > > > Regards,  
> > > > Lukas
> > > > 
> > > > On Wed, Jun 30, 2010 at 5:21 AM, Franz Allan Valencia See \<  
> > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > 
> > > > > Good day,
> > > > > 
> > > > > I have a field that accepts a single character - either 'A' or 'P'.
> > > > > 
> > > > > I can index them no properly (i think) with:
> > > > > 
> > > > > > curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1,  
> > > > > > "statusCode" : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P",  
> > > > > > "nocamelcase" : "A", "aValue" : "A", "bValue" : "B", "pValue" : "P",  
> > > > > > "zValue" : "Z" }'  
> > > > > > curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2,  
> > > > > > "statusCode" : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A",  
> > > > > > "nocamelcase" : "P", "aValue" : "a", "bValue" : "b", "pValue" : "p",  
> > > > > > "zValue" : "z" }'
> > > > > 
> > > > > Accessing these two documents with [http://localhost:9200/test/dummy/1and](http://localhost:9200/test/dummy/1and)  
> > > > > [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put in.  
> > > > > That part is fine.
> > > > > 
> > > > > Also, for the most part, searching is ok because I can retrieve the  
> > > > > values that I want (i.e. searching with  
> > > > > [http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me a hit  
> > > > > which is 'test dummy 2').
> > > > > 
> > > > > However, when I do search for documents wherein the value is 'A' (or  
> > > > > 'a') like [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A), I  
> > > > > am not getting any hits. I've also tried searching against the fields  
> > > > > 'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they  
> > > > > all can't make a match (for both "A" and "a"). Also, other letters like B,  
> > > > > b, P, p, Z, z seems to be ok.
> > > > > 
> > > > > Are the letters "A" & "a" reserved words?
> > > > > 
> > > > > Some info on my setup:
> > > > > 
> > > > > franz@see:~$ uname -a  
> > > > > Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010  
> > > > > x86\_64 GNU/Linux  
> > > > > franz@see:~$ echo $JAVA\_HOME  
> > > > > /opt/java/64/jdk1.6.0\_17  
> > > > > franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version  
> > > > > java version "1.6.0\_17"  
> > > > > Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)  
> > > > > Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)  
> > > > > franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml  
> > > > > #gateway:
> > > > > 
> > > > > # type: hdfs
> > > > > 
> > > > > # hdfs:
> > > > > 
> > > > > # uri: hdfs://localhost:8020
> > > > > 
> > > > > # path: /opt/vc/aptab/es-gateway
> > > > > 
> > > > > (Note: at first I was working on HDFS. But when I encountered this  
> > > > > problem, i tried reverting to the default setting which is an empty  
> > > > > elasticsearch.yml and still does not work).
> > > > > 
> > > > > Thanks,
> > > > > 
> > > > > --  
> > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > 
> > > --  
> > > Franz Allan Valencia See | Java Software Engineer  
> > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

---

<div class="post-metadata">

**Author:** ![Franz\_Allan\_Valencia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franz_allan_valencia/32/3326_2.png) [@Franz\_Allan\_Valencia](https://discuss.elastic.co/u/Franz_Allan_Valencia)\
**Post date:** [July 14, 2010, 1:59pm UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/7 "2010-07-14T13:59:32Z")

</div>

I just did the following:

curl -XPUT '

> [http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1](http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1)' -d '  
> {  
> "dummy" : "dummy"  
> }  
> '
> 
> curl -XPUT '[http://localhost:9200/dummyindex/dummyType/\_mapping](http://localhost:9200/dummyindex/dummyType/_mapping)' -d '  
> {  
> "dummyType" : {  
> "properties" : {  
> "statusCode" : {"type" : "string", "store" : "yes", "index" :  
> "not\_analyzed" }  
> }  
> }  
> }  
> '
> 
> curl -XPUT '[http://localhost:9200/dummyindex/dummyType/1](http://localhost:9200/dummyindex/dummyType/1)' -d '  
> {  
> "statusCode" : "A"  
> }  
> '
> 
> curl -XPUT '[http://localhost:9200/dummyindex/dummyType/2](http://localhost:9200/dummyindex/dummyType/2)' -d '  
> {  
> "statusCode" : "P"  
> }  
> '
> 
> curl -XGET  
> [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:A](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:A)

curl -XGET [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:P](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:P)

> 

Now, I get nothing for both statusCode A and P.

Any ideas?

Thanks,

--  
Franz Allan Valencia See | Java Software Engineer  
[franz.see@gmail.com](mailto:franz.see@gmail.com)  
LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

On Wed, Jul 14, 2010 at 9:45 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> You need to set the mapping before you index data, and don't set _default_,  
> using the actual type you want to change.
> 
> -shay.banon
> 
> On Wed, Jul 14, 2010 at 4:40 PM, Franz Allan Valencia See \<  
> [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> 
> > seems like im still stuck with this whole not\_analyzed thing 🙂
> > 
> > I did the following commands:
> > 
> > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/1](http://localhost:9200/dummy/dummy/1)' -d '  
> > > {  
> > > "statusCode" : "A"  
> > > }  
> > > '  
> > > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"1"}
> > > 
> > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/2](http://localhost:9200/dummy/dummy/2)' -d '  
> > > {  
> > > "statusCode" : "P"  
> > > }  
> > > '  
> > > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"2"}
> > > 
> > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/\_mapping](http://localhost:9200/dummy/dummy/_mapping)' -d '  
> > > {  
> > > "_default_" : {  
> > > "properties" : {  
> > > "statusCode" : {"type" : "string", "store" : "yes", "index" :  
> > > "not\_analyzed" }  
> > > }  
> > > }  
> > > }  
> > > '  
> > > {"ok":true,"acknowledged":false}
> > 
> > I'm not sure what "ok":"true" but "acknowledged":false is, but searching  
> > for [http://localhost:9200/dummy/dummy/\_search?q=statusCode:A](http://localhost:9200/dummy/dummy/_search?q=statusCode:A) still yields  
> > no results.
> > 
> > What am i doing wrong?
> > 
> > Thanks,
> > 
> > --  
> > Franz Allan Valencia See | Java Software Engineer  
> > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > 
> > On Wed, Jun 30, 2010 at 6:16 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> > 
> > > wrote:
> > 
> > > Usually, this type of fields (status code) should be configured to be  
> > > "not\_analyzed" in the index section. Note, in this case, you will get hits  
> > > only on `A`, not on `a`.
> > > 
> > > -shay.banon
> > > 
> > > On Wed, Jun 30, 2010 at 10:52 AM, Franz Allan Valencia See \<  
> > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > 
> > > > ohh.....right right. Ok, I'll look into that. Thanks 🙂
> > > > 
> > > > On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com)wrote:
> > > > 
> > > > > Hi,
> > > > > 
> > > > > isn't 'a' a stop word? Depending on your analysis used during indexing  
> > > > > single 'a' may be removed.
> > > > > 
> > > > > Regards,  
> > > > > Lukas
> > > > > 
> > > > > On Wed, Jun 30, 2010 at 5:21 AM, Franz Allan Valencia See \<  
> > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > > 
> > > > > > Good day,
> > > > > > 
> > > > > > I have a field that accepts a single character - either 'A' or 'P'.
> > > > > > 
> > > > > > I can index them no properly (i think) with:
> > > > > > 
> > > > > > > curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1,  
> > > > > > > "statusCode" : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P",  
> > > > > > > "nocamelcase" : "A", "aValue" : "A", "bValue" : "B", "pValue" : "P",  
> > > > > > > "zValue" : "Z" }'  
> > > > > > > curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2,  
> > > > > > > "statusCode" : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A",  
> > > > > > > "nocamelcase" : "P", "aValue" : "a", "bValue" : "b", "pValue" : "p",  
> > > > > > > "zValue" : "z" }'
> > > > > > 
> > > > > > Accessing these two documents with [http://localhost:9200/test/dummy/1and](http://localhost:9200/test/dummy/1and)  
> > > > > > [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put in.  
> > > > > > That part is fine.
> > > > > > 
> > > > > > Also, for the most part, searching is ok because I can retrieve the  
> > > > > > values that I want (i.e. searching with  
> > > > > > [http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me a  
> > > > > > hit which is 'test dummy 2').
> > > > > > 
> > > > > > However, when I do search for documents wherein the value is 'A' (or  
> > > > > > 'a') like [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A), I  
> > > > > > am not getting any hits. I've also tried searching against the fields  
> > > > > > 'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they  
> > > > > > all can't make a match (for both "A" and "a"). Also, other letters like B,  
> > > > > > b, P, p, Z, z seems to be ok.
> > > > > > 
> > > > > > Are the letters "A" & "a" reserved words?
> > > > > > 
> > > > > > Some info on my setup:
> > > > > > 
> > > > > > franz@see:~$ uname -a  
> > > > > > Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010  
> > > > > > x86\_64 GNU/Linux  
> > > > > > franz@see:~$ echo $JAVA\_HOME  
> > > > > > /opt/java/64/jdk1.6.0\_17  
> > > > > > franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version  
> > > > > > java version "1.6.0\_17"  
> > > > > > Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)  
> > > > > > Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)  
> > > > > > franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml  
> > > > > > #gateway:
> > > > > > 
> > > > > > # type: hdfs
> > > > > > 
> > > > > > # hdfs:
> > > > > > 
> > > > > > # uri: hdfs://localhost:8020
> > > > > > 
> > > > > > # path: /opt/vc/aptab/es-gateway
> > > > > > 
> > > > > > (Note: at first I was working on HDFS. But when I encountered this  
> > > > > > problem, i tried reverting to the default setting which is an empty  
> > > > > > elasticsearch.yml and still does not work).
> > > > > > 
> > > > > > Thanks,
> > > > > > 
> > > > > > --  
> > > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > > 
> > > > --  
> > > > Franz Allan Valencia See | Java Software Engineer  
> > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 14, 2010, 2:06pm UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/8 "2010-07-14T14:06:58Z")

</div>

> ```
> curl -XGET http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:A
>     
> curl -XGET http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:P
> 
> ```

Your search terms are being analysed, so they're actually resulting in  
'a' and 'p' (or just 'p' because 'a' will be a stopword)

Try this instead

curl -XGET [http://localhost:9200/dummyindex/dummyType/\_search?pretty=1](http://localhost:9200/dummyindex/dummyType/_search?pretty=1) -d '  
{  
query: {term: { statusCode: "P"}}  
}  
'

{  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 1,  
"max\_score" : "NaN",  
"hits" : [ {  
"\_index" : "dummyindex",  
"\_type" : "dummyType",  
"\_id" : "2",  
"\_score" : 1.0, "\_source" :  
{  
"statusCode" : "P"  
}

```
} ]

```

## } }

Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 14, 2010, 2:07pm UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/9 "2010-07-14T14:07:31Z")

</div>

Which version are you using?

On Wed, Jul 14, 2010 at 4:59 PM, Franz Allan Valencia See \<  
[franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:

> I just did the following:
> 
> curl -XPUT '
> 
> > [http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1](http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1)' -d '  
> > {  
> > "dummy" : "dummy"  
> > }  
> > '
> > 
> > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/\_mapping](http://localhost:9200/dummyindex/dummyType/_mapping)' -d '  
> > {  
> > "dummyType" : {
> > 
> > ```
> > "properties" : {
> > "statusCode" : {"type" : "string", "store" : "yes", "index" :
> > 
> > ```
> > 
> > "not\_analyzed" }  
> > }  
> > }  
> > }  
> > '
> > 
> > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/1](http://localhost:9200/dummyindex/dummyType/1)' -d '  
> > {  
> > "statusCode" : "A"  
> > }  
> > '
> > 
> > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/2](http://localhost:9200/dummyindex/dummyType/2)' -d '  
> > {  
> > "statusCode" : "P"  
> > }  
> > '
> > 
> > curl -XGET  
> > [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:A](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:A)
> 
> curl -XGET
> 
> > [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:P](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:P)
> 
> Now, I get nothing for both statusCode A and P.
> 
> Any ideas?
> 
> Thanks,
> 
> --  
> Franz Allan Valencia See | Java Software Engineer  
> [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> 
> On Wed, Jul 14, 2010 at 9:45 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> > You need to set the mapping before you index data, and don't set  
> > _default_, using the actual type you want to change.
> > 
> > -shay.banon
> > 
> > On Wed, Jul 14, 2010 at 4:40 PM, Franz Allan Valencia See \<  
> > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > 
> > > seems like im still stuck with this whole not\_analyzed thing 🙂
> > > 
> > > I did the following commands:
> > > 
> > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/1](http://localhost:9200/dummy/dummy/1)' -d '  
> > > > {  
> > > > "statusCode" : "A"  
> > > > }  
> > > > '  
> > > > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"1"}
> > > > 
> > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/2](http://localhost:9200/dummy/dummy/2)' -d '  
> > > > {  
> > > > "statusCode" : "P"  
> > > > }  
> > > > '  
> > > > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"2"}
> > > > 
> > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/\_mapping](http://localhost:9200/dummy/dummy/_mapping)' -d '  
> > > > {  
> > > > "_default_" : {  
> > > > "properties" : {  
> > > > "statusCode" : {"type" : "string", "store" : "yes", "index"  
> > > > : "not\_analyzed" }  
> > > > }  
> > > > }  
> > > > }  
> > > > '  
> > > > {"ok":true,"acknowledged":false}
> > > 
> > > I'm not sure what "ok":"true" but "acknowledged":false is, but searching  
> > > for [http://localhost:9200/dummy/dummy/\_search?q=statusCode:A](http://localhost:9200/dummy/dummy/_search?q=statusCode:A) still  
> > > yields no results.
> > > 
> > > What am i doing wrong?
> > > 
> > > Thanks,
> > > 
> > > --  
> > > Franz Allan Valencia See | Java Software Engineer  
> > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > 
> > > On Wed, Jun 30, 2010 at 6:16 PM, Shay Banon \<  
> > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > 
> > > > Usually, this type of fields (status code) should be configured to be  
> > > > "not\_analyzed" in the index section. Note, in this case, you will get hits  
> > > > only on `A`, not on `a`.
> > > > 
> > > > -shay.banon
> > > > 
> > > > On Wed, Jun 30, 2010 at 10:52 AM, Franz Allan Valencia See \<  
> > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > 
> > > > > ohh.....right right. Ok, I'll look into that. Thanks 🙂
> > > > > 
> > > > > On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com)wrote:
> > > > > 
> > > > > > Hi,
> > > > > > 
> > > > > > isn't 'a' a stop word? Depending on your analysis used during indexing  
> > > > > > single 'a' may be removed.
> > > > > > 
> > > > > > Regards,  
> > > > > > Lukas
> > > > > > 
> > > > > > On Wed, Jun 30, 2010 at 5:21 AM, Franz Allan Valencia See \<  
> > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > > > 
> > > > > > > Good day,
> > > > > > > 
> > > > > > > I have a field that accepts a single character - either 'A' or 'P'.
> > > > > > > 
> > > > > > > I can index them no properly (i think) with:
> > > > > > > 
> > > > > > > > curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1,  
> > > > > > > > "statusCode" : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P",  
> > > > > > > > "nocamelcase" : "A", "aValue" : "A", "bValue" : "B", "pValue" : "P",  
> > > > > > > > "zValue" : "Z" }'  
> > > > > > > > curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2,  
> > > > > > > > "statusCode" : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A",  
> > > > > > > > "nocamelcase" : "P", "aValue" : "a", "bValue" : "b", "pValue" : "p",  
> > > > > > > > "zValue" : "z" }'
> > > > > > > 
> > > > > > > Accessing these two documents with  
> > > > > > > [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) and  
> > > > > > > [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put  
> > > > > > > in. That part is fine.
> > > > > > > 
> > > > > > > Also, for the most part, searching is ok because I can retrieve the  
> > > > > > > values that I want (i.e. searching with  
> > > > > > > [http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me a  
> > > > > > > hit which is 'test dummy 2').
> > > > > > > 
> > > > > > > However, when I do search for documents wherein the value is 'A' (or  
> > > > > > > 'a') like [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A), I  
> > > > > > > am not getting any hits. I've also tried searching against the fields  
> > > > > > > 'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they  
> > > > > > > all can't make a match (for both "A" and "a"). Also, other letters like B,  
> > > > > > > b, P, p, Z, z seems to be ok.
> > > > > > > 
> > > > > > > Are the letters "A" & "a" reserved words?
> > > > > > > 
> > > > > > > Some info on my setup:
> > > > > > > 
> > > > > > > franz@see:~$ uname -a  
> > > > > > > Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC  
> > > > > > > 2010 x86\_64 GNU/Linux  
> > > > > > > franz@see:~$ echo $JAVA\_HOME  
> > > > > > > /opt/java/64/jdk1.6.0\_17  
> > > > > > > franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version  
> > > > > > > java version "1.6.0\_17"  
> > > > > > > Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)  
> > > > > > > Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)  
> > > > > > > franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml  
> > > > > > > #gateway:
> > > > > > > 
> > > > > > > # type: hdfs
> > > > > > > 
> > > > > > > # hdfs:
> > > > > > > 
> > > > > > > # uri: hdfs://localhost:8020
> > > > > > > 
> > > > > > > # path: /opt/vc/aptab/es-gateway
> > > > > > > 
> > > > > > > (Note: at first I was working on HDFS. But when I encountered this  
> > > > > > > problem, i tried reverting to the default setting which is an empty  
> > > > > > > elasticsearch.yml and still does not work).
> > > > > > > 
> > > > > > > Thanks,
> > > > > > > 
> > > > > > > --  
> > > > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > > > 
> > > > > --  
> > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 14, 2010, 2:09pm UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/10 "2010-07-14T14:09:21Z")

</div>

In 0.9, if a field is "not\_analyzed", then the search analyzer that will be  
used for the field is the "keyword" analyzer (won't do anything to the text  
provided), so the above sample provided should work (i.e. searching in a  
query\_string for statusCode:A).

-shay.banon

On Wed, Jul 14, 2010 at 5:07 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Which version are you using?
> 
> On Wed, Jul 14, 2010 at 4:59 PM, Franz Allan Valencia See \<  
> [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> 
> > I just did the following:
> > 
> > curl -XPUT '
> > 
> > > [http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1](http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1)' -d  
> > > '  
> > > {  
> > > "dummy" : "dummy"  
> > > }  
> > > '
> > > 
> > > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/\_mapping](http://localhost:9200/dummyindex/dummyType/_mapping)' -d '  
> > > {  
> > > "dummyType" : {
> > > 
> > > ```
> > > "properties" : {
> > > "statusCode" : {"type" : "string", "store" : "yes", "index" :
> > > 
> > > ```
> > > 
> > > "not\_analyzed" }  
> > > }  
> > > }  
> > > }  
> > > '
> > > 
> > > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/1](http://localhost:9200/dummyindex/dummyType/1)' -d '  
> > > {  
> > > "statusCode" : "A"  
> > > }  
> > > '
> > > 
> > > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/2](http://localhost:9200/dummyindex/dummyType/2)' -d '  
> > > {  
> > > "statusCode" : "P"  
> > > }  
> > > '
> > > 
> > > curl -XGET  
> > > [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:A](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:A)
> > 
> > curl -XGET
> > 
> > > [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:P](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:P)
> > 
> > Now, I get nothing for both statusCode A and P.
> > 
> > Any ideas?
> > 
> > Thanks,
> > 
> > --  
> > Franz Allan Valencia See | Java Software Engineer  
> > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > 
> > On Wed, Jul 14, 2010 at 9:45 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> > 
> > > wrote:
> > 
> > > You need to set the mapping before you index data, and don't set  
> > > _default_, using the actual type you want to change.
> > > 
> > > -shay.banon
> > > 
> > > On Wed, Jul 14, 2010 at 4:40 PM, Franz Allan Valencia See \<  
> > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > 
> > > > seems like im still stuck with this whole not\_analyzed thing 🙂
> > > > 
> > > > I did the following commands:
> > > > 
> > > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/1](http://localhost:9200/dummy/dummy/1)' -d '  
> > > > > {  
> > > > > "statusCode" : "A"  
> > > > > }  
> > > > > '  
> > > > > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"1"}
> > > > > 
> > > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/2](http://localhost:9200/dummy/dummy/2)' -d '  
> > > > > {  
> > > > > "statusCode" : "P"  
> > > > > }  
> > > > > '  
> > > > > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"2"}
> > > > > 
> > > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/\_mapping](http://localhost:9200/dummy/dummy/_mapping)' -d '  
> > > > > {  
> > > > > "_default_" : {  
> > > > > "properties" : {  
> > > > > "statusCode" : {"type" : "string", "store" : "yes", "index"  
> > > > > : "not\_analyzed" }  
> > > > > }  
> > > > > }  
> > > > > }  
> > > > > '  
> > > > > {"ok":true,"acknowledged":false}
> > > > 
> > > > I'm not sure what "ok":"true" but "acknowledged":false is, but searching  
> > > > for [http://localhost:9200/dummy/dummy/\_search?q=statusCode:A](http://localhost:9200/dummy/dummy/_search?q=statusCode:A) still  
> > > > yields no results.
> > > > 
> > > > What am i doing wrong?
> > > > 
> > > > Thanks,
> > > > 
> > > > --  
> > > > Franz Allan Valencia See | Java Software Engineer  
> > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > > 
> > > > On Wed, Jun 30, 2010 at 6:16 PM, Shay Banon \<  
> > > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > > 
> > > > > Usually, this type of fields (status code) should be configured to be  
> > > > > "not\_analyzed" in the index section. Note, in this case, you will get hits  
> > > > > only on `A`, not on `a`.
> > > > > 
> > > > > -shay.banon
> > > > > 
> > > > > On Wed, Jun 30, 2010 at 10:52 AM, Franz Allan Valencia See \<  
> > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > > 
> > > > > > ohh.....right right. Ok, I'll look into that. Thanks 🙂
> > > > > > 
> > > > > > On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com)wrote:
> > > > > > 
> > > > > > > Hi,
> > > > > > > 
> > > > > > > isn't 'a' a stop word? Depending on your analysis used during  
> > > > > > > indexing single 'a' may be removed.
> > > > > > > 
> > > > > > > Regards,  
> > > > > > > Lukas
> > > > > > > 
> > > > > > > On Wed, Jun 30, 2010 at 5:21 AM, Franz Allan Valencia See \<  
> > > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > > > > 
> > > > > > > > Good day,
> > > > > > > > 
> > > > > > > > I have a field that accepts a single character - either 'A' or 'P'.
> > > > > > > > 
> > > > > > > > I can index them no properly (i think) with:
> > > > > > > > 
> > > > > > > > > curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1,  
> > > > > > > > > "statusCode" : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P",  
> > > > > > > > > "nocamelcase" : "A", "aValue" : "A", "bValue" : "B", "pValue" : "P",  
> > > > > > > > > "zValue" : "Z" }'  
> > > > > > > > > curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2,  
> > > > > > > > > "statusCode" : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A",  
> > > > > > > > > "nocamelcase" : "P", "aValue" : "a", "bValue" : "b", "pValue" : "p",  
> > > > > > > > > "zValue" : "z" }'
> > > > > > > > 
> > > > > > > > Accessing these two documents with  
> > > > > > > > [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) and  
> > > > > > > > [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put  
> > > > > > > > in. That part is fine.
> > > > > > > > 
> > > > > > > > Also, for the most part, searching is ok because I can retrieve the  
> > > > > > > > values that I want (i.e. searching with  
> > > > > > > > [http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me a  
> > > > > > > > hit which is 'test dummy 2').
> > > > > > > > 
> > > > > > > > However, when I do search for documents wherein the value is 'A' (or  
> > > > > > > > 'a') like [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A),  
> > > > > > > > I am not getting any hits. I've also tried searching against the fields  
> > > > > > > > 'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they  
> > > > > > > > all can't make a match (for both "A" and "a"). Also, other letters like B,  
> > > > > > > > b, P, p, Z, z seems to be ok.
> > > > > > > > 
> > > > > > > > Are the letters "A" & "a" reserved words?
> > > > > > > > 
> > > > > > > > Some info on my setup:
> > > > > > > > 
> > > > > > > > franz@see:~$ uname -a  
> > > > > > > > Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC  
> > > > > > > > 2010 x86\_64 GNU/Linux  
> > > > > > > > franz@see:~$ echo $JAVA\_HOME  
> > > > > > > > /opt/java/64/jdk1.6.0\_17  
> > > > > > > > franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version  
> > > > > > > > java version "1.6.0\_17"  
> > > > > > > > Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)  
> > > > > > > > Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)  
> > > > > > > > franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml  
> > > > > > > > #gateway:
> > > > > > > > 
> > > > > > > > # type: hdfs
> > > > > > > > 
> > > > > > > > # hdfs:
> > > > > > > > 
> > > > > > > > # uri: hdfs://localhost:8020
> > > > > > > > 
> > > > > > > > # path: /opt/vc/aptab/es-gateway
> > > > > > > > 
> > > > > > > > (Note: at first I was working on HDFS. But when I encountered this  
> > > > > > > > problem, i tried reverting to the default setting which is an empty  
> > > > > > > > elasticsearch.yml and still does not work).
> > > > > > > > 
> > > > > > > > Thanks,
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > > > > 
> > > > > > --  
> > > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 14, 2010, 2:12pm UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/11 "2010-07-14T14:12:40Z")

</div>

On Wed, 2010-07-14 at 17:09 +0300, Shay Banon wrote:

> In 0.9, if a field is "not\_analyzed", then the search analyzer that  
> will be used for the field is the "keyword" analyzer (won't do  
> anything to the text provided), so the above sample provided should  
> work (i.e. searching in a query\_string for statusCode:A).

It doesn't work in 0.9-SNAPSHOT

clint

> -shay.banon
> 
> On Wed, Jul 14, 2010 at 5:07 PM, Shay Banon  
> [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:  
> Which version are you using?
> 
> ```
> On Wed, Jul 14, 2010 at 4:59 PM, Franz Allan Valencia See
> <franz.see@gmail.com> wrote:
> I just did the following:
>             
> curl -XPUT
> 'http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1' -d '
> {
> "dummy" : "dummy"
> }
> '
>                     
> curl -XPUT
> 'http://localhost:9200/dummyindex/dummyType/_mapping' -d '
> {
> "dummyType" : {
>                     
> "properties" : {
> "statusCode" : {"type" : "string",
> "store" : "yes", "index" : "not_analyzed" }
> }
> }
> }
> '
>                     
>                     
> curl -XPUT
> 'http://localhost:9200/dummyindex/dummyType/1'
> -d '
> {
> "statusCode" : "A"
> }
> '
>                     
> curl -XPUT
> 'http://localhost:9200/dummyindex/dummyType/2'
> -d '
> {
> "statusCode" : "P"
> }
> '
>                     
> curl -XGET
> http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:A
>                     
> curl -XGET
> http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:P
>             
> Now, I get nothing for both statusCode A and P.
>             
> Any ideas?
>             
>             
> Thanks,
>             
> -- 
> Franz Allan Valencia See | Java Software Engineer 
> franz.see@gmail.com
> LinkedIn: http://www.linkedin.com/in/franzsee
> Twitter: http://www.twitter.com/franz_see
>             
>             
>             
>             
> On Wed, Jul 14, 2010 at 9:45 PM, Shay Banon
> <shay.banon@elasticsearch.com> wrote:
> You need to set the mapping before you index
> data, and don't set _default_, using the
> actual type you want to change.
>                     
>                     
> -shay.banon
>                     
>                     
>                     
> On Wed, Jul 14, 2010 at 4:40 PM, Franz Allan
> Valencia See <franz.see@gmail.com> wrote:
> seems like im still stuck with this
> whole not_analyzed thing :-)
>                             
> I did the following commands:
> $ curl -XPUT
> 'http://localhost:9200/dummy/dummy/1' -d '
> {
> "statusCode" : "A"
> }
> '
> {"ok":true,"_index":"dummy","_type":"dummy","_id":"1"}
>                                     
> $ curl -XPUT
> 'http://localhost:9200/dummy/dummy/2' -d '
> {
> "statusCode" : "P"
> }
> '
> {"ok":true,"_index":"dummy","_type":"dummy","_id":"2"}
>                                     
>                                     
> $ curl -XPUT
> 'http://localhost:9200/dummy/dummy/_mapping' -d '
> {
> "_default_" : {
> "properties" : {
> "statusCode" :
> {"type" : "string", "store" :
> "yes", "index" :
> "not_analyzed" }
> }
> }
> }
> '
> {"ok":true,"acknowledged":false}
>                             
> I'm not sure what "ok":"true" but
> "acknowledged":false is, but searching
> for
> http://localhost:9200/dummy/dummy/_search?q=statusCode:A still yields no results.
>                             
> What am i doing wrong?
>                             
>                             
> Thanks,
>                             
> -- 
> Franz Allan Valencia See | Java
> Software Engineer 
> franz.see@gmail.com
> LinkedIn:
> http://www.linkedin.com/in/franzsee
> Twitter:
> http://www.twitter.com/franz_see
>                             
>                             
>                             
>                             
> On Wed, Jun 30, 2010 at 6:16 PM, Shay
> Banon <shay.banon@elasticsearch.com>
> wrote:
> Usually, this type of fields
> (status code) should be
> configured to be
> "not_analyzed" in the index
> section. Note, in this case,
> you will get hits only on `A`,
> not on `a`.
>                                     
>                                     
> -shay.banon
>                                     
>                                     
>                                     
> On Wed, Jun 30, 2010 at 10:52
> AM, Franz Allan Valencia See
> <franz.see@gmail.com> wrote:
> ohh.....right right.
> Ok, I'll look into
> that. Thanks :-)
>                                             
>                                             
>                                             
> On Wed, Jun 30, 2010
> at 2:44 PM, LukÃ¡Å¡
> VlÄek
> <lukas.vlcek@gmail.com> wrote:
> Hi,
>                                                     
>                                                     
> isn't 'a' a
> stop word?
> Depending on
> your analysis
> used during
> indexing
> single 'a' may
> be removed.
>                                                     
>                                                     
> Regards,
> Lukas
>                                                     
>                                                     
>                                                     
> On Wed, Jun
> 30, 2010 at
> 5:21 AM, Franz
> Allan Valencia
> See
> <franz.see@gmail.com> wrote:
> Good
> day,
>                                                             
> I have
> a
> field
> that
> accepts a single character - either 'A' or 'P'.
>                                                             
> I can
> index
> them
> no
> properly (i think) with:
> curl -XPUT http://localhost:9200/test/dummy/1 -d '{"id" : 1, "statusCode" : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P", "nocamelcase" : "A", "aValue" : "A", "bValue" : "B", "pValue" : "P", "zValue" : "Z" }'
> curl -XPUT http://localhost:9200/test/dummy/2 -d '{"id" : 2, "statusCode" : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A", "nocamelcase" : "P", "aValue" : "a", "bValue" : "b", "pValue" : "p", "zValue" : "z" }'
>                                                             
> Accessing these two documents with http://localhost:9200/test/dummy/1 and http://localhost:9200/test/dummy/2 shows me all fields that I put in. That part is fine. 
>                                                             
> Also,
> for
> the
> most
> part,
> searching is ok because I can retrieve the values that I want (i.e. searching with http://localhost:9200/test/dummy/_search?q=statusCode:P gives me a hit which is 'test dummy 2'). 
>                                                             
> However, when I do search for documents wherein the value is 'A' (or 'a') like http://localhost:9200/test/dummy/_search?q=statusCode:A, I am not getting any hits. I've also tried searching against the fields 'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they all can't make a match (for both "A" and "a"). Also, other letters like B, b, P, p, Z, z seems to be ok. 
>                                                             
> Are
> the
> letters "A" & "a" reserved words?
>                                                             
> Some
> info
> on my
> setup:
> franz@see:~$ uname -a 
> Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010 x86_64 GNU/Linux
> franz@see:~$ echo $JAVA_HOME
> /opt/java/64/jdk1.6.0_17
> franz@see:~$ /opt/java/64/jdk1.6.0_17/bin/java -version
> java version "1.6.0_17"
> Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
> Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)
> franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml 
> #gateway:
> # type: hdfs
> # hdfs:
> # uri: hdfs://localhost:8020
> # path: /opt/vc/aptab/es-gateway
>                                                             
> (Note:
> at
> first
> I was
> working on HDFS. But when I encountered this problem, i tried reverting to the default setting which is an empty elasticsearch.yml and still does not work).
>                                                             
> Thanks,
>                                                             
> -- 
> Franz
> Allan
> Valencia See | Java Software Engineer 
> franz.see@gmail.com
> LinkedIn: http://www.linkedin.com/in/franzsee
> Twitter: http://www.twitter.com/franz_see
>                                                     
>                                                     
>                                             
>                                             
>                                             
> -- 
> Franz Allan Valencia
> See | Java Software
> Engineer 
> franz.see@gmail.com
> LinkedIn:
> http://www.linkedin.com/in/franzsee
> Twitter:
> http://www.twitter.com/franz_see
> 
> ```

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![Franz\_Allan\_Valencia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franz_allan_valencia/32/3326_2.png) [@Franz\_Allan\_Valencia](https://discuss.elastic.co/u/Franz_Allan_Valencia)\
**Post date:** [July 14, 2010, 2:14pm UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/12 "2010-07-14T14:14:48Z")

</div>

Thanks! It now works ! 🙂

I'm on 0.8.0. Should I start using 0.9?

On Wed, Jul 14, 2010 at 10:09 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> In 0.9, if a field is "not\_analyzed", then the search analyzer that will be  
> used for the field is the "keyword" analyzer (won't do anything to the text  
> provided), so the above sample provided should work (i.e. searching in a  
> query\_string for statusCode:A).
> 
> -shay.banon
> 
> On Wed, Jul 14, 2010 at 5:07 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> > Which version are you using?
> > 
> > On Wed, Jul 14, 2010 at 4:59 PM, Franz Allan Valencia See \<  
> > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > 
> > > I just did the following:
> > > 
> > > curl -XPUT '
> > > 
> > > > [http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1](http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1)' -d  
> > > > '  
> > > > {  
> > > > "dummy" : "dummy"  
> > > > }  
> > > > '
> > > > 
> > > > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/\_mapping](http://localhost:9200/dummyindex/dummyType/_mapping)' -d '  
> > > > {  
> > > > "dummyType" : {
> > > > 
> > > > ```
> > > > "properties" : {
> > > > "statusCode" : {"type" : "string", "store" : "yes", "index"
> > > > 
> > > > ```
> > > > 
> > > > : "not\_analyzed" }  
> > > > }  
> > > > }  
> > > > }  
> > > > '
> > > > 
> > > > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/1](http://localhost:9200/dummyindex/dummyType/1)' -d '  
> > > > {  
> > > > "statusCode" : "A"  
> > > > }  
> > > > '
> > > > 
> > > > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/2](http://localhost:9200/dummyindex/dummyType/2)' -d '  
> > > > {  
> > > > "statusCode" : "P"  
> > > > }  
> > > > '
> > > > 
> > > > curl -XGET  
> > > > [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:A](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:A)
> > > 
> > > curl -XGET
> > > 
> > > > [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:P](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:P)
> > > 
> > > Now, I get nothing for both statusCode A and P.
> > > 
> > > Any ideas?
> > > 
> > > Thanks,
> > > 
> > > --  
> > > Franz Allan Valencia See | Java Software Engineer  
> > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > 
> > > On Wed, Jul 14, 2010 at 9:45 PM, Shay Banon \<  
> > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > 
> > > > You need to set the mapping before you index data, and don't set  
> > > > _default_, using the actual type you want to change.
> > > > 
> > > > -shay.banon
> > > > 
> > > > On Wed, Jul 14, 2010 at 4:40 PM, Franz Allan Valencia See \<  
> > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > 
> > > > > seems like im still stuck with this whole not\_analyzed thing 🙂
> > > > > 
> > > > > I did the following commands:
> > > > > 
> > > > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/1](http://localhost:9200/dummy/dummy/1)' -d '  
> > > > > > {  
> > > > > > "statusCode" : "A"  
> > > > > > }  
> > > > > > '  
> > > > > > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"1"}
> > > > > > 
> > > > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/2](http://localhost:9200/dummy/dummy/2)' -d '  
> > > > > > {  
> > > > > > "statusCode" : "P"  
> > > > > > }  
> > > > > > '  
> > > > > > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"2"}
> > > > > > 
> > > > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/\_mapping](http://localhost:9200/dummy/dummy/_mapping)' -d '  
> > > > > > {  
> > > > > > "_default_" : {  
> > > > > > "properties" : {  
> > > > > > "statusCode" : {"type" : "string", "store" : "yes",  
> > > > > > "index" : "not\_analyzed" }  
> > > > > > }  
> > > > > > }  
> > > > > > }  
> > > > > > '  
> > > > > > {"ok":true,"acknowledged":false}
> > > > > 
> > > > > I'm not sure what "ok":"true" but "acknowledged":false is, but  
> > > > > searching for [http://localhost:9200/dummy/dummy/\_search?q=statusCode:Astill](http://localhost:9200/dummy/dummy/_search?q=statusCode:Astill) yields no results.
> > > > > 
> > > > > What am i doing wrong?
> > > > > 
> > > > > Thanks,
> > > > > 
> > > > > --  
> > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > > > 
> > > > > On Wed, Jun 30, 2010 at 6:16 PM, Shay Banon \<  
> > > > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > > > 
> > > > > > Usually, this type of fields (status code) should be configured to be  
> > > > > > "not\_analyzed" in the index section. Note, in this case, you will get hits  
> > > > > > only on `A`, not on `a`.
> > > > > > 
> > > > > > -shay.banon
> > > > > > 
> > > > > > On Wed, Jun 30, 2010 at 10:52 AM, Franz Allan Valencia See \<  
> > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > > > 
> > > > > > > ohh.....right right. Ok, I'll look into that. Thanks 🙂
> > > > > > > 
> > > > > > > On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com)wrote:
> > > > > > > 
> > > > > > > > Hi,
> > > > > > > > 
> > > > > > > > isn't 'a' a stop word? Depending on your analysis used during  
> > > > > > > > indexing single 'a' may be removed.
> > > > > > > > 
> > > > > > > > Regards,  
> > > > > > > > Lukas
> > > > > > > > 
> > > > > > > > On Wed, Jun 30, 2010 at 5:21 AM, Franz Allan Valencia See \<  
> > > > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > > > > > 
> > > > > > > > > Good day,
> > > > > > > > > 
> > > > > > > > > I have a field that accepts a single character - either 'A' or 'P'.
> > > > > > > > > 
> > > > > > > > > I can index them no properly (i think) with:
> > > > > > > > > 
> > > > > > > > > > curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1,  
> > > > > > > > > > "statusCode" : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P",  
> > > > > > > > > > "nocamelcase" : "A", "aValue" : "A", "bValue" : "B", "pValue" : "P",  
> > > > > > > > > > "zValue" : "Z" }'  
> > > > > > > > > > curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2,  
> > > > > > > > > > "statusCode" : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A",  
> > > > > > > > > > "nocamelcase" : "P", "aValue" : "a", "bValue" : "b", "pValue" : "p",  
> > > > > > > > > > "zValue" : "z" }'
> > > > > > > > > 
> > > > > > > > > Accessing these two documents with  
> > > > > > > > > [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) and  
> > > > > > > > > [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put  
> > > > > > > > > in. That part is fine.
> > > > > > > > > 
> > > > > > > > > Also, for the most part, searching is ok because I can retrieve the  
> > > > > > > > > values that I want (i.e. searching with  
> > > > > > > > > [http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me a  
> > > > > > > > > hit which is 'test dummy 2').
> > > > > > > > > 
> > > > > > > > > However, when I do search for documents wherein the value is 'A'  
> > > > > > > > > (or 'a') like  
> > > > > > > > > [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A), I am not  
> > > > > > > > > getting any hits. I've also tried searching against the fields  
> > > > > > > > > 'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they  
> > > > > > > > > all can't make a match (for both "A" and "a"). Also, other letters like B,  
> > > > > > > > > b, P, p, Z, z seems to be ok.
> > > > > > > > > 
> > > > > > > > > Are the letters "A" & "a" reserved words?
> > > > > > > > > 
> > > > > > > > > Some info on my setup:
> > > > > > > > > 
> > > > > > > > > franz@see:~$ uname -a  
> > > > > > > > > Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC  
> > > > > > > > > 2010 x86\_64 GNU/Linux  
> > > > > > > > > franz@see:~$ echo $JAVA\_HOME  
> > > > > > > > > /opt/java/64/jdk1.6.0\_17  
> > > > > > > > > franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version  
> > > > > > > > > java version "1.6.0\_17"  
> > > > > > > > > Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)  
> > > > > > > > > Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)  
> > > > > > > > > franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml  
> > > > > > > > > #gateway:
> > > > > > > > > 
> > > > > > > > > # type: hdfs
> > > > > > > > > 
> > > > > > > > > # hdfs:
> > > > > > > > > 
> > > > > > > > > # uri: hdfs://localhost:8020
> > > > > > > > > 
> > > > > > > > > # path: /opt/vc/aptab/es-gateway
> > > > > > > > > 
> > > > > > > > > (Note: at first I was working on HDFS. But when I encountered this  
> > > > > > > > > problem, i tried reverting to the default setting which is an empty  
> > > > > > > > > elasticsearch.yml and still does not work).
> > > > > > > > > 
> > > > > > > > > Thanks,
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > > > > > 
> > > > > > > --  
> > > > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

--  
Franz Allan Valencia See | Java Software Engineer  
[franz.see@gmail.com](mailto:franz.see@gmail.com)  
LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 14, 2010, 2:17pm UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/13 "2010-07-14T14:17:48Z")

</div>

You will have to build it from master, but it should simplify things with  
the above mentioned enhancement. Note, several users define a custom  
analyzer that is a keyword one but still do lowercasing, which might fit  
what you are after, here is an example where the message uses it (the  
analyzer was named sortable, but can be any name):

curl -s -XPOST '[http://localhost:9200/twitter](http://localhost:9200/twitter)' -d '  
{  
"index" : {  
"analysis" : {  
"analyzer" : {  
"sortable" : {  
"tokenizer" : "keyword",  
"filter" : ["lowercase"]  
}  
}  
}  
}  
}  
'; echo  
curl -XPUT '[http://localhost:9200/twitter/\_mapping](http://localhost:9200/twitter/_mapping)' -d '  
{  
"tweet" : {  
"properties" : {  
"message" : {"type" : "string",  
"analyzer" : "sortable"},  
"type" : {"type" : "string",  
"index" : "not\_analyzed" }  
}  
}  
}

On Wed, Jul 14, 2010 at 5:14 PM, Franz Allan Valencia See \<  
[franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:

> Thanks! It now works ! 🙂
> 
> I'm on 0.8.0. Should I start using 0.9?
> 
> On Wed, Jul 14, 2010 at 10:09 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> 
> > wrote:
> 
> > In 0.9, if a field is "not\_analyzed", then the search analyzer that will  
> > be used for the field is the "keyword" analyzer (won't do anything to the  
> > text provided), so the above sample provided should work (i.e. searching in  
> > a query\_string for statusCode:A).
> > 
> > -shay.banon
> > 
> > On Wed, Jul 14, 2010 at 5:07 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> > 
> > > wrote:
> > 
> > > Which version are you using?
> > > 
> > > On Wed, Jul 14, 2010 at 4:59 PM, Franz Allan Valencia See \<  
> > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > 
> > > > I just did the following:
> > > > 
> > > > curl -XPUT '
> > > > 
> > > > > [http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1](http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1)'  
> > > > > -d '  
> > > > > {  
> > > > > "dummy" : "dummy"  
> > > > > }  
> > > > > '
> > > > > 
> > > > > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/\_mapping](http://localhost:9200/dummyindex/dummyType/_mapping)' -d '  
> > > > > {  
> > > > > "dummyType" : {
> > > > > 
> > > > > ```
> > > > > "properties" : {
> > > > > "statusCode" : {"type" : "string", "store" : "yes", "index"
> > > > > 
> > > > > ```
> > > > > 
> > > > > : "not\_analyzed" }  
> > > > > }  
> > > > > }  
> > > > > }  
> > > > > '
> > > > > 
> > > > > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/1](http://localhost:9200/dummyindex/dummyType/1)' -d '  
> > > > > {  
> > > > > "statusCode" : "A"  
> > > > > }  
> > > > > '
> > > > > 
> > > > > curl -XPUT '[http://localhost:9200/dummyindex/dummyType/2](http://localhost:9200/dummyindex/dummyType/2)' -d '  
> > > > > {  
> > > > > "statusCode" : "P"  
> > > > > }  
> > > > > '
> > > > > 
> > > > > curl -XGET  
> > > > > [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:A](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:A)
> > > > 
> > > > curl -XGET
> > > > 
> > > > > [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:P](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:P)
> > > > 
> > > > Now, I get nothing for both statusCode A and P.
> > > > 
> > > > Any ideas?
> > > > 
> > > > Thanks,
> > > > 
> > > > --  
> > > > Franz Allan Valencia See | Java Software Engineer  
> > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > > 
> > > > On Wed, Jul 14, 2010 at 9:45 PM, Shay Banon \<  
> > > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > > 
> > > > > You need to set the mapping before you index data, and don't set  
> > > > > _default_, using the actual type you want to change.
> > > > > 
> > > > > -shay.banon
> > > > > 
> > > > > On Wed, Jul 14, 2010 at 4:40 PM, Franz Allan Valencia See \<  
> > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > > 
> > > > > > seems like im still stuck with this whole not\_analyzed thing 🙂
> > > > > > 
> > > > > > I did the following commands:
> > > > > > 
> > > > > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/1](http://localhost:9200/dummy/dummy/1)' -d '  
> > > > > > > {  
> > > > > > > "statusCode" : "A"  
> > > > > > > }  
> > > > > > > '  
> > > > > > > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"1"}
> > > > > > > 
> > > > > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/2](http://localhost:9200/dummy/dummy/2)' -d '  
> > > > > > > {  
> > > > > > > "statusCode" : "P"  
> > > > > > > }  
> > > > > > > '  
> > > > > > > {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"2"}
> > > > > > > 
> > > > > > > $ curl -XPUT '[http://localhost:9200/dummy/dummy/\_mapping](http://localhost:9200/dummy/dummy/_mapping)' -d '  
> > > > > > > {  
> > > > > > > "_default_" : {  
> > > > > > > "properties" : {  
> > > > > > > "statusCode" : {"type" : "string", "store" : "yes",  
> > > > > > > "index" : "not\_analyzed" }  
> > > > > > > }  
> > > > > > > }  
> > > > > > > }  
> > > > > > > '  
> > > > > > > {"ok":true,"acknowledged":false}
> > > > > > 
> > > > > > I'm not sure what "ok":"true" but "acknowledged":false is, but  
> > > > > > searching for  
> > > > > > [http://localhost:9200/dummy/dummy/\_search?q=statusCode:A](http://localhost:9200/dummy/dummy/_search?q=statusCode:A) still yields  
> > > > > > no results.
> > > > > > 
> > > > > > What am i doing wrong?
> > > > > > 
> > > > > > Thanks,
> > > > > > 
> > > > > > --  
> > > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > > > > 
> > > > > > On Wed, Jun 30, 2010 at 6:16 PM, Shay Banon \<  
> > > > > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > > > > 
> > > > > > > Usually, this type of fields (status code) should be configured to be  
> > > > > > > "not\_analyzed" in the index section. Note, in this case, you will get hits  
> > > > > > > only on `A`, not on `a`.
> > > > > > > 
> > > > > > > -shay.banon
> > > > > > > 
> > > > > > > On Wed, Jun 30, 2010 at 10:52 AM, Franz Allan Valencia See \<  
> > > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > > > > 
> > > > > > > > ohh.....right right. Ok, I'll look into that. Thanks 🙂
> > > > > > > > 
> > > > > > > > On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček \<[lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com)
> > > > > > > > 
> > > > > > > > > wrote:
> > > > > > > > 
> > > > > > > > > Hi,
> > > > > > > > > 
> > > > > > > > > isn't 'a' a stop word? Depending on your analysis used during  
> > > > > > > > > indexing single 'a' may be removed.
> > > > > > > > > 
> > > > > > > > > Regards,  
> > > > > > > > > Lukas
> > > > > > > > > 
> > > > > > > > > On Wed, Jun 30, 2010 at 5:21 AM, Franz Allan Valencia See \<  
> > > > > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> > > > > > > > > 
> > > > > > > > > > Good day,
> > > > > > > > > > 
> > > > > > > > > > I have a field that accepts a single character - either 'A' or  
> > > > > > > > > > 'P'.
> > > > > > > > > > 
> > > > > > > > > > I can index them no properly (i think) with:
> > > > > > > > > > 
> > > > > > > > > > > curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1,  
> > > > > > > > > > > "statusCode" : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P",  
> > > > > > > > > > > "nocamelcase" : "A", "aValue" : "A", "bValue" : "B", "pValue" : "P",  
> > > > > > > > > > > "zValue" : "Z" }'  
> > > > > > > > > > > curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2,  
> > > > > > > > > > > "statusCode" : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A",  
> > > > > > > > > > > "nocamelcase" : "P", "aValue" : "a", "bValue" : "b", "pValue" : "p",  
> > > > > > > > > > > "zValue" : "z" }'
> > > > > > > > > > 
> > > > > > > > > > Accessing these two documents with  
> > > > > > > > > > [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) and  
> > > > > > > > > > [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put  
> > > > > > > > > > in. That part is fine.
> > > > > > > > > > 
> > > > > > > > > > Also, for the most part, searching is ok because I can retrieve  
> > > > > > > > > > the values that I want (i.e. searching with  
> > > > > > > > > > [http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me  
> > > > > > > > > > a hit which is 'test dummy 2').
> > > > > > > > > > 
> > > > > > > > > > However, when I do search for documents wherein the value is 'A'  
> > > > > > > > > > (or 'a') like  
> > > > > > > > > > [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A), I am not  
> > > > > > > > > > getting any hits. I've also tried searching against the fields  
> > > > > > > > > > 'anotherCamelCase', 'inverseStatusCode', 'nocamelcase', 'aValue' and they  
> > > > > > > > > > all can't make a match (for both "A" and "a"). Also, other letters like B,  
> > > > > > > > > > b, P, p, Z, z seems to be ok.
> > > > > > > > > > 
> > > > > > > > > > Are the letters "A" & "a" reserved words?
> > > > > > > > > > 
> > > > > > > > > > Some info on my setup:
> > > > > > > > > > 
> > > > > > > > > > franz@see:~$ uname -a  
> > > > > > > > > > Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC  
> > > > > > > > > > 2010 x86\_64 GNU/Linux  
> > > > > > > > > > franz@see:~$ echo $JAVA\_HOME  
> > > > > > > > > > /opt/java/64/jdk1.6.0\_17  
> > > > > > > > > > franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version  
> > > > > > > > > > java version "1.6.0\_17"  
> > > > > > > > > > Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)  
> > > > > > > > > > Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)  
> > > > > > > > > > franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml
> > > > > > > > > > 
> > > > > > > > > > #gateway:
> > > > > > > > > > 
> > > > > > > > > > # type: hdfs
> > > > > > > > > > 
> > > > > > > > > > # hdfs:
> > > > > > > > > > 
> > > > > > > > > > # uri: hdfs://localhost:8020
> > > > > > > > > > 
> > > > > > > > > > # path: /opt/vc/aptab/es-gateway
> > > > > > > > > > 
> > > > > > > > > > (Note: at first I was working on HDFS. But when I encountered this  
> > > > > > > > > > problem, i tried reverting to the default setting which is an empty  
> > > > > > > > > > elasticsearch.yml and still does not work).
> > > > > > > > > > 
> > > > > > > > > > Thanks,
> > > > > > > > > > 
> > > > > > > > > > --  
> > > > > > > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > > > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > > > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > Franz Allan Valencia See | Java Software Engineer  
> > > > > > > > [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> > > > > > > > LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> > > > > > > > Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> 
> --  
> Franz Allan Valencia See | Java Software Engineer  
> [franz.see@gmail.com](mailto:franz.see@gmail.com)  
> LinkedIn: [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)  
> Twitter: [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 14, 2010, 5:33pm UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/14 "2010-07-14T17:33:02Z")

</div>

You sure? Here is a sample that works for me:

curl -XPUT localhost:9200/test; echo

curl -XPOST localhost:9200/test/type1/\_mapping -d '{  
"type1" : {  
"properties" : {  
"test" : {  
"type" : "string",  
"index" : "not\_analyzed"  
}  
}  
}  
}'; echo

curl -XPUT localhost:9200/test/type1/1 -d '{  
"test" : "P"  
}'; echo

curl -XPOST localhost:9200/\_refresh; echo

curl -XGET localhost:9200/\_search?q=test:P

On Wed, Jul 14, 2010 at 5:12 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> On Wed, 2010-07-14 at 17:09 +0300, Shay Banon wrote:
> 
> > In 0.9, if a field is "not\_analyzed", then the search analyzer that  
> > will be used for the field is the "keyword" analyzer (won't do  
> > anything to the text provided), so the above sample provided should  
> > work (i.e. searching in a query\_string for statusCode:A).
> 
> It doesn't work in 0.9-SNAPSHOT
> 
> clint
> 
> > -shay.banon
> > 
> > On Wed, Jul 14, 2010 at 5:07 PM, Shay Banon  
> > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:  
> > Which version are you using?
> > 
> > ```
> > On Wed, Jul 14, 2010 at 4:59 PM, Franz Allan Valencia See
> > <franz.see@gmail.com> wrote:
> > I just did the following:
> > 
> > curl -XPUT
> > '
> > 
> > ```
> 
> [http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1](http://localhost:9200/dummyindex/anotherDummyJustToCreateTheIndex/1)' -d '
> 
> > ```
> > {
> > "dummy" : "dummy"
> > }
> > '
> > 
> > curl -XPUT
> > '
> > 
> > ```
> 
> [http://localhost:9200/dummyindex/dummyType/\_mapping](http://localhost:9200/dummyindex/dummyType/_mapping)' -d '
> 
> > ```
> > {
> > "dummyType" : {
> > 
> > "properties" : {
> > "statusCode" : {"type" : "string",
> > "store" : "yes", "index" : "not_analyzed" }
> > }
> > }
> > }
> > '
> > 
> > curl -XPUT
> > 'http://localhost:9200/dummyindex/dummyType/1'
> > -d '
> > {
> > "statusCode" : "A"
> > }
> > '
> > 
> > curl -XPUT
> > 'http://localhost:9200/dummyindex/dummyType/2'
> > -d '
> > {
> > "statusCode" : "P"
> > }
> > '
> > 
> > curl -XGET
> > 
> > ```
> 
> [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:A](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:A)
> 
> > ```
> > curl -XGET
> > 
> > ```
> 
> [http://localhost:9200/dummyindex/dummyType/\_search?q=statusCode:P](http://localhost:9200/dummyindex/dummyType/_search?q=statusCode:P)
> 
> > ```
> > Now, I get nothing for both statusCode A and P.
> > 
> > Any ideas?
> > 
> > Thanks,
> > 
> > --
> > Franz Allan Valencia See | Java Software Engineer
> > franz.see@gmail.com
> > LinkedIn: http://www.linkedin.com/in/franzsee
> > Twitter: http://www.twitter.com/franz_see
> > 
> > On Wed, Jul 14, 2010 at 9:45 PM, Shay Banon
> > <shay.banon@elasticsearch.com> wrote:
> > You need to set the mapping before you index
> > data, and don't set _default_, using the
> > actual type you want to change.
> > 
> > -shay.banon
> > 
> > On Wed, Jul 14, 2010 at 4:40 PM, Franz Allan
> > Valencia See <franz.see@gmail.com> wrote:
> > seems like im still stuck with this
> > whole not_analyzed thing :-)
> > 
> > I did the following commands:
> > $ curl -XPUT
> > '
> > 
> > ```
> 
> [http://localhost:9200/dummy/dummy/1](http://localhost:9200/dummy/dummy/1)' -d '
> 
> > ```
> > {
> > "statusCode" : "A"
> > }
> > '
> > 
> > ```
> 
> {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"1"}
> 
> > ```
> > $ curl -XPUT
> > '
> > 
> > ```
> 
> [http://localhost:9200/dummy/dummy/2](http://localhost:9200/dummy/dummy/2)' -d '
> 
> > ```
> > {
> > "statusCode" : "P"
> > }
> > '
> > 
> > ```
> 
> {"ok":true,"\_index":"dummy","\_type":"dummy","\_id":"2"}
> 
> > ```
> > $ curl -XPUT
> > '
> > 
> > ```
> 
> [http://localhost:9200/dummy/dummy/\_mapping](http://localhost:9200/dummy/dummy/_mapping)' -d '
> 
> > ```
> > {
> > "_default_" : {
> > "properties" : {
> > "statusCode" :
> > {"type" : "string", "store" :
> > "yes", "index" :
> > "not_analyzed" }
> > }
> > }
> > }
> > '
> > {"ok":true,"acknowledged":false}
> > 
> > I'm not sure what "ok":"true" but
> > "acknowledged":false is, but searching
> > for
> > 
> > ```
> 
> [http://localhost:9200/dummy/dummy/\_search?q=statusCode:A](http://localhost:9200/dummy/dummy/_search?q=statusCode:A) still yields no  
> results.
> 
> > ```
> > What am i doing wrong?
> > 
> > Thanks,
> > 
> > --
> > Franz Allan Valencia See | Java
> > Software Engineer
> > franz.see@gmail.com
> > LinkedIn:
> > http://www.linkedin.com/in/franzsee
> > Twitter:
> > http://www.twitter.com/franz_see
> > 
> > On Wed, Jun 30, 2010 at 6:16 PM, Shay
> > Banon <shay.banon@elasticsearch.com>
> > wrote:
> > Usually, this type of fields
> > (status code) should be
> > configured to be
> > "not_analyzed" in the index
> > section. Note, in this case,
> > you will get hits only on `A`,
> > not on `a`.
> > 
> > -shay.banon
> > 
> > On Wed, Jun 30, 2010 at 10:52
> > AM, Franz Allan Valencia See
> > <franz.see@gmail.com> wrote:
> > ohh.....right right.
> > Ok, I'll look into
> > that. Thanks :-)
> > 
> > On Wed, Jun 30, 2010
> > at 2:44 PM, Lukáš
> > Vlček
> > <lukas.vlcek@gmail.com>
> > 
> > ```
> 
> wrote:
> 
> > ```
> > Hi,
> > 
> > isn't 'a' a
> > stop word?
> > Depending on
> > your analysis
> > used during
> > indexing
> > single 'a' may
> > be removed.
> > 
> > Regards,
> > Lukas
> > 
> > On Wed, Jun
> > 30, 2010 at
> > 5:21 AM, Franz
> > Allan Valencia
> > See
> > <
> > 
> > ```
> 
> [franz.see@gmail.com](mailto:franz.see@gmail.com)\> wrote:
> 
> > ```
> > Good
> > day,
> > 
> > I have
> > a
> > field
> > that
> > accepts a
> > 
> > ```
> 
> single character - either 'A' or 'P'.
> 
> > ```
> > I can
> > index
> > them
> > no
> > properly
> > 
> > ```
> 
> (i think) with:
> 
> > 
> 
> curl -XPUT [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) -d '{"id" : 1, "statusCode"  
> : "A", "anotherCamelCase" : "A", "inverseStatusCode" : "P", "nocamelcase" :  
> "A", "aValue" : "A", "bValue" : "B", "pValue" : "P", "zValue" : "Z" }'
> 
> > 
> 
> curl -XPUT [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) -d '{"id" : 2, "statusCode"  
> : "P", "anotherCamelCase" : "P", "inverseStatusCode" : "A", "nocamelcase" :  
> "P", "aValue" : "a", "bValue" : "b", "pValue" : "p", "zValue" : "z" }'
> 
> > ```
> > Accessing
> > 
> > ```
> 
> these two documents with [http://localhost:9200/test/dummy/1](http://localhost:9200/test/dummy/1) and  
> [http://localhost:9200/test/dummy/2](http://localhost:9200/test/dummy/2) shows me all fields that I put in. That  
> part is fine.
> 
> > ```
> > Also,
> > for
> > the
> > most
> > part,
> > searching
> > 
> > ```
> 
> is ok because I can retrieve the values that I want (i.e. searching with  
> [http://localhost:9200/test/dummy/\_search?q=statusCode:P](http://localhost:9200/test/dummy/_search?q=statusCode:P) gives me a hit  
> which is 'test dummy 2').
> 
> > ```
> > However,
> > 
> > ```
> 
> when I do search for documents wherein the value is 'A' (or 'a') like  
> [http://localhost:9200/test/dummy/\_search?q=statusCode:A](http://localhost:9200/test/dummy/_search?q=statusCode:A), I am not getting  
> any hits. I've also tried searching against the fields 'anotherCamelCase',  
> 'inverseStatusCode', 'nocamelcase', 'aValue' and they all can't make a match  
> (for both "A" and "a"). Also, other letters like B, b, P, p, Z, z seems to  
> be ok.
> 
> > ```
> > Are
> > the
> > letters
> > 
> > ```
> 
> "A" & "a" reserved words?
> 
> > ```
> > Some
> > info
> > on my
> > setup:
> > 
> > ```
> 
> franz@see:~$ uname -a
> 
> > 
> 
> Linux see 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010  
> x86\_64 GNU/Linux
> 
> > 
> 
> franz@see:~$ echo $JAVA\_HOME
> 
> > 
> 
> /opt/java/64/jdk1.6.0\_17
> 
> > 
> 
> franz@see:~$ /opt/java/64/jdk1.6.0\_17/bin/java -version
> 
> > 
> 
> java version "1.6.0\_17"
> 
> > 
> 
> Java(TM) SE Runtime Environment (build 1.6.0\_17-b04)
> 
> > 
> 
> Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)
> 
> > 
> 
> franz@see:/opt/elasticsearch/active$ cat config/elasticsearch.yml
> 
> > 
> 
> #gateway:
> 
> > ```
> > #
> > 
> > ```
> 
> type: hdfs
> 
> > ```
> > #
> > 
> > ```
> 
> hdfs:
> 
> > ```
> > #
> > 
> > ```
> 
> uri: hdfs://localhost:8020
> 
> > ```
> > #
> > 
> > ```
> 
> path: /opt/vc/aptab/es-gateway
> 
> > ```
> > (Note:
> > at
> > first
> > I was
> > working
> > 
> > ```
> 
> on HDFS. But when I encountered this problem, i tried reverting to the  
> default setting which is an empty elasticsearch.yml and still does not  
> work).
> 
> > ```
> > Thanks,
> > 
> > --
> > Franz
> > Allan
> > Valencia
> > 
> > ```
> 
> See | Java Software Engineer
> 
> > 
> 
> [franz.see@gmail.com](mailto:franz.see@gmail.com)
> 
> > ```
> > LinkedIn:
> > 
> > ```
> 
> [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)
> 
> > ```
> > Twitter:
> > 
> > ```
> 
> [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> 
> > ```
> > --
> > Franz Allan Valencia
> > See | Java Software
> > Engineer
> > franz.see@gmail.com
> > LinkedIn:
> > 
> > ```
> 
> [http://www.linkedin.com/in/franzsee](http://www.linkedin.com/in/franzsee)
> 
> > ```
> > Twitter:
> > 
> > ```
> 
> [http://www.twitter.com/franz\_see](http://www.twitter.com/franz_see)
> 
> > 
> 
> --  
> Web Announcements Limited is a company registered in England and Wales,  
> with company number 05608868, with registered address at 10 Arvon Road,  
> London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 14, 2010, 5:38pm UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/15 "2010-07-14T17:38:52Z")

</div>

On Wed, 2010-07-14 at 20:33 +0300, Shay Banon wrote:

> You sure? Here is a sample that works for me:

Apologies - it was the refresh that did it. I wasn't waiting long enough  
before trying to retrieve the results.

> curl -XPOST localhost:9200/\_refresh; echo
> 
> curl -XGET localhost:9200/\_search?q=test:P

clint

> 

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<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, 4:22am UTC](https://discuss.elastic.co/t/searching-json-value-a-a/3053/16 "2017-07-06T04:22:15Z")

</div>


