This project has moved and is read-only. For the latest updates, please go here.

[FIXED] Search results are different when searching in code and in

Topics: Developer Forum, Project Management Forum, User Forum
May 14, 2012 at 6:33 AM
Edited May 17, 2012 at 9:43 AM


Using .Text and .SortOrder=PhotoSearchSortOrder.Relevance did the job



I'll be posting pictures why it was different and please tell me if I did something wrong. 

The pictures I'll be showing: starting from Left

  • search result
  • .NET search result
  • actual code
  • the sample UI


click on the images for larger version

searching for windowsphone7


searching for windows phone


searching for htc


searching for microsoft


why are they different??

May 14, 2012 at 8:23 AM

I just want to update this. I found out that PhotoSearchOptions.Tags is used to look for specific tags.


how do I search by not using Tags. I mean the regular Flickr query.

May 15, 2012 at 10:31 PM

To search by text rather than tag use PhotosSearchOptions.Text parameter.

Also, to get a proper match for the same search on the Flickr web site you would have to authenticate your call to the Flickr API, otherwise private, moderated and restricted photos are not returned.


May 16, 2012 at 5:51 AM

Thanks Sam. 

But am not sure why it gives the same results as Tags.


Any ideas?

May 16, 2012 at 1:46 PM

If you don't authenticate the call you won't see moderated, restricted or private photos. If you search by Text or Tags the results will be different, just as they are on the Flickr web site if you search by text or tags:




May 17, 2012 at 12:09 AM

am not sure what you mean by authenticate. Is that using the API key an authentication?


I have here the code

string apikey = ApiKey.Text; // the api key
Flickr flickr = new Flickr(apikey);

PhotoSearchOptions searchOptions = new PhotoSearchOptions();
searchOptions.Text = txSearch.Text;
searchOptions.PerPage = 20;

PhotoCollection photocoll = flickr.PhotosSearch(searchOptions);

but still shows a .Tags result even if I use the .Text property. 

May 17, 2012 at 9:34 AM

The issue I think is the default sort order. The default when using the Flickr API is date-posted-desc. This matches exactly what is used on the Flickr web site for a tag based search. However the Flickr web site uses relevance when doing a full text search.

Try setting searchOptions.SortOrder = PhotoSearchSortOrder.Relevance to match the results from the Flickr web site.


May 17, 2012 at 9:40 AM

Thanks Sam. That worked!

May 17, 2012 at 11:56 AM

I'd like to add if it's possible to search an image with a min or max Width and Height option?

May 17, 2012 at 12:07 PM

No, there is not way in Flickr to do that kind of search I'm afraid. If Flickr ever supports it I will add it to the FlickrNet library.


May 17, 2012 at 12:30 PM

Understood. Thanks again!