Faceting

Hi,

Just starting to play with ES and very impressed! Nice work.

I've got faceting working, but the values are all terms... but what I
want back are the original string values for the fields, in other
words... if my field value is "Elastic Search", then that's what I'd
like to have back as a facet value. How can I make that happen? I'm
guessing it has something to do with index settings?

Thanks,
Matt

I think in this case, what you want is to define in the mappings the field
you do facets on to not be analyzed (you can use multi_field mappings if you
want to have different (index) ways to look at this property). Then, once
its not analyzed, you will get the actual value since it won't be broken
down into terms.

-shay.banon

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

Hi,

Just starting to play with ES and very impressed! Nice work.

I've got faceting working, but the values are all terms... but what I
want back are the original string values for the fields, in other
words... if my field value is "Elastic Search", then that's what I'd
like to have back as a facet value. How can I make that happen? I'm
guessing it has something to do with index settings?

Thanks,
Matt

Hi Shay. Thanks that makes sense. I can't seem to get it working
though, here's the mapping for the field:

"locality" : {
"type" : "multi_field",
"fields" : {
"locality" : {
"omit_term_freq_and_positions" : false,
"omit_norms" : false,
"store" : "yes",
"term_vector" : "no",
"type" : "string",
"index" : "analyzed"
},
"untouched" : {
"omit_term_freq_and_positions" : true,
"omit_norms" : true,
"store" : "yes",
"term_vector" : "no",
"type" : "string", "index" : "not_analyzed"
}
}
}

Does that look OK? I'm assuming that when indexing, I only need to set
the locality field, and the multi-index is taken care of?

Thanks!

Matt

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

I think in this case, what you want is to define in the mappings the field
you do facets on to not be analyzed (you can use multi_field mappings if you
want to have different (index) ways to look at this property). Then, once
its not analyzed, you will get the actual value since it won't be broken
down into terms.

-shay.banon

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

Hi,

Just starting to play with ES and very impressed! Nice work.

I've got faceting working, but the values are all terms... but what I
want back are the original string values for the fields, in other
words... if my field value is "Elastic Search", then that's what I'd
like to have back as a facet value. How can I make that happen? I'm
guessing it has something to do with index settings?

Thanks,
Matt

Oh got it. I was PUTting the mapping incorrectly. Got confused because
my resource name is "properties", so the mapping was one level too
deep. Working fantastic now.

Matt

On Aug 1, 7:33 am, matt mitchell goodie...@gmail.com wrote:

Hi Shay. Thanks that makes sense. I can't seem to get it working
though, here's the mapping for the field:

"locality" : {
"type" : "multi_field",
"fields" : {
"locality" : {
"omit_term_freq_and_positions" : false,
"omit_norms" : false,
"store" : "yes",
"term_vector" : "no",
"type" : "string",
"index" : "analyzed"
},
"untouched" : {
"omit_term_freq_and_positions" : true,
"omit_norms" : true,
"store" : "yes",
"term_vector" : "no",
"type" : "string", "index" : "not_analyzed"
}
}
}

Does that look OK? I'm assuming that when indexing, I only need to set
the locality field, and the multi-index is taken care of?

Thanks!

Matt

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

I think in this case, what you want is to define in the mappings the field
you do facets on to not be analyzed (you can use multi_field mappings if you
want to have different (index) ways to look at this property). Then, once
its not analyzed, you will get the actual value since it won't be broken
down into terms.

-shay.banon

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

Hi,

Just starting to play with ES and very impressed! Nice work.

I've got faceting working, but the values are all terms... but what I
want back are the original string values for the fields, in other
words... if my field value is "Elastic Search", then that's what I'd
like to have back as a facet value. How can I make that happen? I'm
guessing it has something to do with index settings?

Thanks,
Matt