Face Search - Filtering with Asset Metadata
Once Face Search Asset Ids are retrieved from the FR system using image search, the following search API can be used to filter the results based on asset metadata.
This special SaaS search for Face Search filtering uses two parameters to achieve seamless filtering:-
require_schema_id- a boolean parameter that specifies whether the search should requiredata_schema_idto be passed inschema_criteria. This requirement can be overridden by explicitly passingfalsefor this parameter. This allows face search filtering for assets across all schemas.is_fr_searchmust be set totruefor Face REcognition Searchfr_asset_ids- a list of asset ids against which metadata filters should be applied and results returned .
info
Note these constraints when using FR search
idsparameter cannot be used with FR searchrequire_schema_idshould be set tofalseifdata_schema_idis not passed- If
is_fr_searchis passed astrueandfr_search_idsparameter is not sent or is empty, zero assets will be returned
Sample cURL request
This request filters for three asset ids and within those three ids, it filters for only those assets which have the metadata field filespin_search_txt set to the value test.
curl --request POST \
--url https://app.filespin.io/api/v1/assets/search \
--header 'X-FileSpin-Api-Key: {{X-FileSpin-Api-Key}}' \
--header 'content-type: application/json' \
--data '{
"require_schema_id": false,
"is_fr_search": true,
"fr_asset_ids": ["90ddcc63baad4b2dba9d3e3ec2bc8b99",
"781531b99a8346089766d642b2c38aa0",
"694160d9e49d4cddb26293af2d83b990"],
"extended_result":true,
"schema_criteria": {
"fields": {
"filespin_search_txt": "test"
}
}
}'
In the above cURL example, if 694160d9e49d4cddb26293af2d83b990 is the only asset with filespin_search_txt=test, then only this asset id will be returned in the search result.
In all other aspects, this search follows the SaaS Search API specification.