How to turn off Swiftype auto complete?

363 Views Asked by At

I am using Swiftype. There is no plugin involved, just the search code and a search box with the classes.

How can I turn off the auto complete? There is nothing on the docs about it, only regarding wordpress which does not work in my case with the code below:

    <script type="text/javascript">
    var swiftypeConfig = {
      disableAutocomplete: true
    };
    var Swiftype = window.Swiftype || {};
    (function() {
        Swiftype.key = '...';
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.async = true;
        script.src = "//s.swiftypecdn.com/embed.js";
        var entry = document.getElementsByTagName('script')[0];
        entry.parentNode.insertBefore(script, entry);
    }());
    </script>
1

There are 1 best solutions below

0
On BEST ANSWER

You are close with what you have there. This should do the trick:

<script type="text/javascript">
var Swiftype = window.Swiftype || {};
(function() {
    Swiftype.key = '...';
    Swiftype.disableAutocomplete = true;

    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.async = true;
    script.src = "//s.swiftypecdn.com/embed.js";
    var entry = document.getElementsByTagName('script')[0];
    entry.parentNode.insertBefore(script, entry);
}());
</script>