ProgrammingNot sure how to tackle this any help would be appreciated
Posted:

ProgrammingNot sure how to tackle this any help would be appreciatedPosted:

Large
  • Fairy Master
Status: Offline
Joined: Jun 03, 201013Year Member
Posts: 2,896
Reputation Power: 3713
Status: Offline
Joined: Jun 03, 201013Year Member
Posts: 2,896
Reputation Power: 3713
I am trying to design a search system that uses a string of characters to bring back a list of search results...



Example

user enters 123456 into the search bar



on the back end the 123456 references an ID



The ID references a list of associated results



How would I go about doing this?
#2. Posted:
Craig
  • Mind Charity
Status: Offline
Joined: Jan 16, 201212Year Member
Posts: 20,271
Reputation Power: 17065
Motto: 2b || !2b
Motto: 2b || !2b
Status: Offline
Joined: Jan 16, 201212Year Member
Posts: 20,271
Reputation Power: 17065
Motto: 2b || !2b
Depends what language you're using, but a foreach loop will be able to accomplish this easily.
#3. Posted:
CriticaI
  • Blind Luck
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
You can make this as complicated as you want. For general purposes, you can send the user's input to the server. Then sanitize by doing something like parseInt.

If you really want to be safe, you could write a lexer/parser to make sure no invalid inputs are submitted. This is how Twitter's search works. Special characters could be used to run commands like search for posts vs searching for users.
#4. Posted:
16
  • Christmas!
Status: Offline
Joined: Nov 24, 201310Year Member
Posts: 3,654
Reputation Power: 11981
Status: Offline
Joined: Nov 24, 201310Year Member
Posts: 3,654
Reputation Power: 11981
parse the data through the backend/DB and display results. There are a few ways to go about this but primarily API calling is what you're going to focus on.
Users browsing this topic: None
Jump to:


RECENT POSTS

HOT TOPICS