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.