View Full Version : Adding a search feature

03-12-2010, 08:26 PM
Adding a search feature

Hi, I'm developing an arcade games site: Aaron's Game Zone (http://azzaboi.weebly.com)

This site has a number of online flash games already and lots more to come. Will be added daily.

I would like to create some type of search feature for the site to make finding the game you want easiler.

I was thinking of a search box, users could type keywords and pick from a list, but might go with a basic dropdown list for now with just the title and url links of each game?

I was wondering what would be involved and the best (or easy) way to go around this.

Say if someone wants to find:

'Straw Hat Samurai' it would take them here:

'Werebox' would take them here:

'Paper Warfare' would take them here:

As you can see the link structures aren't the best and I might not be able to change them easily because I am using weebly.

But each game has a category:

Action / Platform
Adventure / Role Playing
Puzzle / Board & Card
Shooting Games
Beat Em Up Games
Strategy / Skill Games
Sports & Racing
Arcade & Classics
LifeStyle Games
Kids Games

If this would be useful for the search or do I need to add tags for each game?

Any help, tips, or code would be appreciated!

03-13-2010, 12:02 AM
So I'm guessing you hard-coded every HTML page, and you don't use a MySQL database?
If so, that's too bad. I don't even know if you are allowed to use server-side scripting,
like PHP with Weebly.

03-14-2010, 05:09 AM
Unfortunately PHP and SQL are not features of Weebly yet :(
Else I would of probably gone with a custom action script?

Everything is hand coded, yes. So I guess I should just go with a basic dropdown list that gets read from a txt file or something with title and url?

03-14-2010, 07:50 PM
But if you can't use php how do you expect to read from the text file? No client side language can do this on a website unless its an intranet. I guess you could have a flash drop down but then that can get messy.

03-14-2010, 09:42 PM
doh, true! They are planning to add that support, but in the future.
I guess I don't have much options for now?

03-15-2010, 10:16 AM
My site is already happily indexed by google, not a problem.
Developing the search using a custom google search maybe an option, but a rough one?
I think I need to have access to PHP or SQL to do anything decent, which I don't have at the moment.

03-17-2010, 08:03 PM
I would suggest using a database - it's the best way to categorise and tag each game you want to search on.

The best way to do this would be to add Title, Description, Summary and Category fields to your DB table and then create SQL to search though the text in every field for each word that was search upon.

You could even add a relevancy score to your SQL and order by this result descending so that the more instances of a particualr word that were found in the DB fields, the higher the relevancy (allowing the most likely game they were looking for to be returned first).


You have two games: -
1). TITLE: Straw Hats Samurai, DESCRIPTION: A fighting game involving Samurais
2). TITLE: Last Samurai, DESCRIPTION: Last Sumarai game

The user searches for "Samurai fighting"

The keyword appears in BOTH the Title and the Description field for game 1, but only twice in Title and Description for game 2, therefore, your SQL would return game 1 first and then game 2. Coupled with the fact that both search words appear in Title and Description for game 1 whereas only 1 of the search keywords appears in the DB fields for game 2.

I hope that explanation was clear? This is the best way to implement search functionality to any site as it returns the most relevant result first which is more likely to be what they were searching for in the first place.

03-17-2010, 08:38 PM
Thanks, sounds like a good way of searching, just need Weebly to add SQL functionality first or move off free hosting/domain.

03-18-2010, 01:35 AM
You could try using google search for your "search". It won't search everything but as you said its already indexed then google should return some decent results.