Skip to content

Configuring auto-completion

Description

Form templates provided by Funnelback contains simple auto-completion configuration that can be managed using collection.cfg parameters.

Default settings of dataset returns up to 10 simple suggestions from the current collection/profile after typing minimum three characters into form field.

_default/simple.ftl

<#if question.collection.configuration.value('auto-completion') == 'enabled'>
jQuery('input.query').autocompletion({
  datasets: {
   <#if question.collection.configuration.valueAsBoolean('auto-completion.standard.enabled')>
   organic: {
     collection: '${question.collection.id}',
     profile : '${question.profile}',
     program: '<@s.cfg>auto-completion.program</@s.cfg>',
     format: '<@s.cfg>auto-completion.format</@s.cfg>',
     alpha: '<@s.cfg>auto-completion.alpha</@s.cfg>',
     show: '<@s.cfg>auto-completion.show</@s.cfg>',
     sort: '<@s.cfg>auto-completion.sort</@s.cfg>'
     group: true,
   }
   </#if>
  },
  length: '<@s.cfg>auto-completion.length</@s.cfg>'
 });
 </#if>

Default values

collection.cfg.default

auto-completion.alpha=.5
auto-completion=enabled
auto-completion.format=extended
auto-completion.length=3
auto-completion.program=../s/suggest.json
auto-completion.show=10
auto-completion.sort=0
auto-completion.source.extra=
auto-completion.source=internal
auto-completion.standard.enabled=true

Examples

collection.cfg

auto-completion.length=1

Auto-completion collection/profile.cfg parameters

top

Funnelback logo
v15.12.0