How to implement "type ahead" with user profile interests?

Hi,

I’m hoping someone can provide me with some general guidance about how I would implement a “type ahead” text box in a situation like when a user is adding interests to their user profile (or adding hashtags/keywords to any kind of persisted entity, etc).

I’m envisioning that the interests a user types & submits will end up being stored in a list within their respective profile, and my goal would be that if another user starts typing the same interest to add to their profile, that a “type ahead” feature would kick in and pull up a list of interests (already entered by other people) that start with the letters being typed. The goal being easier and more consistent data entry.

So:

  1. Is there a “type ahead” package that people use most… or just the usual jquery stuff?

  2. Would I create a central “Interests” collection and add every distinct interest to that (as well as the user’s profile.interests list) as any given user adds it to his/her own user profile?

Coming from the relational world… having the full text of every interest both in the profile + a central “interests” collection (for type ahead lookups) seems like so much redundant data compared to having a single interests table and every user just referencing foreign keys to that.

If I only had a few hundred users I guess the interests lookup could be a “distinct” query on the user profiles themselves instead of a centralized lookup table… but my goal is much more than hundreds of users :slight_smile:

Just high level thinking here, but I’d say that having a distinct place to store the interests would be my move. If you start thinking about pulling the data from each users doc, then you have to worry about locking down that pub, and you’d actually be subbing to way more data than what you needed. There is bound to be a ton of overlap in those docs, so having one doc/collection with unique interests seems like a preferable move to me.

2 Likes