-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client side search? #3
Comments
That's not supported at the moment. But that's a good idea.
|
Yeah, make it available client side On Mon, Jan 12, 2015 at 4:43 PM, Arunoda Susiripala <
Fardeem Munir |
I have add this feature. Hope this is what you wanted |
Hi, Arunoda, thank you for the awesome package. May you, please, provide working example for client search at https://github.com/meteorhacks-samples/meteor-instant-search-demo ? Thank you. |
Check here: http://instant-search-demo.meteor.com/ On Mon Feb 16 2015 at 2:56:48 PM shkomg notifications@github.com wrote:
|
Well, I can't find there anything defining data source in the client like .fetchData Thank you. |
Ah nope. It's not there. I don't think I've a working example now. On Mon Feb 16 2015 at 3:32:59 PM shkomg notifications@github.com wrote:
|
:( that 'd be awesome to have such an example. may you, pls, point me quick on how I may use .fetchData? should it go before .getData? As I do have reactive data source on client changing over some filters. So I need to adjust data source according to session var stage. |
hey shkomg, did you manage to get .fetchData to work, any working examples? |
yep, I just 've written my own solution. That was quicker & simplier for my 2015-03-18 19:43 GMT+02:00 Chos89 notifications@github.com:
Best regards Serhiy Khvashchuk |
Could you give any hints or code snippets on how did you do it? |
well, that's pretty simple: I have 1st template with For the 1st template I have a And for 2nd template I provide search results based on this session data. Does it makes sense? 2015-03-18 20:24 GMT+02:00 Chos89 notifications@github.com:
Best regards Serhiy Khvashchuk |
I think I understand what you are doing, but not sure if this would work in 2015-03-18 19:50 GMT+01:00 shkomg notifications@github.com:
|
It would be nice if we could use this with a REST API data source on the client. The particular REST API I'm using has a rate limit per second per IP address, so it is not feasible to do the requests on the server. |
Hi, I am current using the client side search too, getting my results from an external API and loading it in a subscription like this (client side):
On the server I have a publication named 'episodes' which get filled by the subscription and uses instance.added( 'episodes', Random.id() to populate the client collection. Then finally I have a client side collection SearchSource declaration:
Now I have the following weird issue, that when I do a search on one episode and then clear my search box again, the one episode episode result of the previous search is at the top of the new search result list. I can do it all in my Chrome console. After page render, 20 episodes are loaded ordered by date desc. Then when I do EpisodesSearch.search('trash') it results one episode titled 'trash'. Then when I run EpisodesSearch.search('') it shows me 20 episodes, of which no 1 is Trash. Number 2 is the actual newest episode that was on top. Can anyone confirm this or tell me what I do wrong? |
Check that your data doesnt have the same date
|
What do you mean with "Check if data doesn't have the same date". |
I debugged the FetchData function just before the Success hits (cause there the data is correct),
The actual problem is that the episode Trash, is normally the 9 results in the first list of 20. When I search for Trash, it becomes the only result. When I clear the searchbox, Trash is the one result out of the 20 displayed, while it has an older publish date and should be in position 9. In the update store function:
the removedItem array is empty because the storeIds will hold the 'Trash' entry and the currentIds will hold the 20 items (including the Trash entry), so nothing is removed. So I guess I know what is happening now, however I don't know how to proceed next. Do I need to sort the result again in the Helper to get the right order? Seems a bit like a hack. Could this be fixed? |
Adding the sort in the GetData fixes it for me:
so not sure if it was a bug or just me being silly. One thing I found out that it is imperative that I stop the Autorun for the handle that subscribes the episode. If i don't do that it is really messing up the collection. |
I have the data source on the client side. How can I use that?
The text was updated successfully, but these errors were encountered: