#1 Posted by andy (427 posts) -

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.

Staff
#2 Posted by LordAndrew (14426 posts) -

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.

#3 Edited by jlrm01 (1992 posts) -

You could add a type filter to the /search/ url that accepts multiple values, so that you can look for a subset of the available types of pages, I think... (EDIT: as an addition to the first case. Both sound useful...)

#4 Posted by andy (427 posts) -
jlrm01 said:
"You could add a type filter to the /search/ url that accepts multiple values, so that you can look for a subset of the available types of pages, I think..."

Ya, was already planning on doing that.  Let me play with a few ideas.  I'll post again shortly.
Staff
#5 Posted by Funnyman22 (31 posts) -

Seems to me both would be useful in different situations... let me provide an example:

Lets say the first thing my app does after it launches is provide you with a search box, maybe it says "Start Typing, We'll figure it out" like your guys' does... that search would use the /search/ resource, and it would provide a way for users to quickly search for what they want without having to pick "Character" or "Game" or "Concept".

But if the user wants to search for something more specific (i.e. Characters containing the word Mario, since doing the generic search would return a huge number of results), then I'm going to have tabs or a selector allowing them to choose what kind of thing they're searching for.

So I guess I see uses for both, but I would take either happily :-)
#6 Posted by jlrm01 (1992 posts) -

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. ^_^;

#7 Posted by andy (427 posts) -

Search has been pushed live.  Check out this post for more info.

Staff