Hello, I want to implement search feature on user...
# community-help
l
Hello, I want to implement search feature on users favorite items. Each user has a field in their document - favoriteItems which is array of strings that are references to the documents. Is there a way to pass that array to react instant search, so it could create a filter based on the document Id, so that it would only search for documents that are within that array. And if there is such functionality, is there a limit to or I can add array with 100+ items in it.
k
đź‘‹ @Jason Bosco Will be able to go into the detail on this question later today.
đź’Ż 1
👍 1
j
@Lukas Visinskis It sounds like your end goal is to allow users to search for keywords in their favorited items. If so, you want to structure the data a bit differently, instead of a list of favorite document ids within each user record. Here's a thread that outlines this: https://typesense-community.slack.com/archives/C01P749MET0/p1625683625475800?thread_ts=1625683440.475500&cid=C01P749MET0
l
@Jason Bosco not the keywords, but I want to search the actual items that user has favorited.  You can see similar feature on instagram when you want to search through people that particular account follows.
So, instead of having userFavorites(with restaurant ids) field in user document, I would have to attach a field to the actual restaurant with all of the users that have favorited that restaurant?  Let me know if I am understanding this properly.
j
That's right
Also, by keywords, I meant "man" in your example above