[scribd-platform-talk] How to search for documents tagged with some keyword?

5 views
Skip to first unread message

MastaBaba

unread,
May 6, 2010, 4:06:13 PM5/6/10
to Scribd Platform Talk
Combining info on the API call docs.search and information on how to
use search queries on http://www.scribd.com/developers/search_help, I
can only deduce that searching for documents matching the keyword
"tanzania" I will have to request the contents of the following call:

http://api.scribd.com/api?method=docs.search&api_key=MY_KEY&query=%40tags+%22tanzania%22&scope=all

The query is...

@tags "tanzania"

...but urlencoded.

However, instead of documents tagged with "tanzania", I end up with
documents matching "tanzania", in either tags, title or description.
This is obviously not desirable.

Am I doing something wrong, or is it not possible to search for
documents tagged with certain tags using the API?

Greets,

Babak

--
You received this message because you are subscribed to the Google Groups "Scribd Platform Talk" group.
To post to this group, send email to scribd-platfo...@googlegroups.com.
To unsubscribe from this group, send email to scribd-platform-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scribd-platform-developers?hl=en.

Mike Watts

unread,
May 6, 2010, 5:35:44 PM5/6/10
to scribd-platfo...@googlegroups.com
It looks like the search documentation is out of date. The query
string should look like this:
http://api.scribd.com/api?method=docs.search&api_key=MY_KEY&query=tags%3Atanzania&scope=all

In addition, we found (and are the process of fixing) a related
problem preventing this from working properly.


--Watts
--
Mike Watts
mwa...@scribd.com

Simon Wistow

unread,
May 6, 2010, 6:47:02 PM5/6/10
to scribd-platfo...@googlegroups.com
On Thu, May 06, 2010 at 02:35:44PM -0700, Mike Watts said:
> It looks like the search documentation is out of date. The query
> string should look like this:
> http://api.scribd.com/api?method=docs.search&api_key=MY_KEY&query=tags%3Atanzania&scope=all

@tags=tanzania should also work as well

MastaBaba

unread,
May 7, 2010, 3:33:28 AM5/7/10
to Scribd Platform Talk
Thanks. But this isn't working at all, at the moment, right?

Also, the API responses I get sometimes are empty. Sometimes empty,
sometimes not, making the exact same calls. Obviously, this makes it
impossible for me to deploy this in a production environment.

Can you let us know when you've resolved the issue with searching for
tagged documents? Thanks!

Babak

On May 7, 1:47 am, Simon Wistow <si...@scribd.com> wrote:
> On Thu, May 06, 2010 at 02:35:44PM -0700, Mike Watts said:
>
> > It looks like the search documentation is out of date.  The query
> > string should look like this:
> >http://api.scribd.com/api?method=docs.search&api_key=MY_KEY&query=tag...

Simon Wistow

unread,
May 7, 2010, 3:14:49 PM5/7/10
to Scribd Platform Talk
On May 7, 12:33 am, MastaBaba <babak.fakhamza...@gmail.com> wrote:

> Can you let us know when you've resolved the issue with searching for
> tagged documents? Thanks!

Can you give it a try now?

Either

query=tags:tanzania

or

query=@tags "tanzania"

should work.


> Also, the API responses I get sometimes are empty. Sometimes empty,
> sometimes not, making the exact same calls. Obviously, this makes it
> impossible for me to deploy this in a production environment.

This is more worrying. I think I may have found a potential reason but
if it keeps happening then please let me know.

Thanks, and sorry for the glitches - we've completely replaced the old
search infrastructure and there's some edge cases between the old
system and the new syste,.

Simon

MastaBaba

unread,
May 8, 2010, 4:23:06 AM5/8/10
to Scribd Platform Talk
The tag search is now working for me, thanks!

I notice that a search for tags:tanzania also returns documents tagged
with, say, "tanzania holiday". Is there a way in which this can be
avoided?

Also, I do still get empty results regularly. I would guess perhaps
some 50% of the times. It's not like the requests time out, because
the responses are returned fairly fast, in a few seconds or so. And
there's no error code or anything, which is returned, just an empty
page.

Greets,

Babak

Simon Wistow

unread,
May 8, 2010, 5:35:45 PM5/8/10
to scribd-platfo...@googlegroups.com
On Sat, May 08, 2010 at 01:23:06AM -0700, MastaBaba said:
> I notice that a search for tags:tanzania also returns documents tagged
> with, say, "tanzania holiday". Is there a way in which this can be
> avoided?

I'll look into it

> Also, I do still get empty results regularly. I would guess perhaps
> some 50% of the times. It's not like the requests time out, because
> the responses are returned fairly fast, in a few seconds or so. And
> there's no error code or anything, which is returned, just an empty
> page.

Hmm, that's a bit worrying - I'll dig into that as well.

systemaddict

unread,
May 10, 2010, 1:33:12 AM5/10/10
to Scribd Platform Talk
I can confirm this finding.

My search is also returning empty results very frequently (I thought
this had to do with hickups during the implementation of the new
indexer).

Simon Wistow

unread,
May 11, 2010, 1:17:22 PM5/11/10
to scribd-platfo...@googlegroups.com
On Sun, May 09, 2010 at 10:33:12PM -0700, systemaddict said:
> I can confirm this finding.
>
> My search is also returning empty results very frequently (I thought
> this had to do with hickups during the implementation of the new
> indexer).

Can either one of you send me a sample API call to <myfirstname> [at]
scribd.com

Thanks, and sorry for the problems.

MastaBaba

unread,
May 13, 2010, 7:50:53 AM5/13/10
to Scribd Platform Talk
Hi Simon,

I somehow didn't see this request earlier.

The calls I make are extremely straightforward. Here's one:

http://api.scribd.com/api?method=docs.search&api_key=MY_KEY&query=test&scope=all

I tried this one just now, and it came up empty.

I'll send this to your email as well.

Cheers,

Babak

MastaBaba

unread,
May 17, 2010, 4:22:57 AM5/17/10
to Scribd Platform Talk
Related to this, how do I request documents that match two or more
keywords.

I'm trying the query "tags:amsterdam,holland", '@tags= "amsterdam"
"holland"', but the best I get is documents that match one of the
keywords, not all keywords.

How to proceed?

Babak

On May 13, 2:50 pm, MastaBaba <babak.fakhamza...@gmail.com> wrote:
> Hi Simon,
>
> I somehow didn't see this request earlier.
>
> The calls I make are extremely straightforward. Here's one:
>
> http://api.scribd.com/api?method=docs.search&api_key=MY_KEY&query=tes...
Reply all
Reply to author
Forward
0 new messages