Docsearch hanle --
HTML
<!-- at the end of the HEAD -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
<!-- at the end of the BODY -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
<input id="input" />
JavaScript
docsearch({
apiKey: '8f77725b2f2db4166675acc6e8ea3526',
indexName: 'getcomposer',
inputSelector: '#input',
queryHook: function (query) {
var parts = query.split(' ');
debugger
parts = parts.map(function (part) {
var word = part.trim();
if (word.length >= 2 && word[0] === '-' && word[1] === '-') {
word = '"' + word + '"';
}
return word;
});
console.log(parts);
return parts.join(' ');
},
debug: false // Set debug to true if you want to inspect the dropdown
});