Searching JSON value "A" / "a"


(Franz Allan Valencia See) #1

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


(Lukáš Vlček) #2

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) #3

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

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


(Shay Banon) #4

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 :slight_smile:

On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

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/1and
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


(Franz Allan Valencia See) #5

seems like im still stuck with this whole not_analyzed thing :slight_smile:

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.comwrote:

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 :slight_smile:

On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

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/1and
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


(Shay Banon) #6

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 :slight_smile:

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.comwrote:

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 :slight_smile:

On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

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/1and
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


(Franz Allan Valencia See) #7

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.comwrote:

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 :slight_smile:

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 :slight_smile:

On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

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/1and
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


(Clinton Gormley) #8
    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 -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.


(Shay Banon) #9

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.comwrote:

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 :slight_smile:

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 :slight_smile:

On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

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


(Shay Banon) #10

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.comwrote:

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 :slight_smile:

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 :slight_smile:

On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

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


(Clinton Gormley) #11

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 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.


(Franz Allan Valencia See) #12

Thanks! It now works ! :slight_smile:

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.comwrote:

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.comwrote:

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 :slight_smile:

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:Astill 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 :slight_smile:

On Wed, Jun 30, 2010 at 2:44 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

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

--
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


(Shay Banon) #13

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' -d '
{
"index" : {
"analysis" : {
"analyzer" : {
"sortable" : {
"tokenizer" : "keyword",
"filter" : ["lowercase"]
}
}
}
}
}
'; echo
curl -XPUT '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> wrote:

Thanks! It now works ! :slight_smile:

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

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

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 :slight_smile:

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 :slight_smile:

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

--
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


(Shay Banon) #14

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.ukwrote:

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 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.


(Clinton Gormley) #15

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.


(system) #16