Skip to main content

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 require data_schema_id to be passed in schema_criteria. This requirement can be overridden by explicitly passing false for this parameter. This allows face search filtering for assets across all schemas.
  • is_fr_search must be set to true for Face REcognition Search
  • fr_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

  • ids parameter cannot be used with FR search
  • require_schema_id should be set tofalse if data_schema_id is not passed
  • If is_fr_search is passed as true and fr_search_ids parameter 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.