Auto complete works in preview of simple.ftl but not when used in the site. Can't find where the error is?

I have enable the auto-completion.standard property and auto-completion property in the collection configuration.
the suggestions works in the preview of the simple.ftl file but not in the actual site.
can someone please suggest where i am making the error?

<script>
  jQuery(document).ready(function() {
    jQuery('input.query-dcc').autocompletion({
      datasets: {
        <#--  make sure auto-completion.standard is enabled in the config file-->
        <#--  <#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
        },
       },
      typeahead: {hint: true},
      length: 3
    });
  });
</script>

This is the function which I use to display suggestions (default)

The things that spring to mind are:

  • Have you published all the changes (template, configuration) to the live site?
  • have you updated your search collections since making the changes?
  • Make sure when you are searching on the live site you don’t have your profile CGI parameter set to a _preview profile.

If you are still having issues I would suggest getting in touch with support so they can work more closely with you to solve your problem.