I wanted to get some feedback from you guys on what makes more sense regarding search. My initial thought about the implementation was to create a new resource, '/search/', that you'd pass a filter to with the search string. The resource would return to you a list of results. Each result would contain the full name, the type of object (game, concept, object, etc.), the URL to the small image associated of the object, and the API detail URL to get more information. This is similar to how the auto-complete search box works on the site.
The advantage of this is you can query across multiple types of objects (games, concepts, objects, etc.). The downside is that you'll probably always have to perform a subsequent query to get the data you're really looking for.
On the other hand, I could add search filters to all the existing resources. So it'd be something like "http://api.giantbomb.com/games/?search=warcraft". That would return a list of results from the standard /games/ resource that matched "warcraft".
The limitation here is that you won't be able to search across multiple types (is that interesting for anyone?).
Of course, I could always implement both. I'm going to try to get at least one of these ideas implemented today or tomorrow.
Search via API
Both I guess? The multi-type search would be more useful for general-purpose searches, but when searching for a specific resource, I'd use the search filters for the specific resource type.
Seems to me both would be useful in different situations... let me provide an example:
This may be a very silly idea, given that this will almost never change... but, can't a resource be added that lists the kind of pages available? Or the resources available? So I could use a, say, /types/ url and get a list like "games, characters" etc as a result. This way, I don't have to hard-code that anywhere in my program, and if written correctly it will work even if something is added / removed / renamed. A kind of introspection.
This way, I could, for example, provide checkmarks below a search box so that the user can limit his search, but I can make it so it will work regardless of any changes to the database, without changing a line in the program itself. Just something I've been thinking about (probably from reading some XML-RPC stuff), but probably is unneeded. ^_^;
Please Log In to post.
Log in to comment