Skip to main content

Metadata Filter

Results of visually similar product recommendations could be filtered based on the product metadata. For information that can be used as a filter, refer to Product Metadata.

Metadata Filter Request

  • Set as a key-value style JSON object within metadataFilter field in the request body.
  • A condition consists of an operator and a value.
  • If two or more operators are included, it is recognized as an AND condition.

Example

"metadataFilter": {
"productName" : { "in" : ["skirt", "pants"] },
"originPrice" : {
"ge": 10,
"le" : 100,
},
"tag":{
"in" : "#산뜻한"
}
}

Operators

The available operators are as follows: there are restrictions on the types that can be used for each operator.

OperatorMeaningString TypeNumber TypeDate Type
eq=OOO
ne!=OOO
ge>=XOO
gt>XOO
le<=XOO
lt<XOO
inin (inclusive relationship)OOO
likesimilar relationshipOXX

eq (=)

Example: products that productName is skirt

query string (GET Method)

?metadataFilter.productName.eq=skirt

body (POST Method)

"metadataFilter": {
"productName" : { "eq" : "skirt" }
}

ne ( \neq)

Example: products that productName is not skirt

query string (GET Method)

?metadataFilter.productName.ne=skirt

body (POST Method)

"metadataFilter": {
"productName" : { "ne" : "skirt" }
}

ge (≥)

Example: Products that originPrice is greater or equal than 100

query string (GET Method)

?metadataFilter.originPrice.ge=100

body (POST Method)

"metadataFilter": {
"originPrice" : { "ge" : 100 }
}

gt (>)

Example: Products that originPrice is greater than 100

query string (GET Method)

?metadataFilter.originPrice.gt=100

body (POST Method)

"metadataFilter":{
"originPrice" : { "gt" : 100 }
}

le (≤)

Example: Products that originPrice is less or equal than 100

query string (GET Method)

?metadataFilter.originPrice.le=100

body (POST Method)

"metadataFilter": {
"originPrice" : { "le" : 100 }
}

lt (<)

Example: Products that originPrice is less than 100

query string (GET Method)

?metadataFilter.originPrice.lt=100

body (POST Method)

"metadataFilter": {
"originPrice" : { "lt" : 100 }
}

in

Example: Products that productName is skirt or pants

query string (GET Method)

?metadataFilter.productName.in=skirt&metadataFilter.productName.in=pants

body (POST Method)

"metadataFilter": {
"productName" : { "in" : ["skirt", "pants"] }
}

like

Example: Products that productName contains skirt

query string (GET Method)

?metadataFilter.productName.like=skirt

body (POST Method)

"metadataFilter": {
"productName" : { "like" : "skirt" }
}

More Complex Example

Example: Products that productName is skirt or pants, originPrice is 10 or more and 100 or less, and tag contains #fresh

query string

?metadataFilter.productName.in=skirt&metadataFilter.productName.in=pants&metadataFilter.originPrice.ge=10&metadataFilter.originPrice.le=100&metadataFilter.tag.in=#fresh

body

"metadataFilter": {
"productName" : { "in" : ["skirt", "pants"] },
"originPrice" : {
"ge": 10,
"le" : 100,
},
"tag":{
"in" : "#fresh"
}
}