/// <summary> /// Searches videos according to the criteria provided by the user. /// </summary> /// <param name="all">Specifies the field:value pairs for search criteria that MUST be present in /// the index in order to return a hit in the result set. If the field's name is not present, it will /// search among the name, shortDescription, and longDescription fields by default.</param> /// <param name="any">Specifies the field:value pairs for search criteria AT LEAST ONE of which /// must be present to return a hit in the result set. If the field's name is not present, it will /// search among the name, shortDescription, and longDescription fields by default.</param> /// <param name="none">Specifies the field:value pairs for search criteria that MUST NOT be present /// to return a hit in the result set. If the field's name is not present, it will /// search among the name, shortDescription, and longDescription fields by default.</param> /// <param name="pageSize">Number of items returned per page. (max 100)</param> /// <param name="pageNumber">The zero-indexed number of the page to return.</param> /// <param name="exact">If true, disables fuzzy search and requires an exact match of search terms. /// A fuzzy search does not require an exact match of the indexed terms, but will return a hit for /// terms that are closely related based on language-specific criteria. The fuzzy search is /// available only if your account is based in the United States.</param> /// <param name="sortFields">Specifies the unique list of fields by which to sort results.</param> /// <returns>A collection of videos matching the specified criteria.</returns> public BrightcoveItemCollection<BrightcoveVideo> SearchVideos(IEnumerable<FieldValuePair> all, IEnumerable<FieldValuePair> any, IEnumerable<FieldValuePair> none, int pageSize, int pageNumber, bool exact, SortedFieldDictionary sortFields) { return SearchVideos(all, any, none, pageSize, pageNumber, exact, sortFields, null); }
/// <summary> /// Searches videos according to the criteria provided by the user. /// </summary> /// <param name="all">Specifies the field:value pairs for search criteria that MUST be present in /// the index in order to return a hit in the result set. If the field's name is not present, it will /// search among the name, shortDescription, and longDescription fields by default.</param> /// <param name="any">Specifies the field:value pairs for search criteria AT LEAST ONE of which /// must be present to return a hit in the result set. If the field's name is not present, it will /// search among the name, shortDescription, and longDescription fields by default.</param> /// <param name="none">Specifies the field:value pairs for search criteria that MUST NOT be present /// to return a hit in the result set. If the field's name is not present, it will /// search among the name, shortDescription, and longDescription fields by default.</param> /// <param name="pageSize">Number of items returned per page. (max 100)</param> /// <param name="pageNumber">The zero-indexed number of the page to return.</param> /// <param name="exact">If true, disables fuzzy search and requires an exact match of search terms. /// A fuzzy search does not require an exact match of the indexed terms, but will return a hit for /// terms that are closely related based on language-specific criteria. The fuzzy search is /// available only if your account is based in the United States.</param> /// <param name="sortFields">Specifies the <see cref="SortedFieldDictionary"/> by which to sort results.</param> /// <param name="videoFields">A list of the fields you wish to have populated in the Videos contained /// in the returned object. If you omit this parameter, the method returns the following fields of /// the video: id, name, shortDescription, longDescription, creationDate, publisheddate, lastModifiedDate, /// linkURL, linkText, tags, videoStillURL, thumbnailURL, referenceId, length, economics, playsTotal, /// playsTrailingWeek. If you use a token with URL access, this method also returns FLVURL, renditions, /// FLVFullLength, videoFullLength.</param> /// <param name="customFields">A list of the custom fields you wish to have populated in the videos /// contained in the returned object. If you omit this parameter, no custom fields are returned, unless you /// include the value 'customFields' in the video_fields parameter.</param> /// <param name="getItemCount">If true, also return how many total results there are.</param> /// <returns>A collection of videos matching the specified criteria.</returns> public BrightcoveItemCollection<BrightcoveVideo> SearchVideos(IEnumerable<FieldValuePair> all, IEnumerable<FieldValuePair> any, IEnumerable<FieldValuePair> none, int pageSize, int pageNumber, bool exact, SortedFieldDictionary sortFields, IEnumerable<string> videoFields, IEnumerable<string> customFields, bool getItemCount) { NameValueCollection parms = BuildBasicReadParams("search_videos"); if (all != null) { parms.AddRange("all", all.Select(o => o.ToBrightcoveString())); } if (any != null) { parms.AddRange("any", any.Select(o => o.ToBrightcoveString())); } if (none != null) { parms.AddRange("none", none.Select(o => o.ToBrightcoveString())); } if (sortFields != null) { string[] orderedFields = sortFields.OrderedDictionary.Cast<DictionaryEntry>() .Where(x => x.Key is SortBy) .Where(x => x.Value is SortOrder) .Select(x => String.Format("{0}:{1}", ((SortBy)x.Key).ToBrightcoveName(), ((SortOrder)x.Value).ToBrightcoveName())) .ToArray(); parms.Add("sort_by", String.Join(",", orderedFields)); } parms.Add("exact", exact.ToString().ToLower()); parms.Add("page_size", pageSize.ToString()); parms.Add("page_number", pageNumber.ToString()); parms.Add("get_item_count", getItemCount.ToString().ToLower()); if (videoFields != null) { parms.AddRange("video_fields", videoFields); } if (customFields != null) { parms.AddRange("custom_fields", customFields); } return RunQuery<BrightcoveItemCollection<BrightcoveVideo>>(parms); }