When you search for images in the Image Search service, you can set filter conditions to return only the image results that meet those conditions. For example, you can return only images where the ownerId is 1000 or the company name is alibaba.
Field settings
When you add an image, you can set eight fields: IntAttr, IntAttr2, IntAttr3, IntAttr4, StrAttr, StrAttr2, StrAttr3, and StrAttr4. These fields consist of four integer fields and four string fields. When you search for images, you can filter by these fields. The Image Search service supports multiple methods for adding images. The following examples show how to set filter conditions when you add images using different methods.
You can add images in batches. For more information, see Batch Operations.
{"OperationType": "ADD","ProductId": "1000","CategoryId": 0,"IntAttr": 123,"IntAttr2": 135,"StrAttr": "value1","StrAttr2": "value2","IntAttr3": 3,"StrAttr4": "value4","CustomContent": "k1:v1,k2:v2,k3:v3","PicName": "girl_cloth1.jpg"}You can add images using a software development kit (SDK). For more information, see Add interface.
You can add images in the console.
On the Add Image page in the console, set values for the IntAttr, IntAttr2, IntAttr3, IntAttr4, StrAttr, StrAttr2, StrAttr3, and StrAttr4 property parameters.
Field filtering
When you search, you can set filter conditions to filter the results. You can connect multiple conditions using AND or OR.
The int_attr, int_attr2, int_attr3, and int_attr4 fields support the following operators:
>
>=
<
<=
=
in
not in
The str_attr, str_attr2, str_attr3, and str_attr4 fields support the following operators:
=
!=
in
not in
Examples:
int_attr>=100
str_attr!="value1"
int_attr=1000 AND str_attr="value1"
intAttr = 1000 AND intAttr2 = 200 AND strAttr = "str2345" AND strAttr2="str9999"You can search using the API. For more information, see Request parameters.
Set the value of the filter parameter in the API to one of the conditions described above.
You can search using an SDK. For more information, see SearchImageByPic interface.
Call the setFilterClause method of the SearchItemRequest class to set the filter condition.
You can search in the console.
You can set the Filter condition based on the preceding examples.