Skip to content

Commit 443f314

Browse files
algolia-botFluf22millotpshortcuts
committed
feat(clients): add manual snippets for search doc (#4388) (generated) [skip ci]
Co-authored-by: Thomas Raffray <[email protected]> Co-authored-by: Pierre Millot <[email protected]> Co-authored-by: shortcuts <[email protected]>
1 parent fd2353a commit 443f314

File tree

232 files changed

+5379
-805
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+5379
-805
lines changed

clients/algoliasearch-client-php/lib/Api/SearchClient.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2987,11 +2987,11 @@ public function replaceAllObjects($indexName, $objects, $batchSize = 1000, $scop
29872987
*
29882988
* @param string $indexName the `indexName` to replace `objects` in
29892989
* @param array $objects the array of `objects` to store in the given Algolia `indexName`
2990+
* @param bool $waitForTasks Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable
29902991
* @param array $batchSize The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
29912992
* @param array $requestOptions Request options
2992-
* @param bool $waitForTasks Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable
29932993
*/
2994-
public function saveObjects($indexName, $objects, $batchSize = 1000, $requestOptions = [], $waitForTasks = false)
2994+
public function saveObjects($indexName, $objects, $waitForTasks = false, $batchSize = 1000, $requestOptions = [])
29952995
{
29962996
return $this->chunkedBatch($indexName, $objects, 'addObject', $waitForTasks, $batchSize, $requestOptions);
29972997
}
@@ -3001,11 +3001,11 @@ public function saveObjects($indexName, $objects, $batchSize = 1000, $requestOpt
30013001
*
30023002
* @param string $indexName the `indexName` to delete `objectIDs` from
30033003
* @param array $objectIDs the `objectIDs` to delete
3004+
* @param bool $waitForTasks Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable
30043005
* @param array $batchSize The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
30053006
* @param array $requestOptions Request options
3006-
* @param bool $waitForTasks Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable
30073007
*/
3008-
public function deleteObjects($indexName, $objectIDs, $batchSize = 1000, $requestOptions = [], $waitForTasks = false)
3008+
public function deleteObjects($indexName, $objectIDs, $waitForTasks = false, $batchSize = 1000, $requestOptions = [])
30093009
{
30103010
$objects = [];
30113011

@@ -3022,11 +3022,11 @@ public function deleteObjects($indexName, $objectIDs, $batchSize = 1000, $reques
30223022
* @param string $indexName the `indexName` to replace `objects` in
30233023
* @param array $objects the array of `objects` to store in the given Algolia `indexName`
30243024
* @param bool $createIfNotExists To be provided if non-existing objects are passed, otherwise, the call will fail..
3025+
* @param bool $waitForTasks Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable
30253026
* @param array $batchSize The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
30263027
* @param array $requestOptions Request options
3027-
* @param bool $waitForTasks Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable
30283028
*/
3029-
public function partialUpdateObjects($indexName, $objects, $createIfNotExists, $batchSize = 1000, $requestOptions = [], $waitForTasks = false)
3029+
public function partialUpdateObjects($indexName, $objects, $createIfNotExists, $waitForTasks = false, $batchSize = 1000, $requestOptions = [])
30303030
{
30313031
return $this->chunkedBatch($indexName, $objects, (true == $createIfNotExists) ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate', $waitForTasks, $batchSize, $requestOptions);
30323032
}

docs/bundled/abtesting-snippets.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,15 +427,15 @@
427427
"customGet": {
428428
"allow get method for a custom path with minimal parameters": "response = client.custom_get(\"test/minimal\")",
429429
"allow get method for a custom path with all parameters": "response = client.custom_get(\"test/all\", {query: \"parameters with space\"})",
430-
"requestOptions should be escaped too": "response = client.custom_get(\n \"test/all\",\n {query: \"to be overriden\"},\n {\n :header_params => JSON.parse(\"{\\\"x-header-1\\\":\\\"spaces are left alone\\\"}\", :symbolize_names => true),\n :query_params => JSON.parse(\n \"{\\\"query\\\":\\\"parameters with space\\\",\\\"and an array\\\":[\\\"array\\\",\\\"with spaces\\\"]}\",\n :symbolize_names => true\n )\n }\n)"
430+
"requestOptions should be escaped too": "response = client.custom_get(\n \"test/all\",\n {query: \"to be overriden\"},\n {\n :header_params => {\"x-header-1\" => \"spaces are left alone\"},\n :query_params => JSON.parse(\n \"{\\\"query\\\":\\\"parameters with space\\\",\\\"and an array\\\":[\\\"array\\\",\\\"with spaces\\\"]}\",\n :symbolize_names => true\n )\n }\n)"
431431
},
432432
"customPost": {
433433
"allow post method for a custom path with minimal parameters": "response = client.custom_post(\"test/minimal\")",
434434
"allow post method for a custom path with all parameters": "response = client.custom_post(\"test/all\", {query: \"parameters\"}, {body: \"parameters\"})",
435435
"requestOptions can override default query parameters": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"query\\\":\\\"myQueryParameter\\\"}\", :symbolize_names => true)}\n)",
436436
"requestOptions merges query parameters with default ones": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"query2\\\":\\\"myQueryParameter\\\"}\", :symbolize_names => true)}\n)",
437-
"requestOptions can override default headers": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => JSON.parse(\"{\\\"x-algolia-api-key\\\":\\\"ALGOLIA_API_KEY\\\"}\", :symbolize_names => true)}\n)",
438-
"requestOptions merges headers with default ones": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => JSON.parse(\"{\\\"x-algolia-api-key\\\":\\\"ALGOLIA_API_KEY\\\"}\", :symbolize_names => true)}\n)",
437+
"requestOptions can override default headers": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => {\"x-algolia-api-key\" => \"ALGOLIA_API_KEY\"}}\n)",
438+
"requestOptions merges headers with default ones": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => {\"x-algolia-api-key\" => \"ALGOLIA_API_KEY\"}}\n)",
439439
"requestOptions queryParameters accepts booleans": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"isItWorking\\\":true}\", :symbolize_names => true)}\n)",
440440
"requestOptions queryParameters accepts integers": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"myParam\\\":2}\", :symbolize_names => true)}\n)",
441441
"requestOptions queryParameters accepts list of string": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"myParam\\\":[\\\"b and c\\\",\\\"d\\\"]}\", :symbolize_names => true)}\n)",

docs/bundled/analytics-snippets.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,15 +837,15 @@
837837
"customGet": {
838838
"allow get method for a custom path with minimal parameters": "response = client.custom_get(\"test/minimal\")",
839839
"allow get method for a custom path with all parameters": "response = client.custom_get(\"test/all\", {query: \"parameters with space\"})",
840-
"requestOptions should be escaped too": "response = client.custom_get(\n \"test/all\",\n {query: \"to be overriden\"},\n {\n :header_params => JSON.parse(\"{\\\"x-header-1\\\":\\\"spaces are left alone\\\"}\", :symbolize_names => true),\n :query_params => JSON.parse(\n \"{\\\"query\\\":\\\"parameters with space\\\",\\\"and an array\\\":[\\\"array\\\",\\\"with spaces\\\"]}\",\n :symbolize_names => true\n )\n }\n)"
840+
"requestOptions should be escaped too": "response = client.custom_get(\n \"test/all\",\n {query: \"to be overriden\"},\n {\n :header_params => {\"x-header-1\" => \"spaces are left alone\"},\n :query_params => JSON.parse(\n \"{\\\"query\\\":\\\"parameters with space\\\",\\\"and an array\\\":[\\\"array\\\",\\\"with spaces\\\"]}\",\n :symbolize_names => true\n )\n }\n)"
841841
},
842842
"customPost": {
843843
"allow post method for a custom path with minimal parameters": "response = client.custom_post(\"test/minimal\")",
844844
"allow post method for a custom path with all parameters": "response = client.custom_post(\"test/all\", {query: \"parameters\"}, {body: \"parameters\"})",
845845
"requestOptions can override default query parameters": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"query\\\":\\\"myQueryParameter\\\"}\", :symbolize_names => true)}\n)",
846846
"requestOptions merges query parameters with default ones": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"query2\\\":\\\"myQueryParameter\\\"}\", :symbolize_names => true)}\n)",
847-
"requestOptions can override default headers": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => JSON.parse(\"{\\\"x-algolia-api-key\\\":\\\"ALGOLIA_API_KEY\\\"}\", :symbolize_names => true)}\n)",
848-
"requestOptions merges headers with default ones": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => JSON.parse(\"{\\\"x-algolia-api-key\\\":\\\"ALGOLIA_API_KEY\\\"}\", :symbolize_names => true)}\n)",
847+
"requestOptions can override default headers": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => {\"x-algolia-api-key\" => \"ALGOLIA_API_KEY\"}}\n)",
848+
"requestOptions merges headers with default ones": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => {\"x-algolia-api-key\" => \"ALGOLIA_API_KEY\"}}\n)",
849849
"requestOptions queryParameters accepts booleans": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"isItWorking\\\":true}\", :symbolize_names => true)}\n)",
850850
"requestOptions queryParameters accepts integers": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"myParam\\\":2}\", :symbolize_names => true)}\n)",
851851
"requestOptions queryParameters accepts list of string": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"myParam\\\":[\\\"b and c\\\",\\\"d\\\"]}\", :symbolize_names => true)}\n)",

docs/bundled/ingestion-snippets.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,15 +1493,15 @@
14931493
"customGet": {
14941494
"allow get method for a custom path with minimal parameters": "response = client.custom_get(\"test/minimal\")",
14951495
"allow get method for a custom path with all parameters": "response = client.custom_get(\"test/all\", {query: \"parameters with space\"})",
1496-
"requestOptions should be escaped too": "response = client.custom_get(\n \"test/all\",\n {query: \"to be overriden\"},\n {\n :header_params => JSON.parse(\"{\\\"x-header-1\\\":\\\"spaces are left alone\\\"}\", :symbolize_names => true),\n :query_params => JSON.parse(\n \"{\\\"query\\\":\\\"parameters with space\\\",\\\"and an array\\\":[\\\"array\\\",\\\"with spaces\\\"]}\",\n :symbolize_names => true\n )\n }\n)"
1496+
"requestOptions should be escaped too": "response = client.custom_get(\n \"test/all\",\n {query: \"to be overriden\"},\n {\n :header_params => {\"x-header-1\" => \"spaces are left alone\"},\n :query_params => JSON.parse(\n \"{\\\"query\\\":\\\"parameters with space\\\",\\\"and an array\\\":[\\\"array\\\",\\\"with spaces\\\"]}\",\n :symbolize_names => true\n )\n }\n)"
14971497
},
14981498
"customPost": {
14991499
"allow post method for a custom path with minimal parameters": "response = client.custom_post(\"test/minimal\")",
15001500
"allow post method for a custom path with all parameters": "response = client.custom_post(\"test/all\", {query: \"parameters\"}, {body: \"parameters\"})",
15011501
"requestOptions can override default query parameters": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"query\\\":\\\"myQueryParameter\\\"}\", :symbolize_names => true)}\n)",
15021502
"requestOptions merges query parameters with default ones": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"query2\\\":\\\"myQueryParameter\\\"}\", :symbolize_names => true)}\n)",
1503-
"requestOptions can override default headers": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => JSON.parse(\"{\\\"x-algolia-api-key\\\":\\\"ALGOLIA_API_KEY\\\"}\", :symbolize_names => true)}\n)",
1504-
"requestOptions merges headers with default ones": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => JSON.parse(\"{\\\"x-algolia-api-key\\\":\\\"ALGOLIA_API_KEY\\\"}\", :symbolize_names => true)}\n)",
1503+
"requestOptions can override default headers": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => {\"x-algolia-api-key\" => \"ALGOLIA_API_KEY\"}}\n)",
1504+
"requestOptions merges headers with default ones": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:header_params => {\"x-algolia-api-key\" => \"ALGOLIA_API_KEY\"}}\n)",
15051505
"requestOptions queryParameters accepts booleans": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"isItWorking\\\":true}\", :symbolize_names => true)}\n)",
15061506
"requestOptions queryParameters accepts integers": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"myParam\\\":2}\", :symbolize_names => true)}\n)",
15071507
"requestOptions queryParameters accepts list of string": "response = client.custom_post(\n \"test/requestOptions\",\n {query: \"parameters\"},\n {facet: \"filters\"},\n {:query_params => JSON.parse(\"{\\\"myParam\\\":[\\\"b and c\\\",\\\"d\\\"]}\", :symbolize_names => true)}\n)",

0 commit comments

Comments
 (0)