Closed holwech closed 7 years ago
I could be missing something, but this works perfectly when using the normal input component. It also works without any selectors, but with a selector no suggestions appear at all.
client
Template.tools.helpers({ commentsIndex: function() { return CommentsIndex; } });
<template name='tools'> <div class='row'> <div class="autosuggest-component"> {{> EasySearch.Autosuggest index=commentsIndex}} </div> </div> </template>
Setting the selector-value
setSearchLanguage = function(lang) { CommentsIndex.getComponentMethods() .addProps('language', lang); }
server
CommentsIndex = new EasySearch.Index({ collection: Comments, fields: ['comment'], engine: new EasySearch.MongoDB({ selector: function (searchObject, options, aggregation) { let selector = this.defaultConfiguration().selector(searchObject, options, aggregation); selector.language = options.search.props.language; return selector; } }) });
This has to do with the autosuggest component not using the component methods. I'll have a look at this soonish
+1 Same issue. Thank you.
This is fixed in the latest version 2.1.6.
2.1.6
I could be missing something, but this works perfectly when using the normal input component. It also works without any selectors, but with a selector no suggestions appear at all.
client
Setting the selector-value
server