Search¶
Interface Search¶
These helper classes provide an interface to the VidiRest API should raise errors as needed to show feedback to the users.
- class portal.vidispine.isearch.SearchAutoCompleteHelper(searchquery=None, user=None, runas=None, *args, **kwargs)¶
Helper class for search autocomplete
- class portal.vidispine.isearch.SearchHelper(searchquery=None, searchmetadata=None, searchwithinlibrary=False, daterange=None, sortlist=None, user=None, runas=None, searchdomain='item', qdr=None, searchcriteria=None, *args, **kwargs)¶
This is a search helper class that will be utilised by the plugin architecture. It returns a usable dict of search results.
- doCombinedSearch(isdoc, query=None, matrix=None, merged=True, *args)¶
Gets all the subclips from a collection. This will include both items and collections.
- Args:
collection_id: The collection id to get.
query: Additional query to be sent through the API call
matrix: Additional matrix arguments
merged: Should items and collections be returned separately
- Returns:
VSCollection object.
- search(_content=None, queryamount=100, page=0, onlylibraryid=False, updateMode=None, updateFrequency=None, autoRefresh=False, maximumSuggestions=0, cache_key=None, includeDeleted=False)¶
Performs the search. Optionally takes a dictionary of fields needed. queryamount shows how many results to pull back, with an offset if needed.
- portal.vidispine.isearch.getMetadataFromRequestRecursion(user, query_dict, metadatagroup_name, batchupdate_metadata=False, for_elastic=False, singleton_fields=None, previous_object=None)¶
Given a request, and a metadata group name, all fields in the metadata group will be fetched and mapped to the fields given in the request and its values. If the batchupdate_metadata is set to True, the all fields in which the belonging checkbox is checked will be included
- portal.vidispine.isearch.getSingletonFromPreviousObjectOrMetadataGroup(prev_obj, mfn, is_sub_group=False)¶
Get the singleton field instance from previous object
- Parameters
prev_obj – Old metadata
mfn – ID of singleton field (portal_mf123456)
is_sub_group – True if prev_obj represents a subgroup (recursive calls)
- Returns
dict Key is the name of the singleton field and the value is the old value of the singleton field