getSearchResult: total number of results

28 views
Skip to first unread message

acgreen

unread,
Feb 19, 2008, 6:12:54 AM2/19/08
to Fotolia API
I'm currently trying to determine the total number of results to a
given term a user is searching. Unfortunately getSearchResult seems to
not return to me the "nb_results" as stated in the API documentation.
Can anyone confirm that or is it just me who get's the result wrong?

Thanks in advance

pierre / Fotolia

unread,
Feb 20, 2008, 2:22:32 AM2/20/08
to Fotolia API
Hi,

I just checked and nb_results is correctly sent with any search
results.
Do you use the PHP kit we developped ? There is an easy way to show
the xml response, in which you can see that nb_results is sent as the
first param.

Pierre

acgreen

unread,
Feb 20, 2008, 4:47:55 AM2/20/08
to Fotolia API
Nope,

I'm still trying to do this via Java using Apache XML-RPC for the
requests.
When searching the term "dog" I'd receive something like this:
{28={thumbnail_400_width=284.0, thumbnail_110_url=http://static-
p3.fotolia.com/jpg/
00/01/40/58/110_F_1405858_3ZLdCcjoWZlKXBMzD7TtFttFfEwUqc.jpg,
thumbnail_height=110, title=chiot dogue des canaries,
thumbnail_width=78.0, thumbnail_400_url=http://static-p3.fotolia.com/
jpg/00/01/40/58/400_F_1405858_3ZLdCcjoWZlKXBMzD7TtFttFfEwUqc.jpg,
creator_name=cynoclub, thumbnail_30_url=http://static-p1.fotolia.com/
jpg/00/01/40/58/30_F_1405858_3ZLdCcjoWZlKXBMzD7TtFttFfEwUqc.jpg,
thumbnail_url=http://static-p3.fotolia.com/jpg/
00/01/40/58/110_F_1405858_3ZLdCcjoWZlKXBMzD7TtFttFfEwUqc.jpg,
thumbnail_110_width=78.0, thumbnail_30_width=21.0, id=1405858,
thumbnail_400_height=400, affiliation_link=http://us.fotolia.com/id/
1405858/partner/200482948, creator_id=124125, thumbnail_html_tag=<img
src="http://static-p3.fotolia.com/jpg/
00/01/40/58/110_F_1405858_3ZLdCcjoWZlKXBMzD7TtFttFfEwUqc.jpg"
alt="chiot dogue des canaries" title="chiot dogue des canaries"
width="78" height="110" />, thumbnail_110_height=110,
thumbnail_30_height=30, licenses=[Ljava.lang.Object;@d2be98},
3={thumbnail_400_width=400, thumbnail_110_url=http://static-
p4.fotolia.com/jpg/
00/04/20/89/110_F_4208990_ocZvZuqSe27J32tWON17ruVxvniGIykx.jpg,
thumbnail_height=45.0, title=Dog Textgestaltung, thumbnail_width=110,
thumbnail_400_url=http://static-p4.fotolia.com/jpg/
00/04/20/89/400_F_4208990_ocZvZuqSe27J32tWON17ruVxvniGIykx.jpg,
creator_name=Otto Durst, thumbnail_30_url=http://static-p2.fotolia.com/
jpg/00/04/20/89/30_F_4208990_ocZvZuqSe27J32tWON17ruVxvniGIykx.jpg,
thumbnail_url=http://static-p4.fotolia.com/jpg/
00/04/20/89/110_F_4208990_ocZvZuqSe27J32tWON17ruVxvniGIykx.jpg,
thumbnail_110_width=110, thumbnail_30_width=30, id=4208990,
thumbnail_400_height=163.0, affiliation_link=http://us.fotolia.com/id/
4208990/partner/200482948, creator_id=301356, thumbnail_html_tag=<img
src="http://static-p4.fotolia.com/jpg/
00/04/20/89/110_F_4208990_ocZvZuqSe27J32tWON17ruVxvniGIykx.jpg"
alt="Dog Textgestaltung" title="Dog Textgestaltung" width="110"
height="45" />, thumbnail_110_height=45.0, thumbnail_30_height=12.0,
licenses=[Ljava.lang.Object;@df1074}}

pierre / Fotolia

unread,
Feb 20, 2008, 5:57:34 AM2/20/08
to Fotolia API
How do you access the search results ?
The results could be seen as an array with the following elements :

results["nb_results"] = 21438;
results[0] = array('id', .....)
results[1] = array('id', .....)

Could you be looping only on the numeric elements of the array ?

Pierre

acgreen

unread,
Feb 20, 2008, 1:04:31 PM2/20/08
to Fotolia API
Hmm,
I don't know how or why, but when I tinkered with this a bit with a
few minutes ago I got a value for "nb_results". Suddenly the result
that the fotolia-server is sending back incorporates this value too.
The only thing that's weired is that I receive different values then
when I use the fotolia website. Searching for "dog" on the German
website you get 587 files - using XML-RPC I receive 588 as the value
of "nb_results". When you are searching for the German translation
("hund") you get a more drastic difference with 21366 files on the
fotolia website and a value of 21438 using XML-RPC.

acgreen

unread,
Apr 14, 2008, 11:28:32 AM4/14/08
to Fotolia API
Hi everyone,

as I'm adjusting our search I stumbled upon this issue again.
It seems to be a problem with the nb_results value the API is
sending back to the client. When you are searching for the
word "ball" with language_id=4 for German you receive an
nb_results value of 49711. If you use the searchform at
de.fotolia.com
you receive a total value of 46037 (including the infinite collection
you don't get through the API - if I'm not mistaken) for nb_results.

Maybe anyone from fotolia can verify and give a solution for that
this.


Thanks in advance,
André
Reply all
Reply to author
Forward
0 new messages