AboutContactLogin

Index

Searching for Objects

The Zenfolio API provides a number of methods that allow for searching of photos and photosets based on various criteria. Currently, the following search methods are available:

  • SearchPhotoByCategory searches for the photos that have been assigned a specific category.
  • SearchPhotoByText searches for the photos with a full-text search. The search takes in to account many attributes with different relevance. The attributes include but are not limited to the keywords, the title and caption of the photo, the keywords and the title and caption of the containing gallery, the name of the photographer.
  • SearchSetByCategory searches for the photosets that have been assigned a specific category.
  • SearchPhotoByText searches for the photosets with a full-text search. The search takes into account many attributes with different relevance. The attributes include but are not limited to the keywords, the title and caption of the photoset, and the name of the photographer.

Regardless of the search criteria and what is being searched, all search methods follow the same pattern and have many common parameters:

ObjectResult SearchObjectByCriteria(
    string searchId,
    SortOrder sortOrder,
    search criteria,
    int offset,
    int limit
    )

The searchId parameter specifies a value that uniquely identifies this search. Specifying the same value for this parameter in a series of calls to a search method advises the system that the previous search results can be reused. This is useful when an application is retrieving search results in pages by calling a search method several times with only offset and limit parameters varying from call to call.

The return value of a search method is an object that contains object snapshots for the requested range and the estimated total number of results for this search. Applications can use the estimated total to adjust their user interface accordingly.

Note that the search results are subject to access control. Depending on whether the caller is authenticated and on whether access was granted to specific objects, search results may be different.