Use the /authoring/v1/contextualsearch endpoint to retrieve contextual search results from the authoring collection based on the passed filters.
See the Authoring Search documents on the Content API for details of the main search service parameters.
Current filters
accept-languageSearches for content with matching languages. If this filter is specified theaccept-languagerequest header must be specified with the ordered list of languages to search with. The search iterates through all of the languages in order until a language returns one or more matching content items or the service has completed the search for all the languages without finding any results. If the search returns content items the response headercontent-languageis set to the language that returned those content items, otherwise this header is not returned in the response.proximitySearches for content located within a certain radius of a specified location.proximityis used in combination withdistancewhich is the bounding radius around the location. You can specify the location with thepositionparameter. If the parameter is not provided the location is read from theX-Akamai-Edgescapeheader. If the distance parameter is not provided distance is defaulted to 5.similarSearches for content or assets that are similar to a specified item.similaruses the tags added by AI, a user, or included in the asset, such as image metadata tags to search. The content and assets with matching tags to the specified item are returned. Based on the number of tags that match a 'score' is calculated for each content and asset, the bigger the number of matching tags the higher the score. The results are returned as an ordered array response that starts with items with the highestscoreand lists them in a descending order. Note: Since the specified item in the query would be a perfect match, it is not returned as a result.
Examples
-
Search by proximity by using user's location:
q=type:article&fl=description&filter=proximity&distance=50
Searches all content of the typearticleand returns items that are found within 50 km of user's location. -
Search by proximity by providing a location:
q=type:article&fl=description&filter=proximity&distance=50&position=37.25,-5.796
Searches all content of the typearticleand returns items that are found within 50 km of the location that is specifed in thepositionparameter. -
Search by language (setting the
accept-languagerequest header):
q=type:article&fl=description&filter=accept-language
accept-languagede
Searches all content of the typearticleand returns items where the language is set toGerman [de]. -
Search by language with ordered language list (setting the
accept-languagerequest header):
q=type:article&fl=description&filter=accept-language
accept-languageen,de;q=0.5
Searches all content of the type 'articleand returns items where the language is set toEnglish [en]. Then, proceeds to search all content of the typearticleforGerman [de]if no content is found forEnglish`. -
Search for images similar to a specified image:
q=*:*&filter=similar&similar-source-id=acd-23-564-09-asdf&similar-source-classification=asset&fq=assetType:image&rows=100
The search returns images that are similar to the item with the specified ID (similar-source-id) and classification (similar-source-classification). The results are sorted in order of descendingscoreby default. -
Search for images similar to a specified image and sort results in ascending
scoreorder:
q=*:*&filter=similar&similar-source-id=acd-23-564-09-asdf&similar-source-classification=asset&sort=score asc&fq=assetType:image&rows=100
The search returns images that are similar to the item with the specified ID (similar-source-id) and classification (similar-source-classification). The results are sorted in order of ascending score. -
Search for images similar to a specified image and sort results in ascending
lastModifiedorder:
q=*:*&filter=similar&similar-source-id=acd-23-564-09-asdf&similar-source-classification=asset&sort=lastModified asc&fq=assetType:image&rows=100
The search returns images that are similar to the item with the specified ID (similar-source-id) and classification (similar-source-classification). The results are sorted in order of ascending last modified date. -
Apply location and language filters (setting the
accept-languagerequest header):
q=type:article&fl=description&filter=proximity&filter=accept-language&position=0,0
accept-languageen,de;q=0.5
Searches all content of the typearticleand returns items where the language is set toEnglish [en]and thelocationis within a 5 km radius around the coordinates 0-degrees latitude and 0-degrees longitude. Then, proceeds to search all content of the type article forGerman [de]andlocationwithin a 5 km radius around the coordinates 0-degrees latitude and 0-degrees longitude if no content is found forEnglishbased search. -
Apply similar, location, and language filters (setting the
accept-languagerequest header):
q=*:*&fl=description&filter=proximity&filter=accept-language&position=0,0&filter=similar&similar-source-id=acd-23-564-09-asdf&similar-source-classification=content&fq=classification:content&rows=100
accept-languageen
The search returns any type of content which meets all of the following criteria:locationis within a radius of 5 km around the coordinates 0-degrees latitude and 0-degrees longitude- language is set to
English [de] - similar to the item with specified id (
similar-source-id) and classification (similar-source-classification).
User roles: admin, manager, editor, viewer
