The "fields" option


(goodieboy) #1

Hi,

I'm trying to set the return fields in my search request using the
"fields" array. But nothing I do actually works:

"fields" : ["name", "location.city", "location.street"]

What am I missing here?

Thanks,
Matt


(Shay Banon) #2

You need to map them as stored in the mapping definition. In general, it is
usually better to get back the actual json indexed and fetch what you want
from them, then loading several fields.

-shay.banon

On Sun, Aug 1, 2010 at 5:17 AM, matt mitchell goodieboy@gmail.com wrote:

Hi,

I'm trying to set the return fields in my search request using the
"fields" array. But nothing I do actually works:

"fields" : ["name", "location.city", "location.street"]

What am I missing here?

Thanks,
Matt


(goodieboy) #3

Ahh yes, makes sense. Thanks.

Matt

On Aug 1, 6:54 am, Shay Banon shay.ba...@elasticsearch.com wrote:

You need to map them as stored in the mapping definition. In general, it is
usually better to get back the actual json indexed and fetch what you want
from them, then loading several fields.

-shay.banon

On Sun, Aug 1, 2010 at 5:17 AM, matt mitchell goodie...@gmail.com wrote:

Hi,

I'm trying to set the return fields in my search request using the
"fields" array. But nothing I do actually works:

"fields" : ["name", "location.city", "location.street"]

What am I missing here?

Thanks,
Matt


(system) #4