Photo search results differ greatly from web search results

Topics: Developer Forum
Apr 22, 2009 at 9:39 PM
Edited Apr 22, 2009 at 11:21 PM
Using the following code:

    PhotoSearchOptions options = new PhotoSearchOptions();
    options.Tags = "alpha,beta";
    PhotoCollection photoCollection = new PhotoCollection();
    int page = 1;
    Photos photos = null;

        options.Page = page;
        photos = flickr.PhotosSearch(options);
    } while (page <= photos.TotalPages);

I get:

    photos.TotalPhotos = 211279
    photos.TotalPages = 2113

Setting options.Text instead of options.Tags yields photos.TotalPhotos = 1370.

When I do searches on the Flickr web site, I get different results, especially for the Tabs option:

    "Everyone's uploads" "alpha,beta" "Tags only" yields "We found 4,288 results tagged with alpha,beta."
    "Everyone's uploads" "alpha,beta" "Full text" yields "We found 1,544 results matching alpha,beta."

Using the advanced search with settings that should maximize the number of hits seems to make no difference.  Am I doing this right?


I've looked at some of the returned photos, and their properties with the word "Tag" in them are all null.  If I instead use PhotosSearch(tags), I still get the large number of photos, but they have valid CleanTag properties.

Searching again with PhotoSearchOptions, if I set options.Extras = PhotoSearchExtras.Tags, the CleanTags properties seem to be filled, so maybe I'm getting the hang of this.

I think this will work for me, as long as I know the photos are what I want, at least when searching for tags. I am still confused as to what the web search is doing, but at least I'm getting the result with the larger #photos.

I noticed the web search allows for a list of words to not appear with the photo.  I imagine I can do the same after the fact, but is there a way to do this up front with PhotosSearch?
Apr 27, 2009 at 8:38 AM
Firstly, unless specified TagMode defaults to 'Any' tag, so your search is searching for photos with 'alpha' OR 'beta', while the Flickr search searches for 'alpha' AND 'beta'.

However changing TagMode to 'All' doesn't get exactly the same answers, but it does get the same answers as performing the same search directly using the Flickr API explorer, so I know it isn't anything to do with my code, just a idiosynchracy of the Flickr API.