diff --git a/tests/CTS/requests/search/partialUpdateObject.json b/tests/CTS/requests/search/partialUpdateObject.json index d52628d0766..b7b020b189f 100644 --- a/tests/CTS/requests/search/partialUpdateObject.json +++ b/tests/CTS/requests/search/partialUpdateObject.json @@ -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" + } + } + } } ] diff --git a/tests/CTS/requests/search/saveObject.json b/tests/CTS/requests/search/saveObject.json index 00df9b59721..f17046beeb7 100644 --- a/tests/CTS/requests/search/saveObject.json +++ b/tests/CTS/requests/search/saveObject.json @@ -3,16 +3,20 @@ "parameters": { "indexName": "", "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" } } } diff --git a/tests/CTS/requests/search/saveRule.json b/tests/CTS/requests/search/saveRule.json index c49a774a806..9cbd51e5b40 100644 --- a/tests/CTS/requests/search/saveRule.json +++ b/tests/CTS/requests/search/saveRule.json @@ -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", @@ -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" + } + } + } + } } ] diff --git a/tests/CTS/requests/search/searchForFacetValues.json b/tests/CTS/requests/search/searchForFacetValues.json index 64b65017fbc..57b33bf3e87 100644 --- a/tests/CTS/requests/search/searchForFacetValues.json +++ b/tests/CTS/requests/search/searchForFacetValues.json @@ -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" } } } diff --git a/tests/CTS/requests/search/searchSingleIndex.json b/tests/CTS/requests/search/searchSingleIndex.json index 29cda70b752..418b8296e08 100644 --- a/tests/CTS/requests/search/searchSingleIndex.json +++ b/tests/CTS/requests/search/searchSingleIndex.json @@ -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": { @@ -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" } } }, @@ -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": { diff --git a/tests/CTS/requests/search/setSettings.json b/tests/CTS/requests/search/setSettings.json index a5e05ff9981..f14b21c850d 100644 --- a/tests/CTS/requests/search/setSettings.json +++ b/tests/CTS/requests/search/setSettings.json @@ -280,6 +280,28 @@ } } }, + { + "testName": "attributesForFaceting availableIn", + "parameters": { + "indexName": "", + "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": { @@ -697,7 +719,7 @@ } }, { - "testName": "ranking exhaustive", + "testName": "ranking exhaustive (price)", "parameters": { "indexName": "theIndexName", "indexSettings": { @@ -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": { @@ -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 } } }, @@ -1064,7 +1106,7 @@ "searchableAttributes": [ "name", "country", - "code", + "city", "iata_code" ], "customRanking": [ @@ -1079,7 +1121,7 @@ "searchableAttributes": [ "name", "country", - "code", + "city", "iata_code" ], "customRanking": [