matteodem / meteor-easy-search

Easy-to-use search for Meteor with Blaze Components
MIT License
438 stars 68 forks source link

No way to wait for all items to load #567

Closed ramsaymax closed 7 years ago

matteodem commented 7 years ago

I'm not sure if there's a good way to delay display until the data is "fully loaded". The components are written in such a way that you can easily extend the logic by using the blaze components library. See https://github.com/matteodem/meteor-easy-search/blob/master/packages/easysearch:components/lib/if-searching/if-searching.js for the core logic of the if searching component.

ramsaymax commented 7 years ago

if-searching considers the search over once the first instance of getComponentDict is returned.

This seems like a really inefficient way to cope with this issue. My collection has over a million documents in it, and I'm loading 40 by default set in the index.

Once the first one comes in, it takes several seconds to load all 40 and it looks atrocious.

The docs for if-searching are so sparse that this is the only info on the page:

"Renders the content when the associated input is being searched. Allows multiple indexes."

This module has taken up so much of my development time because everything is so poorly documented. Its a very frustrating thing to work with.

Can you please tell me how I can show the spinner on the page until all items are loaded, without making custom helpers than analyze the getComponentsDict?

I think this issue should be reopened.

matteodem commented 7 years ago

I'm sorry to hear that the docs are still not good enough. Please feel free to create a new issue with what information you miss or want to have in there. After all this is a personal project, without any monetary compensation.

The problem is that it's not possible to know on the client when all documents are loaded. Because you're working with subscriptions you just have a feed that either gives you 0 or more documents (and keeps on giving you more if docs are added).

Also you might want to switch from MongoDB to other search indexes that are specialized, or structure your data in a way that allows for faster search. The recipe about "advanced search" explains that http://matteodem.github.io/meteor-easy-search/docs/recipes/.