Hi @gavin1211 -
I'm assuming the results are at least appearing in the desired order (you're using sort=title
or similar already), and you've got a dedicated form or code block focused on this sorting scenario. Funnelback defaults to case-insensitive indexing and sorting.
A Freemarker snippet should assist in this case - here's an example to get you started:
<#assign currentLetter = "a">
${currentLetter?upper_case}
<@s.Results>
...
<#-- Print A-Z tier -->
<#if result.title?lower_case?starts_with(currentLetter)>
<#assign currentLetter = result.title?substring(0, 1)}>
${currentLetter?upper_case}
</#if>
<#-- Print result -->
${result.title}
...
</@s.Results>
There's other variations worth considering, too - sometimes a canonical title will not be the one preferred for sorting (e.g. "Moby Dick", or "The Whale", or "Whale, The"), sometimes you may not want to output a letter tier for which there are no matching titles.
Refer also:
https://docs.funnelback.com/15.10/more/extra/case_sensitive_search.html
http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_starts_with
http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_lower_case
http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_upper_case
http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_substring