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

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

Large
  • Gold Member
Status: Offline
Joined: Jun 03, 201011 Year Member
Posts: 2,874
Reputation Power: 3580
Status: Offline
Joined: Jun 03, 201011 Year Member
Posts: 2,874
Reputation Power: 3580
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
  • Rated Awesome
Status: Offline
Joined: Jan 16, 20129 Year Member
Posts: 20,235
Reputation Power: 16793
Motto: 2b || !2b
Motto: 2b || !2b
Status: Offline
Joined: Jan 16, 20129 Year Member
Posts: 20,235
Reputation Power: 16793
Motto: 2b || !2b
Depends what language you're using, but a foreach loop will be able to accomplish this easily.
#3. Posted:
CriticaI
  • TTG Addict
Status: Offline
Joined: Nov 05, 20137 Year Member
Posts: 2,711
Reputation Power: 155
Status: Offline
Joined: Nov 05, 20137 Year Member
Posts: 2,711
Reputation Power: 155
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
  • E3 2017
Status: Offline
Joined: Nov 24, 20137 Year Member
Posts: 3,484
Reputation Power: 10515
Status: Offline
Joined: Nov 24, 20137 Year Member
Posts: 3,484
Reputation Power: 10515
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