Skip to content
46 changes: 46 additions & 0 deletions tests/CTS/requests/search/partialUpdateObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,51 @@
"visible_by": ["Angela", "group/Finance", "group/Shareholders" ]
}
}
},
{
"testName": "add men pant",
"parameters": {
"indexName": "theIndexName",
"objectID": "productId",
"attributesToUpdate": {
"categoryPageId": {
"_operation": "Add",
"value": "men-clothing-pants"
}
}
},
"request": {
"path": "/1/indexes/theIndexName/productId/partial",
"method": "POST",
"body": {
"categoryPageId": {
"_operation": "Add",
"value": "men-clothing-pants"
}
}
}
},
{
"testName": "remove men pant",
"parameters": {
"indexName": "theIndexName",
"objectID": "productId",
"attributesToUpdate": {
"categoryPageId": {
"_operation": "Remove",
"value": "men-clothing-pants"
}
}
},
"request": {
"path": "/1/indexes/theIndexName/productId/partial",
"method": "POST",
"body": {
"categoryPageId": {
"_operation": "Remove",
"value": "men-clothing-pants"
}
}
}
}
]
12 changes: 8 additions & 4 deletions tests/CTS/requests/search/saveObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
"parameters": {
"indexName": "<YOUR_INDEX_NAME>",
"body": {
"objectID": "id",
"test": "val"
"name": "Black T-shirt",
"color": "#000000||black",
"availableIn": "https://source.unsplash.com/100x100/?paris||Paris",
"objectID": "myID"
}
},
"request": {
"path": "/1/indexes/%3CYOUR_INDEX_NAME%3E",
"method": "POST",
"body": {
"objectID": "id",
"test": "val"
"name": "Black T-shirt",
"color": "#000000||black",
"availableIn": "https://source.unsplash.com/100x100/?paris||Paris",
"objectID": "myID"
}
}
}
Expand Down
105 changes: 69 additions & 36 deletions tests/CTS/requests/search/saveRule.json
Original file line number Diff line number Diff line change
Expand Up @@ -889,30 +889,30 @@
}
}
},
"request": {
"path": "/1/indexes/indexName/rules/diet-rule",
"method": "PUT",
"body": {
"objectID": "diet-rule",
"conditions": [{
"pattern": "diet",
"anchoring": "contains"
}],
"consequence": {
"params": {
"filters": "'low-carb' OR 'low-fat'",
"query": {
"edits": [
{
"type": "remove",
"delete": "diet"
}
]
}
"request": {
"path": "/1/indexes/indexName/rules/diet-rule",
"method": "PUT",
"body": {
"objectID": "diet-rule",
"conditions": [{
"pattern": "diet",
"anchoring": "contains"
}],
"consequence": {
"params": {
"filters": "'low-carb' OR 'low-fat'",
"query": {
"edits": [
{
"type": "remove",
"delete": "diet"
}
]
}
}
}
}
}
},
{
"testName": "conditionless",
Expand All @@ -936,25 +936,58 @@
}
}
},
"request": {
"path": "/1/indexes/indexName/rules/diet-rule",
"method": "PUT",
"body": {
"objectID": "diet-rule",
"consequence": {
"params": {
"filters": "'low-carb' OR 'low-fat'",
"query": {
"edits": [
{
"type": "remove",
"delete": "diet"
}
]
}
"request": {
"path": "/1/indexes/indexName/rules/diet-rule",
"method": "PUT",
"body": {
"objectID": "diet-rule",
"consequence": {
"params": {
"filters": "'low-carb' OR 'low-fat'",
"query": {
"edits": [
{
"type": "remove",
"delete": "diet"
}
]
}
}
}
}
}
},
{
"testName": "contextual",
"parameters": {
"indexName": "indexName",
"objectID": "a-rule-id",
"rule": {
"objectID": "a-rule-id",
"conditions": [{
"context": "mobile"
}],
"consequence": {
"params": {
"filters": "release_date >= 1577836800"
}
}
}
},
"request": {
"path": "/1/indexes/indexName/rules/a-rule-id",
"method": "PUT",
"body": {
"objectID": "a-rule-id",
"conditions": [{
"context": "mobile"
}],
"consequence": {
"params": {
"filters": "release_date >= 1577836800"
}
}
}
}
}
]
4 changes: 2 additions & 2 deletions tests/CTS/requests/search/searchForFacetValues.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
"indexName": "indexName",
"facetName": "author",
"searchForFacetValuesRequest": {
"facetQuery": "stephen king"
"facetQuery": "stephen"
}
},
"request": {
"path": "/1/indexes/indexName/facets/author/query",
"method": "POST",
"body": {
"facetQuery": "stephen king"
"facetQuery": "stephen"
}
}
}
Expand Down
46 changes: 44 additions & 2 deletions tests/CTS/requests/search/searchSingleIndex.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,24 @@
}
}
},
{
"testName": "filters for stores",
"parameters": {
"indexName": "indexName",
"searchParams": {
"query": "ben",
"filters": "categories:politics AND store:Gibert Joseph Saint-Michel"
}
},
"request": {
"path": "/1/indexes/indexName/query",
"method": "POST",
"body": {
"query": "ben",
"filters": "categories:politics AND store:Gibert Joseph Saint-Michel"
}
}
},
{
"testName": "filters boolean",
"parameters": {
Expand Down Expand Up @@ -279,14 +297,16 @@
"parameters": {
"indexName": "indexName",
"searchParams": {
"filters": "NOT _tags:non-fiction"
"query": "harry",
"filters": "_tags:non-fiction"
}
},
"request": {
"path": "/1/indexes/indexName/query",
"method": "POST",
"body": {
"filters": "NOT _tags:non-fiction"
"query": "harry",
"filters": "_tags:non-fiction"
}
}
},
Expand Down Expand Up @@ -1282,6 +1302,28 @@
}
}
},
{
"testName": "apply_negative_filters_restaurants",
"parameters": {
"indexName": "indexName",
"searchParams": {
"query": "query",
"optionalFilters": [
"restaurant:-Bert's Inn"
]
}
},
"request": {
"path": "/1/indexes/indexName/query",
"method": "POST",
"body": {
"query": "query",
"optionalFilters": [
"restaurant:-Bert's Inn"
]
}
}
},
{
"testName": "apply_numeric_filters",
"parameters": {
Expand Down
52 changes: 47 additions & 5 deletions tests/CTS/requests/search/setSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,28 @@
}
}
},
{
"testName": "attributesForFaceting availableIn",
"parameters": {
"indexName": "<YOUR_INDEX_NAME>",
"indexSettings": {
"attributesForFaceting": [
"color",
"availableIn"
]
}
},
"request": {
"path": "/1/indexes/%3CYOUR_INDEX_NAME%3E/settings",
"method": "PUT",
"body": {
"attributesForFaceting": [
"color",
"availableIn"
]
}
}
},
{
"testName": "api_attributes_for_faceting",
"parameters": {
Expand Down Expand Up @@ -697,7 +719,7 @@
}
},
{
"testName": "ranking exhaustive",
"testName": "ranking exhaustive (price)",
"parameters": {
"indexName": "theIndexName",
"indexSettings": {
Expand Down Expand Up @@ -732,6 +754,26 @@
}
}
},
{
"testName": "ranking exhaustive (is_popular)",
"parameters": {
"indexName": "theIndexName",
"indexSettings": {
"ranking": [
"desc(is_popular)", "typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"
]
}
},
"request": {
"path": "/1/indexes/theIndexName/settings",
"method": "PUT",
"body": {
"ranking": [
"desc(is_popular)", "typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"
]
}
}
},
{
"testName": "ranking standard replica",
"parameters": {
Expand Down Expand Up @@ -961,14 +1003,14 @@
"parameters": {
"indexName": "theIndexName",
"indexSettings": {
"maxFacetHits": 1000
"maxFacetHits": 100
}
},
"request": {
"path": "/1/indexes/theIndexName/settings",
"method": "PUT",
"body": {
"maxFacetHits": 1000
"maxFacetHits": 100
}
}
},
Expand Down Expand Up @@ -1064,7 +1106,7 @@
"searchableAttributes": [
"name",
"country",
"code",
"city",
"iata_code"
],
"customRanking": [
Expand All @@ -1079,7 +1121,7 @@
"searchableAttributes": [
"name",
"country",
"code",
"city",
"iata_code"
],
"customRanking": [
Expand Down