Skip to content

Query suggestions

Suggestion feature could be backed by ES requires special mappings though.

Additional information:

JS Snippet based on typeahead and bloodhound:

// instantiate the bloodhound suggestion engine
var creditors = new Bloodhound({
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.value)
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
url: window.location.pathname + “/async/quicksearchsearch”,
replace: function(url, query) {
return url + “#” + query;
},
ajax : {
type: “POST”,
data: {
q: function() {
return $(‘#expression’).val();
}
}
}
}
});
// initialize the bloodhound suggestion engine
creditors.initialize();

$(‘#expression’).typeahead(
{
items: 4,
source:creditors.ttAdapter()
});

(from redmine: issue id 74, created on 2018-01-22tgradl, closed on 2018-01-22)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information