Closed cosmin-novac closed 7 years ago
This is even worse if I try to add multiple collections, then there is a lot of clipping and there are tens of unnecessary searches started on each page load and each search - each collection is searched at least a few times.
can you provide a simple reproduction repository?
Hm, sorry, the app is quite complex and I would have to build an entirely new app from scratch for a repo. Perhaps there is anything out of the ordinary in the code above that I could provide more info on and/or more code snippets?
try removing the {{else}}
block in your example code? Does that help?
I'm afraid removing the {{else}}
block didn't change the behaviour. I solved the problem with a workaround now, by handling the search helper manually, and replacing the EasySearch.Input field with a normal input field.
searchResultsCharacter: function() {
var searchTerm = Session.get("searchTerm");
if (searchTerm==null || searchTerm=="")
return null
else
return CharacterIndex.search(searchTerm).fetch();
},
Hello everyone,
I have a relatively simple search setup. I want to search through a characters Collection - and I need only the characters with a certain "storyId".
The problem is, the {{> EasySearch.Input }} is always active, always searching on page reload, even though it's set up like this: "timeout=500 event=enter allDocsOnEmpty=false". I would expect it to not search anything if the input field is empty and/or if the user hasn't pressed enter.
This is my index:
And this is the template:
The permanent searching is slowing down my app considerably. How can I solve this? I was considering skipping the default template elements and manually triggering the search, but maybe there's a better solution I'm not seeing?