A quick question about mapping


(sezgin küçükkaraaslan) #1

Hi,
I have a quick question about property mapping. I have an intention to
introduce a double property to an index (with default settings) and index
and search it. Here is the simple mapping that I use:

{
"myType" : {
"properties" : {
"value" : {"type" : "double"}
}
}
}

When I use java node client to index data, I can insert an java
integer value to the index, and when I search, I get it as integer
also. Naturally I can't cast it to double. Is this what should I
expect from elastic search, does the responsibility belong who uses ES
clients, or should java search give me double values ?

Thanks in advance,
Sezgin Kucukkaraaslan
www.ifountain.com


(Shay Banon) #2

What do you use to get it back from search? Do you get the source as map?

-shay.banon

2010/6/14 sezgin küçükkaraaslan sezo104@gmail.com

Hi,
I have a quick question about property mapping. I have an intention to
introduce a double property to an index (with default settings) and index
and search it. Here is the simple mapping that I use:

{
"myType" : {
"properties" : {
"value" : {"type" : "double"}

    }
}

}

When I use java node client to index data, I can insert an java integer value to the index, and when I search, I get it as integer also. Naturally I can't cast it to double. Is this what should I expect from elastic search, does the responsibility belong who uses ES clients, or should java search give me double values ?

Thanks in advance,
Sezgin Kucukkaraaslan
www.ifountain.com


(sezgin küçükkaraaslan) #3

yes, indeed

On Mon, Jun 14, 2010 at 1:57 PM, Shay Banon shay.banon@elasticsearch.comwrote:

What do you use to get it back from search? Do you get the source as map?

-shay.banon

2010/6/14 sezgin küçükkaraaslan sezo104@gmail.com

Hi,

I have a quick question about property mapping. I have an intention to
introduce a double property to an index (with default settings) and index
and search it. Here is the simple mapping that I use:

{
"myType" : {
"properties" : {
"value" : {"type" : "double"}

    }
}

}

When I use java node client to index data, I can insert an java integer value to the index, and when I search, I get it as integer also. Naturally I can't cast it to double. Is this what should I expect from elastic search, does the responsibility belong who uses ES clients, or should java search give me double values ?

Thanks in advance,
Sezgin Kucukkaraaslan
www.ifountain.com


(Shay Banon) #4

In this case, it might happen, you should just treat it as Number and call
xxxValue on it.

-shay.banon

2010/6/14 sezgin küçükkaraaslan sezo104@gmail.com

yes, indeed

On Mon, Jun 14, 2010 at 1:57 PM, Shay Banon shay.banon@elasticsearch.comwrote:

What do you use to get it back from search? Do you get the source as map?

-shay.banon

2010/6/14 sezgin küçükkaraaslan sezo104@gmail.com

Hi,

I have a quick question about property mapping. I have an intention to
introduce a double property to an index (with default settings) and index
and search it. Here is the simple mapping that I use:

{
"myType" : {
"properties" : {
"value" : {"type" : "double"}

    }
}

}

When I use java node client to index data, I can insert an java integer value to the index, and when I search, I get it as integer also. Naturally I can't cast it to double. Is this what should I expect from elastic search, does the responsibility belong who uses ES clients, or should java search give me double values ?

Thanks in advance,
Sezgin Kucukkaraaslan
www.ifountain.com


(sezgin küçükkaraaslan) #5

Thanks..

On Mon, Jun 14, 2010 at 9:29 PM, Shay Banon shay.banon@elasticsearch.comwrote:

In this case, it might happen, you should just treat it as Number and call
xxxValue on it.

-shay.banon

2010/6/14 sezgin küçükkaraaslan sezo104@gmail.com

yes, indeed

On Mon, Jun 14, 2010 at 1:57 PM, Shay Banon <shay.banon@elasticsearch.com

wrote:

What do you use to get it back from search? Do you get the source as map?

-shay.banon

2010/6/14 sezgin küçükkaraaslan sezo104@gmail.com

Hi,

I have a quick question about property mapping. I have an intention to
introduce a double property to an index (with default settings) and index
and search it. Here is the simple mapping that I use:

{
"myType" : {
"properties" : {
"value" : {"type" : "double"}

    }
}

}

When I use java node client to index data, I can insert an java integer value to the index, and when I search, I get it as integer also. Naturally I can't cast it to double. Is this what should I expect from elastic search, does the responsibility belong who uses ES clients, or should java search give me double values ?

Thanks in advance,
Sezgin Kucukkaraaslan
www.ifountain.com


(system) #6