Closed woniesong92 closed 9 years ago
Yeah, you probably defined it as a helper on the wrong template. Good to double check.
I'm getting this same error although I do not use the settings attribute
{{> esInput index="listing" id="search" class="search" placeholder="Brand, Name, Neighborhood, Size, Price..."}}
Have I not already declared limit when I create the search index ( 'limit' : 20 ) ?
EasySearch.createSearchIndex('listing', {
'collection': Listing,
'field': [
'createdAt',
'listing_title',
'category',
'username',
'price',
'city',
'state',
'size'
], // array of fields to be searchable
'limit' : 20,
'use' : 'mongo-db',
'props': {
'sortBy': 'price'
},
'sort': function () {
if (this.props.sortBy === 'listing_title') {
return { 'listing_title': 1 };
}
},
'query': function (searchString) {
var query = EasySearch.getSearcher(this.use).defaultQuery(this, searchString);
return query;
}
});
@chackerian I think that is a different package: https://github.com/matteodem/meteor-easy-search
When I include the following
{{> inputAutocomplete settings=settings id="msg" class="input-xlarge" placeholder="Courses..."}}
inside my template, it seems
settings
is undefined.I defined
settings
function as a helper method inside a template. Is this issue only happening to me?