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

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

Large
  • TTG Addict
Status: Offline
Joined: Jun 03, 201011Year Member
Posts: 2,876
Reputation Power: 3635
Status: Offline
Joined: Jun 03, 201011Year Member
Posts: 2,876
Reputation Power: 3635
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
  • Game Reviewer
Status: Offline
Joined: Jan 16, 20129Year Member
Posts: 20,254
Reputation Power: 17015
Motto: 2b || !2b
Motto: 2b || !2b
Status: Offline
Joined: Jan 16, 20129Year Member
Posts: 20,254
Reputation Power: 17015
Motto: 2b || !2b
Depends what language you're using, but a foreach loop will be able to accomplish this easily.
#3. Posted:
CriticaI
  • 2 Million
Status: Offline
Joined: Nov 05, 20137Year Member
Posts: 2,721
Reputation Power: 157
Status: Offline
Joined: Nov 05, 20137Year Member
Posts: 2,721
Reputation Power: 157
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
  • V5 Launch
Status: Offline
Joined: Nov 24, 20137Year Member
Posts: 3,493
Reputation Power: 10571
Status: Offline
Joined: Nov 24, 20137Year Member
Posts: 3,493
Reputation Power: 10571
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