-
Notifications
You must be signed in to change notification settings - Fork 92
Adobe Stock Image Search Design
In order to provide more accurate search results should be the ability to modify the following search criteria:
Name | Parameter Name | Description | Values |
---|---|---|---|
X per page | limit | Number of images per page | 32 (default); 48; 64 |
Image type | content_type | Asset type to display | all (default); photo; Illustration |
Safe content | offensive | Include image with violence or nudity | only safe (default); all |
Isolated image only | isolated | Image subject is isolated from the background by being on a uniformly colored background. | no (default); yes |
Image orientation | orientation | images with specific orientation | all (default); horizontal; vertical; square; panoramic |
Image color | colors | Images that have specific color | HEX |
Price | premium | Standard or premium (more expensive) images | include Premium (default); standard |
Parameter | Description |
---|---|
relevance (default) | How closely it matches your search request, closest matches first. |
creation | Creation date in descending order (newest first). |
popularity | In descending order by the number of views by all users. |
nb_downloads | In descending order by the number of downloads by all users since the asset was added to Adobe Stock. |
undiscovered | Starting with assets that have not commonly been viewed or downloaded. |
Search API service contracts details available on the Application Service Contracts page
The \Magento\AdobeStockClientApi\Api\ClientInterface::search
method is accepting \Magento\Framework\Api\SearchCriteriaInterface
as an argument.
The client is using the collection of classes implementing \Magento\AdobeStockClientApi\Api\SearchParameterProviderInterface
to process search criteria.
In case any additional parameters should be processed for Adobe Stock API search request the following actions should be performed:
- Create a class implementing
\Magento\AdobeStockClientApi\Api\SearchParameterProviderInterface
- The required values should be transferred from
SearchCriteria
toSearchParameters
by the implementation
- The required values should be transferred from
- Add the created class to
\Magento\AdobeStockClient\Model\SearchParametersProviderComposite
as an item inproviders
array constuctor parameter viadi.xml
arguments
node
Example:
<type name="Magento\AdobeStockClient\Model\SearchParametersProviderComposite">
<arguments>
<argument name="providers" xsi:type="array">
<item name="orientation_filter" xsi:type="object">Magento\AdobeStockClient\Model\SearchParametersProvider\Orientation</item>
...
</arguments>
</type>
In case a value from a specific filter of SearchCriteria
needs to be set to SearchParameters
via specific methtod without any additional business logic, a new class is not necessary. A \Magento\AdobeStockClient\Model\SearchParametersProvider\SimpleFilters
class can be configured via DI.
Example:
<type name="Magento\AdobeStockClient\Model\SearchParametersProvider\SimpleFilters">
<arguments>
<argument name="filters" xsi:type="array">
<item name="premium_price_filter" xsi:type="string">setFilterPremium</item>
<item name="colors_filter" xsi:type="string">setFilterColors</item>
</argument>
</arguments>
</type>