Search via API

Avatar image for andy
andy

445

Forum Posts

298

Wiki Points

0

Followers

Reviews: 0

User Lists: 1

#1  Edited By andy

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.

Avatar image for lordandrew
LordAndrew

14609

Forum Posts

98305

Wiki Points

0

Followers

Reviews: 0

User Lists: 36

#2  Edited By LordAndrew

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.

Avatar image for jlrm01
jlrm01

2630

Forum Posts

83993

Wiki Points

0

Followers

Reviews: 0

User Lists: 24

#3  Edited By jlrm01

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...)

Avatar image for andy
andy

445

Forum Posts

298

Wiki Points

0

Followers

Reviews: 0

User Lists: 1

#4  Edited By andy
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.
Avatar image for funnyman22
Funnyman22

43

Forum Posts

179

Wiki Points

0

Followers

Reviews: 3

User Lists: 4

#5  Edited By Funnyman22

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 :-)
Avatar image for jlrm01
jlrm01

2630

Forum Posts

83993

Wiki Points

0

Followers

Reviews: 0

User Lists: 24

#6  Edited By jlrm01

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

Avatar image for andy
andy

445

Forum Posts

298

Wiki Points

0

Followers

Reviews: 0

User Lists: 1

#7  Edited By andy

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