Facetting by first letter


(Stefan Kruse) #1

Hi, i would like to facett by the first letter of search results. By Solar
i need to make a field with the first letter inside. Is there by
elasticseach maybe a cool function for this? I would to make a alphabetical
list like : A B C D but only for letters where a results behind. Regards
and thanks Stefan

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ff058c04-b7ba-48c6-b3d6-9ca1a14d6191%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Itamar Syn-Hershko) #2

You can for sure define 26 facets, each using a term script:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-terms-facet.html#_term_scripts

But I'm pretty sure this can be done using script fields, haven't tried
that one before tho
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-terms-facet.html#_script_field

--

Itamar Syn-Hershko
http://code972.com | @synhershko https://twitter.com/synhershko
Freelance Developer & Consultant
Author of RavenDB in Action http://manning.com/synhershko/

On Wed, Apr 23, 2014 at 6:51 PM, Stefan Kruse
info@all-around-shipping.dewrote:

Hi, i would like to facett by the first letter of search results. By Solar
i need to make a field with the first letter inside. Is there by
elasticseach maybe a cool function for this? I would to make a alphabetical
list like : A B C D but only for letters where a results behind. Regards
and thanks Stefan

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/ff058c04-b7ba-48c6-b3d6-9ca1a14d6191%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ff058c04-b7ba-48c6-b3d6-9ca1a14d6191%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvpMr2m1v--W8%3DE680UCuw8JQ%3D0zn8AvbqtOSn0LeW_9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Ivan Brusic) #3

You can easily accomplish this with value scripts, but I would still choose
the Solr approach of indexing a new field for performance reasons. If any
content is static in nature, I would always opt to handle the processing at
index time. Not only will you save CPU cycles by not having to run a
script, but you can also control exactly how the new field's data is
cached/used.

--
Ivan

On Wed, Apr 23, 2014 at 9:01 AM, Itamar Syn-Hershko itamar@code972.comwrote:

You can for sure define 26 facets, each using a term script:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-terms-facet.html#_term_scripts

But I'm pretty sure this can be done using script fields, haven't tried
that one before tho
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-terms-facet.html#_script_field

--

Itamar Syn-Hershko
http://code972.com | @synhershko https://twitter.com/synhershko
Freelance Developer & Consultant
Author of RavenDB in Action http://manning.com/synhershko/

On Wed, Apr 23, 2014 at 6:51 PM, Stefan Kruse <info@all-around-shipping.de

wrote:

Hi, i would like to facett by the first letter of search results. By
Solar i need to make a field with the first letter inside. Is there by
elasticseach maybe a cool function for this? I would to make a alphabetical
list like : A B C D but only for letters where a results behind. Regards
and thanks Stefan

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/ff058c04-b7ba-48c6-b3d6-9ca1a14d6191%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/ff058c04-b7ba-48c6-b3d6-9ca1a14d6191%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvpMr2m1v--W8%3DE680UCuw8JQ%3D0zn8AvbqtOSn0LeW_9w%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvpMr2m1v--W8%3DE680UCuw8JQ%3D0zn8AvbqtOSn0LeW_9w%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCZuO0Wma2ijGuxrOo7jUDSaqeN1XyzgJTofzngFR1Kow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4