openapi: 3.0.2 info: title: Search API summary: >- The Algolia Search API lets you search, configure, and manage your indices and records description: > ## Client libraries Use Algolia's API clients and libraries to reliably integrate Algolia's APIs with your apps. The official API clients are covered by Algolia's [Service Level Agreement](https://www.algolia.com/policies/sla). For more information, see [Algolia's ecosystem](https://www.algolia.com/doc/libraries). ## Base URLs Base URLs for the Search API: - `https://{APPLICATION_ID}.algolia.net` - `https://{APPLICATION_ID}-dsn.algolia.net`. If your subscription includes a [Distributed Search Network](https://dashboard.algolia.com/infra), this ensures that requests are sent to servers closest to users. Both URLs provide high availability by distributing requests with load balancing. **All requests must use HTTPS.** ## Retry strategy To guarantee high availability, implement a retry strategy for all API requests using the URLs of your servers as fallbacks: - `https://{APPLICATION_ID}-1.algolianet.com` - `https://{APPLICATION_ID}-2.algolianet.com` - `https://{APPLICATION_ID}-3.algolianet.com` These URLs use a different DNS provider than the primary URLs. Randomize this list to ensure an even load across the three servers. All Algolia API clients implement this retry strategy. ## Authentication Add these headers to authenticate requests: - `x-algolia-application-id`. Your Algolia application ID. - `x-algolia-api-key`. An API key with the necessary permissions to make the request. The required access control list (ACL) to make a request is listed in each endpoint's reference. You can find your application ID and API key in the [Algolia dashboard](https://dashboard.algolia.com/account/api-keys). ## Request format Depending on the endpoint, request bodies are either JSON objects or arrays of JSON objects. ## Parameters Parameters are passed as query parameters for GET and DELETE requests, and in the request body for POST and PUT requests. Query parameters must be [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). Non-ASCII characters must be UTF-8 encoded. Plus characters (`+`) are interpreted as spaces. Arrays as query parameters must be one of: - A comma-separated string: `attributesToRetrieve=title,description` - A URL-encoded JSON array: `attributesToRetrieve=%5B%22title%22,%22description%22%D` ## Response status and errors The Search API returns JSON responses. Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API response. Successful responses return `2xx` statuses. Client errors return `4xx` statuses. Server errors return `5xx` statuses. Error responses have a `message` property with more information. ## Request identifiers Every response includes a `Correlation-ID` header that identifies the request in Algolia's logs. When contacting the Algolia support team about a specific request, include this identifier in your ticket. To tag requests with your own identifier, send a `Request-ID` header with exactly 11 alphanumeric characters. Clusters that support it embed the identifier at the end of the `Correlation-ID`, so all attempts of a retried operation can be found by searching for those characters. Headers that don't match the expected format are ignored. Don't use the `Correlation-ID` as a unique key: retried requests may receive the same identifier. ## Version The current version of the Search API is version 1, indicated by the `/1/` in each endpoint's URL. version: 1.0.0 servers: - url: https://{appId}.algolia.net variables: appId: default: ALGOLIA_APPLICATION_ID - url: https://{appId}-1.algolianet.com variables: appId: default: ALGOLIA_APPLICATION_ID - url: https://{appId}-2.algolianet.com variables: appId: default: ALGOLIA_APPLICATION_ID - url: https://{appId}-3.algolianet.com variables: appId: default: ALGOLIA_APPLICATION_ID - url: https://{appId}-dsn.algolia.net variables: appId: default: ALGOLIA_APPLICATION_ID security: - appId: [] apiKey: [] tags: - name: Advanced description: Query your logs. - name: Api Keys x-displayName: API keys description: > Manage your API keys. API requests must be authenticated with an API key. API keys can have permissions (access control lists, ACL) and restrictions. externalDocs: url: https://www.algolia.com/doc/guides/security/api-keys description: API keys. - name: Clusters description: | Multi-cluster operations. Multi-cluster operations are **deprecated**. If you have issues with your Algolia infrastructure due to large volumes of data, contact the Algolia support team. - name: Dictionaries description: > Manage your dictionaries. Customize language-specific settings, such as stop words, plurals, or word segmentation. Dictionaries are application-wide. externalDocs: url: >- https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp description: Natural languages. - name: Indices description: > Manage your indices and index settings. Indices are copies of your data that are stored on Algolia's servers. They're optimal data structures for fast search and are made up of records and settings. externalDocs: url: >- https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices description: Manage your indices. - name: Records description: > Add, update, and delete records from your indices. Records are individual items in your index. When they match a search query, they're returned as search results, in the order determined by your ranking. Records are schemaless JSON objects. When adding or updating many records, check the [indexing rate limits](https://support.algolia.com/hc/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia). externalDocs: url: >- https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data description: Prepare your records. - name: Rules description: > Create, update, delete, and search for rules. Rules are _if-then_ statements that you can use to curate search results. Rules have _conditions_ that can trigger _consequences_. Consequences are changes to the search results, such as changing the order of search results or boosting a facet. This can be useful for tuning specific queries or for merchandising. externalDocs: url: https://www.algolia.com/doc/guides/managing-results/rules/rules-overview description: Index Rules. - name: Search description: Search one or more indices for matching records or facet values. - name: Synonyms description: | Create, update, delete, and search for synonyms. Synonyms are terms that the search engine should consider equal. externalDocs: url: >- https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms description: Synonyms. - name: Vaults description: >- Algolia Vault lets you restrict access to your clusters to specific IP addresses and provides disk-level encryption at rest. externalDocs: url: https://www.algolia.com/doc/guides/security/algolia-vault description: Algolia Vault. - name: _model_index_settings x-displayName: Index settings description: | . paths: /{path}: get: operationId: customGet summary: Send requests to the Algolia REST API description: This method lets you send requests to the Algolia REST API. parameters: - $ref: '#/components/parameters/PathInPath' - $ref: '#/components/parameters/Parameters' responses: '200': description: OK content: application/json: schema: type: object '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.CustomGetAsync("test/minimal"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.customGet( path: "test/minimal", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.CustomGet(client.NewApiCustomGetRequest( "test/minimal")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API Object response = client.customGet("test/minimal"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.customGet({ path: 'test/minimal' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.customGet(path = "test/minimal") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->customGet( 'test/minimal', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.custom_get( path="test/minimal", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.custom_get("test/minimal") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.customGet[JObject]( path = "test/minimal" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.customGet(path: "test/minimal") // print the response print(response) post: operationId: customPost requestBody: description: Parameters to send with the custom request. content: application/json: schema: type: object summary: Send requests to the Algolia REST API description: This method lets you send requests to the Algolia REST API. parameters: - $ref: '#/components/parameters/PathInPath' - $ref: '#/components/parameters/Parameters' responses: '200': description: OK content: application/json: schema: type: object '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.CustomPostAsync("test/minimal"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.customPost( path: "test/minimal", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.CustomPost(client.NewApiCustomPostRequest( "test/minimal")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API Object response = client.customPost("test/minimal"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.customPost({ path: 'test/minimal' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.customPost(path = "test/minimal") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->customPost( 'test/minimal', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.custom_post( path="test/minimal", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.custom_post("test/minimal") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.customPost[JObject]( path = "test/minimal" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.customPost(path: "test/minimal") // print the response print(response) put: operationId: customPut requestBody: description: Parameters to send with the custom request. content: application/json: schema: type: object summary: Send requests to the Algolia REST API description: This method lets you send requests to the Algolia REST API. parameters: - $ref: '#/components/parameters/PathInPath' - $ref: '#/components/parameters/Parameters' responses: '200': description: OK content: application/json: schema: type: object '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.CustomPutAsync("test/minimal"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.customPut( path: "test/minimal", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.CustomPut(client.NewApiCustomPutRequest( "test/minimal")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API Object response = client.customPut("test/minimal"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.customPut({ path: 'test/minimal' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.customPut(path = "test/minimal") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->customPut( 'test/minimal', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.custom_put( path="test/minimal", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.custom_put("test/minimal") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.customPut[JObject]( path = "test/minimal" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.customPut(path: "test/minimal") // print the response print(response) delete: operationId: customDelete summary: Send requests to the Algolia REST API description: This method lets you send requests to the Algolia REST API. parameters: - $ref: '#/components/parameters/PathInPath' - $ref: '#/components/parameters/Parameters' responses: '200': description: OK content: application/json: schema: type: object '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.CustomDeleteAsync("test/minimal"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.customDelete( path: "test/minimal", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.CustomDelete(client.NewApiCustomDeleteRequest( "test/minimal")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API Object response = client.customDelete("test/minimal"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.customDelete({ path: 'test/minimal' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.customDelete(path = "test/minimal") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->customDelete( 'test/minimal', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.custom_delete( path="test/minimal", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.custom_delete("test/minimal") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.customDelete[JObject]( path = "test/minimal" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.customDelete(path: "test/minimal") // print the response print(response) /1/indexes/{indexName}/query: post: tags: - Search operationId: searchSingleIndex x-mcp-tool: true x-use-read-transporter: true x-cacheable: true x-acl: - search summary: Search an index description: > Searches a single index and returns matching search results as hits. This method lets you retrieve up to 1,000 hits. If you need more, use the [`browse` operation](https://www.algolia.com/doc/rest-api/search/browse) or increase the `paginatedLimitedTo` index setting. parameters: - $ref: '#/components/parameters/IndexName' requestBody: content: application/json: schema: $ref: '#/components/schemas/searchParams' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/searchResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SearchSingleIndexAsync(""); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.searchSingleIndex( indexName: "", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SearchSingleIndex(client.NewApiSearchSingleIndexRequest( "")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API SearchResponse response = client.searchSingleIndex("", Hit.class); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.searchSingleIndex({ indexName: 'indexName' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.searchSingleIndex(indexName = "") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->searchSingleIndex( '', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_single_index( index_name="", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_single_index("") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.searchSingleIndex( indexName = "" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response: SearchResponse = try await client.searchSingleIndex(indexName: "") // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/query \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "params": "hitsPerPage=2&getRankingInfo=1" } ' /1/indexes/*/queries: post: tags: - Search operationId: search x-use-read-transporter: true x-cacheable: true x-legacy-signature: true x-acl: - search summary: Search multiple queries description: > Runs multiple search queries against one or more indices in a single API request. Use cases include: - Searching different indices, such as products and marketing content. - Run multiple queries on the same index with different parameters or filters. If you know the expected result type, use the `searchForHits` or `searchForFacets` helper to simplify the response format. requestBody: required: true description: >- Multi-query search request body. Results are returned in the same order as the requests. content: application/json: schema: title: searchMethodParams type: object additionalProperties: false properties: requests: type: array items: $ref: '#/components/schemas/SearchQuery' strategy: $ref: '#/components/schemas/searchStrategy' required: - requests responses: '200': description: OK content: application/json: schema: title: searchResponses type: object additionalProperties: false properties: results: type: array items: $ref: '#/components/schemas/searchResult' required: - results '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SearchAsync( new SearchMethodParams { Requests = new List { new SearchQuery(new SearchForHits { IndexName = "" }), new SearchQuery( new SearchForFacets { IndexName = "", Type = Enum.Parse("Facet"), Facet = "theFacet", } ), new SearchQuery( new SearchForHits { IndexName = "", Type = Enum.Parse("Default"), } ), }, Strategy = Enum.Parse("StopIfEnoughMatches"), } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.search( searchMethodParams: SearchMethodParams( requests: [ SearchForHits( indexName: "", ), SearchForFacets( indexName: "", type: SearchTypeFacet.fromJson("facet"), facet: "theFacet", ), SearchForHits( indexName: "", type: SearchTypeDefault.fromJson("default"), ), ], strategy: SearchStrategy.fromJson("stopIfEnoughMatches"), ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.Search(client.NewApiSearchRequest( search.NewEmptySearchMethodParams().SetRequests( []search.SearchQuery{*search.SearchForHitsAsSearchQuery( search.NewEmptySearchForHits().SetIndexName("")), *search.SearchForFacetsAsSearchQuery( search.NewEmptySearchForFacets().SetIndexName("").SetType(search.SearchTypeFacet("facet")).SetFacet("theFacet")), *search.SearchForHitsAsSearchQuery( search.NewEmptySearchForHits().SetIndexName("").SetType(search.SearchTypeDefault("default")))}).SetStrategy(search.SearchStrategy("stopIfEnoughMatches")))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API SearchResponses response = client.search( new SearchMethodParams().setRequests( Arrays.asList(new SearchForHits().setIndexName("").setQuery("").setHitsPerPage(50)) ), Hit.class ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.search({ requests: [ { indexName: 'theIndexName' }, { indexName: 'theIndexName2', type: 'facet', facet: 'theFacet' }, { indexName: 'theIndexName', type: 'default' }, ], strategy: 'stopIfEnoughMatches', }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.search( searchMethodParams = SearchMethodParams( requests = listOf( SearchForHits( indexName = "", query = "", hitsPerPage = 50, ) ) ) ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->search( ['requests' => [ ['indexName' => '', ], ['indexName' => '', 'type' => 'facet', 'facet' => 'theFacet', ], ['indexName' => '', 'type' => 'default', ], ], 'strategy' => 'stopIfEnoughMatches', ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search( search_method_params={ "requests": [ { "indexName": "", }, { "indexName": "", "type": "facet", "facet": "theFacet", }, { "indexName": "", "type": "default", }, ], "strategy": "stopIfEnoughMatches", }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search( Algolia::Search::SearchMethodParams.new( requests: [ Algolia::Search::SearchForHits.new(index_name: ""), Algolia::Search::SearchForFacets.new(index_name: "", type: "facet", facet: "theFacet"), Algolia::Search::SearchForHits.new(index_name: "", type: "default") ], strategy: "stopIfEnoughMatches" ) ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.search( searchMethodParams = SearchMethodParams( requests = Seq( SearchForHits( indexName = "" ), SearchForFacets( indexName = "", `type` = SearchTypeFacet.withName("facet"), facet = "theFacet" ), SearchForHits( indexName = "", `type` = Some(SearchTypeDefault.withName("default")) ) ), strategy = Some(SearchStrategy.withName("stopIfEnoughMatches")) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response: SearchResponses = try await client.search(searchMethodParams: SearchMethodParams( requests: [ SearchQuery.searchForHits(SearchForHits(indexName: "")), SearchQuery.searchForFacets(SearchForFacets( facet: "theFacet", indexName: "", type: SearchTypeFacet.facet )), SearchQuery.searchForHits(SearchForHits( indexName: "", type: SearchTypeDefault.`default` )), ], strategy: SearchStrategy.stopIfEnoughMatches )) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url 'https://algolia_application_id.algolia.net/1/indexes/*/queries' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "requests": [ { "params": "hitsPerPage=2&getRankingInfo=1", "indexName": "products", "type": "default", "extensions": { "queryCategorization": { "enableCategoriesRetrieval": false, "enableAutoFiltering": false } } } ], "strategy": "none" } ' /1/indexes/{indexName}/facets/{facetName}/query: post: tags: - Search operationId: searchForFacetValues x-use-read-transporter: true x-cacheable: true x-acl: - search summary: Search for facet values description: > Searches for values of a specified facet attribute. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn't work if you have **more than 65 searchable facets and searchable attributes combined**. parameters: - name: facetName description: > Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier. in: path required: true schema: type: string - $ref: '#/components/parameters/IndexName' requestBody: content: application/json: schema: title: searchForFacetValuesRequest type: object additionalProperties: false properties: facetQuery: $ref: '#/components/schemas/facetQuery' maxFacetHits: $ref: '#/components/schemas/maxFacetHits' params: $ref: '#/components/schemas/paramsAsString' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/searchForFacetValuesResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SearchForFacetValuesAsync("", "facetName"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.searchForFacetValues( indexName: "", facetName: "facetName", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SearchForFacetValues(client.NewApiSearchForFacetValuesRequest( "", "facetName")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API SearchForFacetValuesResponse response = client.searchForFacetValues("", "facetName"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.searchForFacetValues({ indexName: 'indexName', facetName: 'facetName' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.searchForFacetValues(indexName = "", facetName = "facetName") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->searchForFacetValues( '', 'facetName', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_for_facet_values( index_name="", facet_name="facetName", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_for_facet_values("", "facetName") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.searchForFacetValues( indexName = "", facetName = "facetName" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.searchForFacetValues(indexName: "", facetName: "facetName") // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/facets/lorem/query \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "params": "hitsPerPage=2&getRankingInfo=1", "facetQuery": "george", "maxFacetHits": 10 } ' /1/indexes/{indexName}/browse: post: tags: - Search operationId: browse x-use-read-transporter: true x-acl: - browse summary: Browse for records description: > Retrieves records from an index, up to 1,000 per request. Searching returns _hits_ (records augmented with highlighting and ranking details). Browsing returns matching records only. Use browse to export your indices. - The Analytics API doesn't collect data when using `browse`. - Records are ranked by attributes and custom ranking. - There's no ranking for typo tolerance, number of matched words, proximity, or geo distance. Browse requests automatically apply these settings: - `advancedSyntax`: `false` - `attributesToHighlight`: `[]` - `attributesToSnippet`: `[]` - `distinct`: `false` - `enablePersonalization`: `false` - `enableRules`: `false` - `facets`: `[]` - `getRankingInfo`: `false` - `ignorePlurals`: `false` - `optionalFilters`: `[]` - `typoTolerance`: `true` or `false` (`min` and `strict` evaluate to `true`) If you send these parameters with your browse requests, they're ignored. parameters: - $ref: '#/components/parameters/IndexName' requestBody: content: application/json: schema: $ref: '#/components/schemas/browseParams' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/browseResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.BrowseAsync(""); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.browse( indexName: "", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.Browse(client.NewApiBrowseRequest( "")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API BrowseResponse response = client.browse("", Hit.class); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.browse({ indexName: 'cts_e2e_browse' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.browse(indexName = "") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->browse( '', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.browse( index_name="", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.browse("") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.browse( indexName = "" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response: BrowseResponse = try await client.browse(indexName: "") // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/browse \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "query": "", "similarQuery": "comedy drama crime Macy Buscemi", "filters": "(category:Book OR category:Ebook) AND _tags:published", "facetFilters": [ [ "category:Book", "category:-Movie" ], "author:John Doe" ], "optionalFilters": [ "category:Book", "author:John Doe" ], "numericFilters": [ [ "inStock = 1", "deliveryDate < 1441755506" ], "price < 1000" ], "tagFilters": [ [ "Book", "Movie" ], "SciFi" ], "sumOrFiltersScores": false, "restrictSearchableAttributes": [ "title", "author" ], "facets": [ "*" ], "facetingAfterDistinct": false, "page": 0, "offset": 42, "length": 0, "aroundLatLng": "40.71,-74.01", "aroundLatLngViaIP": false, "aroundRadius": 1, "aroundPrecision": 10, "minimumAroundRadius": 1, "insideBoundingBox": "lorem", "insidePolygon": [ [ 47.3165, 4.9665, 47.3424, 5.0201, 47.32, 4.9 ], [ 40.9234, 2.1185, 38.643, 1.9916, 39.2587, 2.0104 ] ], "naturalLanguages": [], "ruleContexts": [ "mobile" ], "personalizationImpact": 100, "userToken": "test-user-123", "getRankingInfo": false, "synonyms": true, "clickAnalytics": false, "analytics": true, "analyticsTags": [], "percentileComputation": true, "enableABTest": true, "attributesToRetrieve": [ "author", "title", "content" ], "ranking": [ "typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom" ], "relevancyStrictness": 90, "attributesToHighlight": [ "author", "title", "conten", "content" ], "attributesToSnippet": [ "content:80", "description" ], "highlightPreTag": "", "highlightPostTag": "", "snippetEllipsisText": "…", "restrictHighlightAndSnippetArrays": false, "hitsPerPage": 20, "minWordSizefor1Typo": 4, "minWordSizefor2Typos": 8, "typoTolerance": true, "allowTyposOnNumericTokens": true, "disableTypoToleranceOnAttributes": [ "sku" ], "ignorePlurals": [ "ca", "es" ], "removeStopWords": [ "ca", "es" ], "queryLanguages": [ "es" ], "decompoundQuery": true, "enableRules": true, "enablePersonalization": false, "queryType": "prefixLast", "removeWordsIfNoResults": "firstWords", "mode": "keywordSearch", "semanticSearch": { "eventSources": [ "lorem" ] }, "advancedSyntax": false, "optionalWords": "lorem", "disableExactOnAttributes": [ "description" ], "exactOnSingleWordQuery": "attribute", "alternativesAsExact": [ "ignorePlurals", "singleWordSynonym" ], "advancedSyntaxFeatures": [ "exactPhrase", "excludeWords" ], "distinct": 1, "replaceSynonymsInHighlight": false, "minProximity": 1, "responseFields": [ "*" ], "maxValuesPerFacet": 100, "sortFacetValuesBy": "count", "attributeCriteriaComputedByMinProximity": false, "renderingContent": { "facetOrdering": { "facets": { "order": [ "lorem" ] }, "values": { "property1": { "order": [ "lorem" ], "sortRemainingBy": "count", "hide": [ "lorem" ] }, "property2": { "order": [ "lorem" ], "sortRemainingBy": "count", "hide": [ "lorem" ] } } }, "redirect": { "url": "lorem" }, "widgets": { "banners": [ { "image": { "urls": [ { "url": "lorem" } ], "title": "lorem" }, "link": { "url": "lorem" } } ] } }, "enableReRanking": true, "reRankingApplyFilter": [ [] ], "cursor": "jMDY3M2MwM2QwMWUxMmQwYWI0ZTN" } ' /1/indexes/{indexName}: post: tags: - Records operationId: saveObject x-mcp-tool: true x-acl: - addObject description: > Adds a record to an index or replaces it. - If the record doesn't have an object ID, a new record with an auto-generated object ID is added to your index. - If a record with the specified object ID exists, the existing record is replaced. - If a record with the specified object ID doesn't exist, a new record is added to your index. - If you add a record to an index that doesn't exist yet, a new index is created. To update _some_ attributes of a record, use the [`partial` operation](https://www.algolia.com/doc/rest-api/search/partial-update-object). To add, update, or replace multiple records, use the [`batch` operation](https://www.algolia.com/doc/rest-api/search/batch). This operation is subject to [indexing rate limits](https://support.algolia.com/hc/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia). summary: Add a new record (with auto-generated object ID) parameters: - $ref: '#/components/parameters/IndexName' requestBody: required: true description: >- The record. A schemaless object with attributes that are useful in the context of search and discovery. x-is-generic: true content: application/json: schema: type: object example: objectID: blackTShirt name: Black T-shirt color: '#000000' responses: '201': description: Created content: application/json: schema: title: saveObjectResponse type: object additionalProperties: false properties: createdAt: $ref: '#/components/schemas/createdAt' taskID: $ref: '#/components/schemas/taskID' objectID: $ref: '#/components/schemas/objectID' required: - taskID - createdAt '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SaveObjectAsync( "", new Dictionary { { "name", "Black T-shirt" }, { "color", "#000000||black" }, { "availableIn", "https://source.unsplash.com/100x100/?paris||Paris" }, { "objectID", "myID" }, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.saveObject( indexName: "", body: { 'name': "Black T-shirt", 'color': "#000000||black", 'availableIn': "https://source.unsplash.com/100x100/?paris||Paris", 'objectID': "myID", }, ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SaveObject(client.NewApiSaveObjectRequest( "", map[string]any{ "name": "Black T-shirt", "color": "#000000||black", "availableIn": "https://source.unsplash.com/100x100/?paris||Paris", "objectID": "myID", }, )) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API SaveObjectResponse response = client.saveObject( "", new HashMap() { { put("name", "Black T-shirt"); put("color", "#000000||black"); put("availableIn", "https://source.unsplash.com/100x100/?paris||Paris"); put("objectID", "myID"); } } ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.saveObject({ indexName: '', body: { name: 'Black T-shirt', color: '#000000||black', availableIn: 'https://source.unsplash.com/100x100/?paris||Paris', objectID: 'myID', }, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.saveObject( indexName = "", body = buildJsonObject { put("name", JsonPrimitive("Black T-shirt")) put("color", JsonPrimitive("#000000||black")) put("availableIn", JsonPrimitive("https://source.unsplash.com/100x100/?paris||Paris")) put("objectID", JsonPrimitive("myID")) }, ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->saveObject( '', ['name' => 'Black T-shirt', 'color' => '#000000||black', 'availableIn' => 'https://source.unsplash.com/100x100/?paris||Paris', 'objectID' => 'myID', ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.save_object( index_name="", body={ "name": "Black T-shirt", "color": "#000000||black", "availableIn": "https://source.unsplash.com/100x100/?paris||Paris", "objectID": "myID", }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.save_object( "", { name: "Black T-shirt", color: "#000000||black", availableIn: "https://source.unsplash.com/100x100/?paris||Paris", objectID: "myID" } ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.saveObject( indexName = "", body = JObject( List( JField("name", JString("Black T-shirt")), JField("color", JString("#000000||black")), JField("availableIn", JString("https://source.unsplash.com/100x100/?paris||Paris")), JField("objectID", JString("myID")) ) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.saveObject( indexName: "", body: [ "name": "Black T-shirt", "color": "#000000||black", "availableIn": "https://source.unsplash.com/100x100/?paris||Paris", "objectID": "myID", ] ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "objectID": "blackTShirt", "name": "Black T-shirt", "color": "#000000" } ' delete: tags: - Indices operationId: deleteIndex x-acl: - deleteIndex summary: Delete an index description: > Deletes an index and all its settings. - Deleting an index doesn't delete its analytics data. - If you try to delete a non-existing index, the operation is ignored without warning. - If the index you want to delete has replica indices, the replicas become independent indices. - If the index you want to delete is a replica index, you must first unlink it from its primary index before you can delete it. For more information, see [Delete replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/deleting-replicas). externalDocs: url: >- https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/delete-indices description: Delete indices. parameters: - $ref: '#/components/parameters/IndexName' responses: '200': $ref: '#/components/responses/DeletedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.DeleteIndexAsync(""); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.deleteIndex( indexName: "", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.DeleteIndex(client.NewApiDeleteIndexRequest( "")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API DeletedAtResponse response = client.deleteIndex(""); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.deleteIndex({ indexName: 'theIndexName' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.deleteIndex(indexName = "") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->deleteIndex( '', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_index( index_name="", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_index("") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.deleteIndex( indexName = "" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.deleteIndex(indexName: "") // print the response print(response) - lang: cURL label: curl source: |- curl --request DELETE \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/indexes/{indexName}/{objectID}: get: tags: - Records operationId: getObject x-acl: - search summary: Retrieve a record description: > Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](https://www.algolia.com/doc/rest-api/search/get-objects). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ObjectID' - name: attributesToRetrieve in: query description: > Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. `objectID` is always retrieved. Attributes included in `unretrievableAttributes` won't be retrieved unless the request is authenticated with the admin API key. schema: type: array items: type: string responses: '200': description: OK content: application/json: schema: type: object description: The requested record. x-is-generic: true '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetObjectAsync( "", "uniqueID", new List { "attr1", "attr2" } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getObject( indexName: "", objectID: "uniqueID", attributesToRetrieve: [ "attr1", "attr2", ], ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetObject(client.NewApiGetObjectRequest( "", "uniqueID").WithAttributesToRetrieve( []string{"attr1", "attr2"})) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API Object response = client.getObject("", "uniqueID", Arrays.asList("attr1", "attr2")); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getObject({ indexName: 'theIndexName', objectID: 'uniqueID', attributesToRetrieve: ['attr1', 'attr2'], }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getObject( indexName = "", objectID = "uniqueID", attributesToRetrieve = listOf("attr1", "attr2"), ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getObject( '', 'uniqueID', [ 'attr1', 'attr2', ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_object( index_name="", object_id="uniqueID", attributes_to_retrieve=[ "attr1", "attr2", ], ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_object("", "uniqueID", ["attr1", "attr2"]) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getObject( indexName = "", objectID = "uniqueID", attributesToRetrieve = Some(Seq("attr1", "attr2")) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response: [String: AnyCodable] = try await client.getObject( indexName: "", objectID: "uniqueID", attributesToRetrieve: ["attr1", "attr2"] ) // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/test-record-123?attributesToRetrieve=lorem' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' put: tags: - Records operationId: addOrUpdateObject x-acl: - addObject summary: Add or replace a record description: > If a record with the specified object ID exists, the existing record is replaced. Otherwise, a new record is added to the index. If you want to use auto-generated object IDs, use the [`saveObject` operation](https://www.algolia.com/doc/rest-api/search/save-object). To update _some_ attributes of an existing record, use the [`partial` operation](https://www.algolia.com/doc/rest-api/search/partial-update-object) instead. To add, update, or replace multiple records, use the [`batch` operation](https://www.algolia.com/doc/rest-api/search/batch). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ObjectID' requestBody: required: true description: >- The record. A schemaless object with attributes that are useful in the context of search and discovery. x-is-generic: true content: application/json: schema: type: object example: objectID: blackTShirt name: Black T-shirt color: '#000000' responses: '200': $ref: '#/components/responses/UpdatedAtWithObjectId' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.AddOrUpdateObjectAsync( "", "uniqueID", new Dictionary { { "key", "value" } } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.addOrUpdateObject( indexName: "", objectID: "uniqueID", body: { 'key': "value", }, ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.AddOrUpdateObject(client.NewApiAddOrUpdateObjectRequest( "", "uniqueID", map[string]any{"key": "value"})) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtWithObjectIdResponse response = client.addOrUpdateObject( "", "uniqueID", new HashMap() { { put("key", "value"); } } ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.addOrUpdateObject({ indexName: 'indexName', objectID: 'uniqueID', body: { key: 'value' }, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.addOrUpdateObject( indexName = "", objectID = "uniqueID", body = buildJsonObject { put("key", JsonPrimitive("value")) }, ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->addOrUpdateObject( '', 'uniqueID', ['key' => 'value', ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.add_or_update_object( index_name="", object_id="uniqueID", body={ "key": "value", }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.add_or_update_object("", "uniqueID", {key: "value"}) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.addOrUpdateObject( indexName = "", objectID = "uniqueID", body = JObject(List(JField("key", JString("value")))) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.addOrUpdateObject( indexName: "", objectID: "uniqueID", body: ["key": "value"] ) // print the response print(response) - lang: cURL label: curl source: |- curl --request PUT \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/test-record-123 \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "objectID": "blackTShirt", "name": "Black T-shirt", "color": "#000000" } ' delete: tags: - Records operationId: deleteObject x-acl: - deleteObject summary: Delete a record description: > Deletes a record by its object ID. To delete more than one record, use the [`batch` operation](https://www.algolia.com/doc/rest-api/search/batch). To delete records matching a query, use the [`deleteBy` operation](https://www.algolia.com/doc/rest-api/search/delete-by). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ObjectID' responses: '200': $ref: '#/components/responses/DeletedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.DeleteObjectAsync("", "uniqueID"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.deleteObject( indexName: "", objectID: "uniqueID", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.DeleteObject(client.NewApiDeleteObjectRequest( "", "uniqueID")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API DeletedAtResponse response = client.deleteObject("", "uniqueID"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.deleteObject({ indexName: '', objectID: 'uniqueID' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.deleteObject(indexName = "", objectID = "uniqueID") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->deleteObject( '', 'uniqueID', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_object( index_name="", object_id="uniqueID", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_object("", "uniqueID") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.deleteObject( indexName = "", objectID = "uniqueID" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.deleteObject(indexName: "", objectID: "uniqueID") // print the response print(response) - lang: cURL label: curl source: |- curl --request DELETE \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/test-record-123 \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/indexes/{indexName}/deleteByQuery: post: tags: - Records operationId: deleteBy x-mcp-tool: true x-acl: - deleteIndex summary: Delete records matching a filter description: > This operation doesn't accept empty filters. This operation is resource-intensive. Use it only if you can't get the object IDs of the records you want to delete. It's more efficient to get a list of object IDs with the [`browse` operation](https://www.algolia.com/doc/rest-api/search/browse), and then delete the records using the [`batch` operation](https://www.algolia.com/doc/rest-api/search/batch). This operation is subject to [indexing rate limits](https://support.algolia.com/hc/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia). externalDocs: url: >- https://support.algolia.com/hc/articles/16385098766353-Should-I-use-the-deleteBy-method-for-deleting-records-that-match-a-query description: Should I use the deleteBy method for deleting records. parameters: - $ref: '#/components/parameters/IndexName' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/deleteByParams' responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.DeleteByAsync( "", new DeleteByParams { Filters = "brand:brandName" } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.deleteBy( indexName: "", deleteByParams: DeleteByParams( filters: "brand:brandName", ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.DeleteBy(client.NewApiDeleteByRequest( "", search.NewEmptyDeleteByParams().SetFilters("brand:brandName"))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.deleteBy("", new DeleteByParams().setFilters("brand:brandName")); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.deleteBy({ indexName: 'theIndexName', deleteByParams: { filters: 'brand:brandName' } }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.deleteBy( indexName = "", deleteByParams = DeleteByParams(filters = "brand:brandName"), ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->deleteBy( '', ['filters' => 'brand:brandName', ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_by( index_name="", delete_by_params={ "filters": "brand:brandName", }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_by("", Algolia::Search::DeleteByParams.new(filters: "brand:brandName")) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.deleteBy( indexName = "", deleteByParams = DeleteByParams( filters = Some("brand:brandName") ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.deleteBy( indexName: "", deleteByParams: DeleteByParams(filters: "brand:brandName") ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/deleteByQuery \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "facetFilters": [ [ "category:Book", "category:-Movie" ], "author:John Doe" ], "filters": "(category:Book OR category:Ebook) AND _tags:published", "numericFilters": [ [ "inStock = 1", "deliveryDate < 1441755506" ], "price < 1000" ], "tagFilters": [ [ "Book", "Movie" ], "SciFi" ], "aroundLatLng": "40.71,-74.01", "aroundRadius": 1, "insideBoundingBox": "lorem", "insidePolygon": [ [ 47.3165, 4.9665, 47.3424, 5.0201, 47.32, 4.9 ], [ 40.9234, 2.1185, 38.643, 1.9916, 39.2587, 2.0104 ] ] } ' /1/indexes/{indexName}/clear: post: tags: - Records operationId: clearObjects x-acl: - deleteIndex summary: Delete all records from an index description: > Deletes only the records from an index while keeping settings, synonyms, and rules. This operation is resource-intensive and subject to [indexing rate limits](https://support.algolia.com/hc/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia). parameters: - $ref: '#/components/parameters/IndexName' responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.ClearObjectsAsync(""); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.clearObjects( indexName: "", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.ClearObjects(client.NewApiClearObjectsRequest( "")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.clearObjects(""); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.clearObjects({ indexName: 'theIndexName' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.clearObjects(indexName = "") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->clearObjects( '', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.clear_objects( index_name="", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.clear_objects("") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.clearObjects( indexName = "" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.clearObjects(indexName: "") // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/clear \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/indexes/{indexName}/{objectID}/partial: post: tags: - Records operationId: partialUpdateObject x-mcp-tool: true x-acl: - addObject summary: Add or update attributes x-codegen-request-body-name: attributesToUpdate description: > Adds new attributes to a record, or updates existing ones. - If a record with the specified object ID doesn't exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn't exist yet, this method creates a new index. - Use first-level attributes only. Nested attributes aren't supported. If you specify a nested attribute, this operation replaces its first-level ancestor. To update attributes without replacing the full record, use these built-in operations. These operations are useful when the initial data isn't available. - `Increment`: increment a numeric attribute. - `Decrement`: decrement a numeric attribute. - `Add`: append a number or string element to an array attribute. - `Remove`: remove all matching number or string elements from an array attribute made of numbers or strings. - `AddUnique`: add a number or string element to an array attribute made of numbers or strings only if it's not already present. - `IncrementFrom`: increment a numeric integer attribute only if the provided value matches the current value. Otherwise, the update is ignored. Example: If you pass an `IncrementFrom` value of 2 for the `version` attribute but the current value is 1, the API ignores the update. If the object doesn't exist, the API only creates it if you pass an `IncrementFrom` value of 0. - `IncrementSet`: increment a numeric integer attribute only if the provided value is greater than the current value. Otherwise, the update is ignored. Example: If you pass an `IncrementSet` value of 2 for the `version` attribute and the current value is 1, the API updates the object. If the object doesn't exist yet, the API only creates it if you pass an `IncrementSet` value greater than 0. Specify an operation by providing an object with the attribute to update as the key and its value as an object with these properties: - `_operation`: the operation to apply on the attribute. - `value`: the right-hand side argument to the operation, for example, increment or decrement step, or a value to add or remove. When updating multiple attributes or using multiple operations targeting the same record, use a single partial update for faster processing. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ObjectID' - name: createIfNotExists description: Whether to create a new record if it doesn't exist. in: query schema: type: boolean default: true requestBody: required: true description: Attributes with their values. content: application/json: schema: description: Attributes to update. type: object responses: '200': $ref: '#/components/responses/UpdatedAtWithObjectId' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.PartialUpdateObjectAsync( "", "uniqueID", new Dictionary { { "attributeId", "new value" } } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.partialUpdateObject( indexName: "", objectID: "uniqueID", attributesToUpdate: { 'attributeId': "new value", }, ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.PartialUpdateObject(client.NewApiPartialUpdateObjectRequest( "", "uniqueID", map[string]any{"attributeId": "new value"})) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtWithObjectIdResponse response = client.partialUpdateObject( "", "uniqueID", new HashMap() { { put("attributeId", "new value"); } } ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.partialUpdateObject({ indexName: 'theIndexName', objectID: 'uniqueID', attributesToUpdate: { attributeId: 'new value' }, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.partialUpdateObject( indexName = "", objectID = "uniqueID", attributesToUpdate = buildJsonObject { put("attributeId", JsonPrimitive("new value")) }, ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->partialUpdateObject( '', 'uniqueID', ['attributeId' => 'new value', ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.partial_update_object( index_name="", object_id="uniqueID", attributes_to_update={ "attributeId": "new value", }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.partial_update_object("", "uniqueID", {attributeId: "new value"}) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.partialUpdateObject( indexName = "", objectID = "uniqueID", attributesToUpdate = JObject(List(JField("attributeId", JString("new value")))) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.partialUpdateObject( indexName: "", objectID: "uniqueID", attributesToUpdate: ["attributeId": "new value"] ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/test-record-123/partial?createIfNotExists=true' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data '{}' /1/indexes/{indexName}/batch: post: tags: - Records x-acl: - addObject operationId: batch x-mcp-tool: true summary: Batch indexing operations on one index description: > Adds, updates, or deletes records in one index with a single API request. Batching index updates reduces latency and increases data integrity. - Actions are applied in the order they're specified. - Actions are equivalent to the individual API requests of the same name. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia). parameters: - $ref: '#/components/parameters/IndexName' x-codegen-request-body-name: batchWriteParams requestBody: content: application/json: schema: $ref: '#/components/schemas/batchWriteParams' required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/batchResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.BatchAsync( "", new BatchWriteParams { Requests = new List { new BatchRequest { Action = Enum.Parse("AddObject"), Body = new Dictionary { { "key", "bar" }, { "foo", "1" } }, }, new BatchRequest { Action = Enum.Parse("AddObject"), Body = new Dictionary { { "key", "baz" }, { "foo", "2" } }, }, }, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.batch( indexName: "", batchWriteParams: BatchWriteParams( requests: [ BatchRequest( action: Action.fromJson("addObject"), body: { 'key': "bar", 'foo': "1", }, ), BatchRequest( action: Action.fromJson("addObject"), body: { 'key': "baz", 'foo': "2", }, ), ], ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.Batch(client.NewApiBatchRequest( "", search.NewEmptyBatchWriteParams().SetRequests( []search.BatchRequest{ *search.NewEmptyBatchRequest().SetAction(search.Action("addObject")).SetBody(map[string]any{"key": "bar", "foo": "1"}), *search.NewEmptyBatchRequest().SetAction(search.Action("addObject")).SetBody(map[string]any{"key": "baz", "foo": "2"}), }), )) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API BatchResponse response = client.batch( "", new BatchWriteParams().setRequests( Arrays.asList( new BatchRequest().setAction(Action.ADD_OBJECT).setBody( new HashMap() { { put("key", "bar"); put("foo", "1"); } } ), new BatchRequest().setAction(Action.ADD_OBJECT).setBody( new HashMap() { { put("key", "baz"); put("foo", "2"); } } ) ) ) ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.batch({ indexName: '', batchWriteParams: { requests: [ { action: 'addObject', body: { key: 'bar', foo: '1' } }, { action: 'addObject', body: { key: 'baz', foo: '2' } }, ], }, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.batch( indexName = "", batchWriteParams = BatchWriteParams( requests = listOf( BatchRequest( action = Action.entries.first { it.value == "addObject" }, body = buildJsonObject { put("key", JsonPrimitive("bar")) put("foo", JsonPrimitive("1")) }, ), BatchRequest( action = Action.entries.first { it.value == "addObject" }, body = buildJsonObject { put("key", JsonPrimitive("baz")) put("foo", JsonPrimitive("2")) }, ), ) ), ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->batch( '', ['requests' => [ ['action' => 'addObject', 'body' => ['key' => 'bar', 'foo' => '1', ], ], ['action' => 'addObject', 'body' => ['key' => 'baz', 'foo' => '2', ], ], ], ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.batch( index_name="", batch_write_params={ "requests": [ { "action": "addObject", "body": { "key": "bar", "foo": "1", }, }, { "action": "addObject", "body": { "key": "baz", "foo": "2", }, }, ], }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.batch( "", Algolia::Search::BatchWriteParams.new( requests: [ Algolia::Search::BatchRequest.new(action: "addObject", body: {key: "bar", foo: "1"}), Algolia::Search::BatchRequest.new(action: "addObject", body: {key: "baz", foo: "2"}) ] ) ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.batch( indexName = "", batchWriteParams = BatchWriteParams( requests = Seq( BatchRequest( action = Action.withName("addObject"), body = JObject(List(JField("key", JString("bar")), JField("foo", JString("1")))) ), BatchRequest( action = Action.withName("addObject"), body = JObject(List(JField("key", JString("baz")), JField("foo", JString("2")))) ) ) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.batch( indexName: "", batchWriteParams: SearchBatchWriteParams(requests: [ SearchBatchRequest(action: SearchAction.addObject, body: ["key": "bar", "foo": "1"]), SearchBatchRequest(action: SearchAction.addObject, body: ["key": "baz", "foo": "2"]), ]) ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/batch \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "requests": [ { "action": "addObject", "body": { "name": "Betty Jane McCamey", "company": "Vita Foods Inc.", "email": "betty@mccamey.com" } }, { "action": "addObject", "body": { "name": "Gayla geimer", "company": "Ortman McCain Co.", "email": "gayla@geimer.com" } } ] } ' /1/indexes/*/batch: post: tags: - Records x-acl: - addObject operationId: multipleBatch x-mcp-tool: true description: > Adds, updates, or deletes records in multiple indices with a single API request. - Actions are applied in the order they are specified. - Actions are equivalent to the individual API requests of the same name. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia). summary: Batch indexing operations on multiple indices requestBody: required: true content: application/json: schema: title: batchParams description: Batch parameters. type: object additionalProperties: false properties: requests: type: array items: title: multipleBatchRequest type: object additionalProperties: false properties: action: $ref: '#/components/schemas/action' indexName: $ref: '#/components/schemas/indexName' body: type: object description: Operation arguments (varies with specified `action`). required: - action - indexName required: - requests examples: batch: summary: Batch indexing request to two indices value: requests: - action: addObject indexName: contacts body: name: Betty Jane McCamey company: Vita Foods Inc. email: betty@mccamey.com - action: addObject indexName: public_contacts body: name: Gayla Geimer company: Ortman McCain Co. email: gayla@geimer.com responses: '200': description: OK content: application/json: schema: title: multipleBatchResponse type: object additionalProperties: false properties: objectIDs: $ref: '#/components/schemas/objectIDs' taskID: type: object description: Task IDs. One for each index. additionalProperties: $ref: '#/components/schemas/taskID' required: - taskID - objectIDs '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.MultipleBatchAsync( new BatchParams { Requests = new List { new MultipleBatchRequest { Action = Enum.Parse("AddObject"), Body = new Dictionary { { "key", "value" } }, IndexName = "", }, }, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.multipleBatch( batchParams: BatchParams( requests: [ MultipleBatchRequest( action: Action.fromJson("addObject"), body: { 'key': "value", }, indexName: "", ), ], ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.MultipleBatch(client.NewApiMultipleBatchRequest( search.NewEmptyBatchParams().SetRequests( []search.MultipleBatchRequest{ *search.NewEmptyMultipleBatchRequest().SetAction(search.Action("addObject")).SetBody(map[string]any{"key": "value"}).SetIndexName(""), }), )) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API MultipleBatchResponse response = client.multipleBatch( new BatchParams().setRequests( Arrays.asList( new MultipleBatchRequest() .setAction(Action.ADD_OBJECT) .setBody( new HashMap() { { put("key", "value"); } } ) .setIndexName("") ) ) ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.multipleBatch({ requests: [{ action: 'addObject', body: { key: 'value' }, indexName: 'theIndexName' }], }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.multipleBatch( batchParams = BatchParams( requests = listOf( MultipleBatchRequest( action = Action.entries.first { it.value == "addObject" }, body = buildJsonObject { put("key", JsonPrimitive("value")) }, indexName = "", ) ) ) ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->multipleBatch( ['requests' => [ ['action' => 'addObject', 'body' => ['key' => 'value', ], 'indexName' => '', ], ], ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.multiple_batch( batch_params={ "requests": [ { "action": "addObject", "body": { "key": "value", }, "indexName": "", }, ], }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.multiple_batch( Algolia::Search::BatchParams.new( requests: [ Algolia::Search::MultipleBatchRequest.new( action: "addObject", body: {key: "value"}, index_name: "" ) ] ) ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.multipleBatch( batchParams = BatchParams( requests = Seq( MultipleBatchRequest( action = Action.withName("addObject"), body = Some(JObject(List(JField("key", JString("value"))))), indexName = "" ) ) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.multipleBatch(batchParams: BatchParams(requests: [MultipleBatchRequest( action: SearchAction.addObject, body: ["key": "value"], indexName: "" )])) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url 'https://algolia_application_id.algolia.net/1/indexes/*/batch' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "requests": [ { "action": "addObject", "indexName": "contacts", "body": { "name": "Betty Jane McCamey", "company": "Vita Foods Inc.", "email": "betty@mccamey.com" } }, { "action": "addObject", "indexName": "public_contacts", "body": { "name": "Gayla Geimer", "company": "Ortman McCain Co.", "email": "gayla@geimer.com" } } ] } ' /1/indexes/*/objects: post: tags: - Records operationId: getObjects x-use-read-transporter: true x-cacheable: true x-acl: - search summary: Retrieve records description: | Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests. requestBody: required: true description: Request object. content: application/json: schema: title: getObjectsParams description: Request parameters. type: object additionalProperties: false properties: requests: type: array items: title: getObjectsRequest description: Request body for retrieving records. type: object additionalProperties: false required: - objectID - indexName properties: indexName: type: string description: Index from which to retrieve the records. example: books objectID: type: string description: Object ID for the record to retrieve. example: product-1 attributesToRetrieve: type: array items: type: string description: > Attributes to retrieve. If not specified, all retrievable attributes are returned. example: - author - title - content required: - requests responses: '200': description: OK content: application/json: schema: title: getObjectsResponse type: object additionalProperties: false properties: results: type: array description: Retrieved records. items: type: object description: > Retrieved record. `null` if the requested `objectID` doesn't exist in the index. nullable: true x-is-generic: true message: type: string description: An optional status message. example: Index INDEX_NAME does not exist. required: - results '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetObjectsAsync( new GetObjectsParams { Requests = new List { new GetObjectsRequest { ObjectID = "uniqueID", IndexName = "" }, }, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getObjects( getObjectsParams: GetObjectsParams( requests: [ GetObjectsRequest( objectID: "uniqueID", indexName: "", ), ], ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetObjects(client.NewApiGetObjectsRequest( search.NewEmptyGetObjectsParams().SetRequests( []search.GetObjectsRequest{*search.NewEmptyGetObjectsRequest().SetObjectID("uniqueID").SetIndexName("")}))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API GetObjectsResponse response = client.getObjects( new GetObjectsParams().setRequests(Arrays.asList(new GetObjectsRequest().setObjectID("uniqueID").setIndexName(""))), Hit.class ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getObjects({ requests: [{ objectID: 'uniqueID', indexName: 'theIndexName' }] }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getObjects( getObjectsParams = GetObjectsParams( requests = listOf(GetObjectsRequest(objectID = "uniqueID", indexName = "")) ) ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getObjects( ['requests' => [ ['objectID' => 'uniqueID', 'indexName' => '', ], ], ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_objects( get_objects_params={ "requests": [ { "objectID": "uniqueID", "indexName": "", }, ], }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_objects( Algolia::Search::GetObjectsParams.new( requests: [Algolia::Search::GetObjectsRequest.new(algolia_object_id: "uniqueID", index_name: "")] ) ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getObjects( getObjectsParams = GetObjectsParams( requests = Seq( GetObjectsRequest( objectID = "uniqueID", indexName = "" ) ) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response: GetObjectsResponse = try await client .getObjects(getObjectsParams: GetObjectsParams(requests: [GetObjectsRequest( objectID: "uniqueID", indexName: "" )])) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url 'https://algolia_application_id.algolia.net/1/indexes/*/objects' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "requests": [ { "attributesToRetrieve": [ "author", "title", "content" ], "objectID": "product-1", "indexName": "books" } ] } ' /1/indexes/{indexName}/settings: get: tags: - Indices operationId: getSettings x-mcp-tool: true x-acl: - settings description: Retrieves an object with non-null index settings. summary: Retrieve index settings parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/getVersion' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/settingsResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetSettingsAsync("", 2); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getSettings( indexName: "", getVersion: 2, ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetSettings(client.NewApiGetSettingsRequest( "").WithGetVersion(2)) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API SettingsResponse response = client.getSettings("", 2); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getSettings({ indexName: 'cts_e2e_settings', getVersion: 2 }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getSettings(indexName = "", getVersion = 2) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getSettings( '', 2, ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_settings( index_name="", get_version=2, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_settings("", 2) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getSettings( indexName = "", getVersion = Some(2) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getSettings(indexName: "", getVersion: 2) // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/settings?getVersion=1' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' put: tags: - Indices operationId: setSettings x-acl: - editSettings description: > Update the specified index settings. Index settings that you don't specify are left unchanged. Specify `null` to reset a setting to its default value. For best performance, update the index settings before you add new records to your index. summary: Update index settings parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ForwardToReplicas' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/indexSettings' responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SetSettingsAsync( "", new IndexSettings { PaginationLimitedTo = 10, TypoTolerance = new TypoTolerance(Enum.Parse("False")), }, true ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.setSettings( indexName: "", indexSettings: IndexSettings( paginationLimitedTo: 10, typoTolerance: TypoToleranceEnum.fromJson("false"), ), forwardToReplicas: true, ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SetSettings(client.NewApiSetSettingsRequest( "", search.NewEmptyIndexSettings(). SetPaginationLimitedTo(10). SetTypoTolerance(search.TypoToleranceEnumAsTypoTolerance(search.TypoToleranceEnum("false"))), ).WithForwardToReplicas(true)) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.setSettings( "", new IndexSettings().setPaginationLimitedTo(10).setTypoTolerance(TypoToleranceEnum.FALSE), true ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.setSettings({ indexName: 'cts_e2e_settings', indexSettings: { paginationLimitedTo: 10, typoTolerance: 'false' }, forwardToReplicas: true, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.setSettings( indexName = "", indexSettings = IndexSettings( paginationLimitedTo = 10, typoTolerance = TypoToleranceEnum.entries.first { it.value == "false" }, ), forwardToReplicas = true, ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->setSettings( '', ['paginationLimitedTo' => 10, 'typoTolerance' => 'false', ], true, ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.set_settings( index_name="", index_settings={ "paginationLimitedTo": 10, "typoTolerance": "false", }, forward_to_replicas=True, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.set_settings( "", Algolia::Search::IndexSettings.new(pagination_limited_to: 10, typo_tolerance: "false"), true ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.setSettings( indexName = "", indexSettings = IndexSettings( paginationLimitedTo = Some(10), typoTolerance = Some(TypoToleranceEnum.withName("false")) ), forwardToReplicas = Some(true) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.setSettings( indexName: "", indexSettings: IndexSettings( paginationLimitedTo: 10, typoTolerance: SearchTypoTolerance.searchTypoToleranceEnum(SearchTypoToleranceEnum.`false`) ), forwardToReplicas: true ) // print the response print(response) - lang: cURL label: curl source: |- curl --request PUT \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/settings?forwardToReplicas=true' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "attributesForFaceting": [ "author", "filterOnly(isbn)", "searchable(edition)", "afterDistinct(category)", "afterDistinct(searchable(publisher))" ], "replicas": [ "virtual(prod_products_price_asc)", "dev_products_replica" ], "paginationLimitedTo": 100, "unretrievableAttributes": [ "total_sales" ], "disableTypoToleranceOnWords": [ "wheel", "1X2BCD" ], "attributesToTransliterate": [ "name", "description" ], "camelCaseAttributes": [ "description" ], "decompoundedAttributes": { "de": [ "name" ] }, "indexLanguages": [ "ja" ], "disablePrefixOnAttributes": [ "sku" ], "allowCompressionOfIntegerArray": false, "numericAttributesForFiltering": [ "equalOnly(quantity)", "popularity" ], "separatorsToIndex": "+#", "searchableAttributes": [ "title,alternative_title", "author", "unordered(text)", "emails.personal" ], "userData": { "settingID": "f2a7b51e3503acc6a39b3784ffb84300", "pluginVersion": "1.6.0" }, "customNormalization": { "default": { "ä": "ae", "ü": "ue" } }, "attributeForDistinct": "url", "maxFacetHits": 10, "keepDiacriticsOnCharacters": "øé", "customRanking": [ "desc(popularity)", "asc(price)" ], "attributesToRetrieve": [ "author", "title", "content" ], "ranking": [ "typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom" ], "relevancyStrictness": 90, "attributesToHighlight": [ "author", "title", "conten", "content" ], "attributesToSnippet": [ "content:80", "description" ], "highlightPreTag": "", "highlightPostTag": "", "snippetEllipsisText": "…", "restrictHighlightAndSnippetArrays": false, "hitsPerPage": 20, "minWordSizefor1Typo": 4, "minWordSizefor2Typos": 8, "typoTolerance": true, "allowTyposOnNumericTokens": true, "disableTypoToleranceOnAttributes": [ "sku" ], "ignorePlurals": [ "ca", "es" ], "removeStopWords": [ "ca", "es" ], "queryLanguages": [ "es" ], "decompoundQuery": true, "enableRules": true, "enablePersonalization": false, "queryType": "prefixLast", "removeWordsIfNoResults": "firstWords", "mode": "keywordSearch", "semanticSearch": { "eventSources": [ "lorem" ] }, "advancedSyntax": false, "optionalWords": "lorem", "disableExactOnAttributes": [ "description" ], "exactOnSingleWordQuery": "attribute", "alternativesAsExact": [ "ignorePlurals", "singleWordSynonym" ], "advancedSyntaxFeatures": [ "exactPhrase", "excludeWords" ], "distinct": 1, "replaceSynonymsInHighlight": false, "minProximity": 1, "responseFields": [ "*" ], "maxValuesPerFacet": 100, "sortFacetValuesBy": "count", "attributeCriteriaComputedByMinProximity": false, "renderingContent": { "facetOrdering": { "facets": { "order": [ "lorem" ] }, "values": { "property1": { "order": [ "lorem" ], "sortRemainingBy": "count", "hide": [ "lorem" ] }, "property2": { "order": [ "lorem" ], "sortRemainingBy": "count", "hide": [ "lorem" ] } } }, "redirect": { "url": "lorem" }, "widgets": { "banners": [ { "image": { "urls": [ { "url": "lorem" } ], "title": "lorem" }, "link": { "url": "lorem" } } ] } }, "enableReRanking": true, "reRankingApplyFilter": [ [] ] } ' /1/indexes/{indexName}/synonyms/{objectID}: get: tags: - Synonyms operationId: getSynonym x-acl: - settings summary: Retrieve a synonym description: > Retrieves a synonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](https://www.algolia.com/doc/rest-api/search/search-synonyms). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/parameters_ObjectID' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/synonymHit' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetSynonymAsync("", "id1"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getSynonym( indexName: "", objectID: "id1", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetSynonym(client.NewApiGetSynonymRequest( "", "id1")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API SynonymHit response = client.getSynonym("", "id1"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getSynonym({ indexName: 'indexName', objectID: 'id1' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getSynonym(indexName = "", objectID = "id1") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getSynonym( '', 'id1', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_synonym( index_name="", object_id="id1", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_synonym("", "id1") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getSynonym( indexName = "", objectID = "id1" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getSynonym(indexName: "", objectID: "id1") // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/synonyms/synonymID \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' put: tags: - Synonyms operationId: saveSynonym x-acl: - editSettings summary: Create or replace a synonym description: > If a synonym with the specified object ID doesn't exist, Algolia adds a new one. Otherwise, the existing synonym is replaced. To add multiple synonyms in a single API request, use the [`batch` operation](https://www.algolia.com/doc/rest-api/search/save-synonyms). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/parameters_ObjectID' - $ref: '#/components/parameters/ForwardToReplicas' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/synonymHit' responses: '200': description: OK content: application/json: schema: title: saveSynonymResponse type: object additionalProperties: false properties: id: $ref: '#/components/schemas/id' taskID: $ref: '#/components/schemas/taskID' updatedAt: $ref: '#/components/schemas/updatedAt' required: - taskID - updatedAt - id '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SaveSynonymAsync( "", "id1", new SynonymHit { ObjectID = "id1", Type = Enum.Parse("Synonym"), Synonyms = new List { "car", "vehicule", "auto" }, }, true ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.saveSynonym( indexName: "", objectID: "id1", synonymHit: SynonymHit( objectID: "id1", type: SynonymType.fromJson("synonym"), synonyms: [ "car", "vehicule", "auto", ], ), forwardToReplicas: true, ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SaveSynonym(client.NewApiSaveSynonymRequest( "", "id1", search.NewEmptySynonymHit().SetObjectID("id1").SetType(search.SynonymType("synonym")).SetSynonyms( []string{"car", "vehicle", "auto"})).WithForwardToReplicas(true)) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API SaveSynonymResponse response = client.saveSynonym( "", "id1", new SynonymHit() .setObjectID("id1") .setType(SynonymType.SYNONYM) .setSynonyms(Arrays.asList("car", "vehicule", "auto")), true ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.saveSynonym({ indexName: 'indexName', objectID: 'id1', synonymHit: { objectID: 'id1', type: 'synonym', synonyms: ['car', 'vehicule', 'auto'] }, forwardToReplicas: true, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.saveSynonym( indexName = "", objectID = "id1", synonymHit = SynonymHit( objectID = "id1", type = SynonymType.entries.first { it.value == "synonym" }, synonyms = listOf("car", "vehicule", "auto"), ), forwardToReplicas = true, ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->saveSynonym( '', 'id1', ['objectID' => 'id1', 'type' => 'synonym', 'synonyms' => [ 'car', 'vehicule', 'auto', ], ], true, ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.save_synonym( index_name="", object_id="id1", synonym_hit={ "objectID": "id1", "type": "synonym", "synonyms": [ "car", "vehicule", "auto", ], }, forward_to_replicas=True, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.save_synonym( "", "id1", Algolia::Search::SynonymHit.new(algolia_object_id: "id1", type: "synonym", synonyms: ["car", "vehicule", "auto"]), true ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.saveSynonym( indexName = "", objectID = "id1", synonymHit = SynonymHit( objectID = "id1", `type` = SynonymType.withName("synonym"), synonyms = Some(Seq("car", "vehicule", "auto")) ), forwardToReplicas = Some(true) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.saveSynonym( indexName: "", objectID: "id1", synonymHit: SynonymHit(objectID: "id1", type: SynonymType.synonym, synonyms: ["car", "vehicule", "auto"]), forwardToReplicas: true ) // print the response print(response) - lang: cURL label: curl source: |- curl --request PUT \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/synonyms/synonymID?forwardToReplicas=true' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "objectID": "synonymID", "type": "onewaysynonym", "synonyms": [ "vehicle", "auto" ], "input": "car", "word": "car", "corrections": [ "vehicle", "auto" ], "placeholder": "", "replacements": [ "street", "st" ] } ' delete: tags: - Synonyms operationId: deleteSynonym x-acl: - editSettings summary: Delete a synonym description: > Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](https://www.algolia.com/doc/rest-api/search/search-synonyms). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/parameters_ObjectID' - $ref: '#/components/parameters/ForwardToReplicas' responses: '200': $ref: '#/components/responses/DeletedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.DeleteSynonymAsync("", "id1"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.deleteSynonym( indexName: "", objectID: "id1", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.DeleteSynonym(client.NewApiDeleteSynonymRequest( "", "id1")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API DeletedAtResponse response = client.deleteSynonym("", "id1"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.deleteSynonym({ indexName: 'indexName', objectID: 'id1' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.deleteSynonym(indexName = "", objectID = "id1") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->deleteSynonym( '', 'id1', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_synonym( index_name="", object_id="id1", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_synonym("", "id1") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.deleteSynonym( indexName = "", objectID = "id1" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.deleteSynonym(indexName: "", objectID: "id1") // print the response print(response) - lang: cURL label: curl source: |- curl --request DELETE \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/synonyms/synonymID?forwardToReplicas=true' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/indexes/{indexName}/synonyms/batch: post: tags: - Synonyms operationId: saveSynonyms x-acl: - editSettings summary: Create or replace synonyms description: > If a synonym with the `objectID` doesn't exist, Algolia adds a new one. Otherwise, existing synonyms are replaced. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ForwardToReplicas' - $ref: '#/components/parameters/ReplaceExistingSynonyms' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/synonymHits' responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SaveSynonymsAsync( "", new List { new SynonymHit { ObjectID = "id1", Type = Enum.Parse("Synonym"), Synonyms = new List { "car", "vehicule", "auto" }, }, new SynonymHit { ObjectID = "id2", Type = Enum.Parse("Onewaysynonym"), Input = "iphone", Synonyms = new List { "ephone", "aphone", "yphone" }, }, }, true, true ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.saveSynonyms( indexName: "", synonymHit: [ SynonymHit( objectID: "id1", type: SynonymType.fromJson("synonym"), synonyms: [ "car", "vehicule", "auto", ], ), SynonymHit( objectID: "id2", type: SynonymType.fromJson("onewaysynonym"), input: "iphone", synonyms: [ "ephone", "aphone", "yphone", ], ), ], forwardToReplicas: true, replaceExistingSynonyms: true, ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SaveSynonyms(client.NewApiSaveSynonymsRequest( "", []search.SynonymHit{*search.NewEmptySynonymHit().SetObjectID("id1").SetType(search.SynonymType("synonym")).SetSynonyms( []string{"car", "vehicle", "auto"}), *search.NewEmptySynonymHit().SetObjectID("id2").SetType(search.SynonymType("onewaysynonym")).SetInput("iphone").SetSynonyms( []string{"ephone", "aphone", "yphone"})}).WithForwardToReplicas(true).WithReplaceExistingSynonyms(true)) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.saveSynonyms( "", Arrays.asList( new SynonymHit() .setObjectID("id1") .setType(SynonymType.SYNONYM) .setSynonyms(Arrays.asList("car", "vehicule", "auto")), new SynonymHit() .setObjectID("id2") .setType(SynonymType.ONEWAYSYNONYM) .setInput("iphone") .setSynonyms(Arrays.asList("ephone", "aphone", "yphone")) ), true, true ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.saveSynonyms({ indexName: '', synonymHit: [ { objectID: 'id1', type: 'synonym', synonyms: ['car', 'vehicule', 'auto'] }, { objectID: 'id2', type: 'onewaysynonym', input: 'iphone', synonyms: ['ephone', 'aphone', 'yphone'] }, ], forwardToReplicas: true, replaceExistingSynonyms: true, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.saveSynonyms( indexName = "", synonymHit = listOf( SynonymHit( objectID = "id1", type = SynonymType.entries.first { it.value == "synonym" }, synonyms = listOf("car", "vehicule", "auto"), ), SynonymHit( objectID = "id2", type = SynonymType.entries.first { it.value == "onewaysynonym" }, input = "iphone", synonyms = listOf("ephone", "aphone", "yphone"), ), ), forwardToReplicas = true, replaceExistingSynonyms = true, ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->saveSynonyms( '', [ ['objectID' => 'id1', 'type' => 'synonym', 'synonyms' => [ 'car', 'vehicule', 'auto', ], ], ['objectID' => 'id2', 'type' => 'onewaysynonym', 'input' => 'iphone', 'synonyms' => [ 'ephone', 'aphone', 'yphone', ], ], ], true, true, ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.save_synonyms( index_name="", synonym_hit=[ { "objectID": "id1", "type": "synonym", "synonyms": [ "car", "vehicule", "auto", ], }, { "objectID": "id2", "type": "onewaysynonym", "input": "iphone", "synonyms": [ "ephone", "aphone", "yphone", ], }, ], forward_to_replicas=True, replace_existing_synonyms=True, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.save_synonyms( "", [ Algolia::Search::SynonymHit.new(algolia_object_id: "id1", type: "synonym", synonyms: ["car", "vehicule", "auto"]), Algolia::Search::SynonymHit.new( algolia_object_id: "id2", type: "onewaysynonym", input: "iphone", synonyms: ["ephone", "aphone", "yphone"] ) ], true, true ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.saveSynonyms( indexName = "", synonymHit = Seq( SynonymHit( objectID = "id1", `type` = SynonymType.withName("synonym"), synonyms = Some(Seq("car", "vehicule", "auto")) ), SynonymHit( objectID = "id2", `type` = SynonymType.withName("onewaysynonym"), input = Some("iphone"), synonyms = Some(Seq("ephone", "aphone", "yphone")) ) ), forwardToReplicas = Some(true), replaceExistingSynonyms = Some(true) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.saveSynonyms( indexName: "", synonymHit: [ SynonymHit(objectID: "id1", type: SynonymType.synonym, synonyms: ["car", "vehicule", "auto"]), SynonymHit( objectID: "id2", type: SynonymType.onewaysynonym, synonyms: ["ephone", "aphone", "yphone"], input: "iphone" ), ], forwardToReplicas: true, replaceExistingSynonyms: true ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/synonyms/batch?forwardToReplicas=true&replaceExistingSynonyms=true' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' [ { "objectID": "synonymID", "type": "onewaysynonym", "synonyms": [ "vehicle", "auto" ], "input": "car", "word": "car", "corrections": [ "vehicle", "auto" ], "placeholder": "", "replacements": [ "street", "st" ] } ] ' /1/indexes/{indexName}/synonyms/clear: post: tags: - Synonyms operationId: clearSynonyms x-acl: - editSettings summary: Delete all synonyms description: Deletes all synonyms from the index. parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ForwardToReplicas' responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.ClearSynonymsAsync(""); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.clearSynonyms( indexName: "", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.ClearSynonyms(client.NewApiClearSynonymsRequest( "")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.clearSynonyms(""); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.clearSynonyms({ indexName: 'indexName' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.clearSynonyms(indexName = "") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->clearSynonyms( '', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.clear_synonyms( index_name="", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.clear_synonyms("") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.clearSynonyms( indexName = "" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.clearSynonyms(indexName: "") // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/synonyms/clear?forwardToReplicas=true' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/indexes/{indexName}/synonyms/search: post: tags: - Synonyms operationId: searchSynonyms x-mcp-tool: true x-use-read-transporter: true x-cacheable: true x-acl: - settings summary: Search for synonyms description: Searches for synonyms in your index. parameters: - $ref: '#/components/parameters/IndexName' requestBody: description: Body of the `searchSynonyms` operation. content: application/json: schema: title: searchSynonymsParams type: object additionalProperties: false properties: hitsPerPage: $ref: '#/components/schemas/hitsPerPage' page: $ref: '#/components/schemas/page' query: $ref: '#/components/schemas/query' type: $ref: '#/components/schemas/SynonymType' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/searchSynonymsResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SearchSynonymsAsync(""); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.searchSynonyms( indexName: "", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SearchSynonyms(client.NewApiSearchSynonymsRequest( "")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API SearchSynonymsResponse response = client.searchSynonyms(""); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.searchSynonyms({ indexName: 'indexName' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.searchSynonyms(indexName = "") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->searchSynonyms( '', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_synonyms( index_name="", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_synonyms("") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.searchSynonyms( indexName = "" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.searchSynonyms(indexName: "") // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/synonyms/search \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "query": "", "type": "onewaysynonym", "page": 0, "hitsPerPage": 20 } ' /1/keys: get: tags: - Api Keys operationId: listApiKeys x-acl: - admin summary: List API keys description: >- Lists all API keys associated with your Algolia application, including their permissions and restrictions. responses: '200': description: OK content: application/json: schema: title: listApiKeysResponse type: object additionalProperties: false required: - keys properties: keys: type: array description: API keys. items: $ref: '#/components/schemas/getApiKeyResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.ListApiKeysAsync(); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.listApiKeys(); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.ListApiKeys() if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API ListApiKeysResponse response = client.listApiKeys(); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.listApiKeys(); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.listApiKeys() // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->listApiKeys(); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.list_api_keys() # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.list_api_keys # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.listApiKeys( ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.listApiKeys() // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url https://algolia_application_id.algolia.net/1/keys \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' post: tags: - Api Keys operationId: addApiKey x-acl: - admin summary: Create an API key description: Creates a new API key with specific permissions and restrictions. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/apiKey' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/addApiKeyResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.AddApiKeyAsync( new ApiKey { Acl = new List { Enum.Parse("Search"), Enum.Parse("AddObject") }, Description = "my new api key", } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.addApiKey( apiKey: ApiKey( acl: [ Acl.fromJson("search"), Acl.fromJson("addObject"), ], description: "my new api key", ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.AddApiKey(client.NewApiAddApiKeyRequest( search.NewEmptyApiKey().SetAcl( []search.Acl{search.Acl("search"), search.Acl("addObject")}).SetDescription("my new api key"))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API AddApiKeyResponse response = client.addApiKey( new ApiKey().setAcl(Arrays.asList(Acl.SEARCH, Acl.ADD_OBJECT)).setDescription("my new api key") ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.addApiKey({ acl: ['search', 'addObject'], description: 'my new api key' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.addApiKey( apiKey = ApiKey( acl = listOf( Acl.entries.first { it.value == "search" }, Acl.entries.first { it.value == "addObject" }, ), description = "my new api key", ) ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->addApiKey( ['acl' => [ 'search', 'addObject', ], 'description' => 'my new api key', ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.add_api_key( api_key={ "acl": [ "search", "addObject", ], "description": "my new api key", }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.add_api_key( Algolia::Search::ApiKey.new(acl: ["search", "addObject"], description: "my new api key") ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.addApiKey( apiKey = ApiKey( acl = Seq(Acl.withName("search"), Acl.withName("addObject")), description = Some("my new api key") ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.addApiKey(apiKey: ApiKey( acl: [Acl.search, Acl.addObject], description: "my new api key" )) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/keys \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "acl": [ "search", "addObject" ], "description": "Used for indexing by the CLI", "indexes": [ "dev_*", "prod_en_products" ], "maxHitsPerQuery": 0, "maxQueriesPerIPPerHour": 0, "queryParameters": "typoTolerance=strict&restrictSources=192.168.1.0/24", "referers": [ "*algolia.com*" ], "validity": 86400 } ' /1/keys/{key}: get: tags: - Api Keys x-acl: - search operationId: getApiKey summary: Retrieve API key permissions description: > Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application's keys. When authenticating with other API keys, you can only retrieve information for that key, with the description replaced by ``. parameters: - $ref: '#/components/parameters/KeyString' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/getApiKeyResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetApiKeyAsync("myTestApiKey"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getApiKey( key: "myTestApiKey", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetApiKey(client.NewApiGetApiKeyRequest( "myTestApiKey")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API GetApiKeyResponse response = client.getApiKey("myTestApiKey"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getApiKey({ key: 'myTestApiKey' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getApiKey(key = "myTestApiKey") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getApiKey( 'myTestApiKey', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_api_key( key="myTestApiKey", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_api_key("myTestApiKey") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getApiKey( key = "myTestApiKey" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getApiKey(key: "myTestApiKey") // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url https://algolia_application_id.algolia.net/1/keys/ALGOLIA_API_KEY \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' put: tags: - Api Keys operationId: updateApiKey x-acl: - admin summary: Update an API key description: | Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value. parameters: - $ref: '#/components/parameters/KeyString' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/apiKey' responses: '200': description: OK content: application/json: schema: title: updateApiKeyResponse type: object additionalProperties: false required: - key - updatedAt properties: key: $ref: '#/components/schemas/keyString' updatedAt: $ref: '#/components/schemas/updatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.UpdateApiKeyAsync( "ALGOLIA_API_KEY", new ApiKey { Acl = new List { Enum.Parse("Search"), Enum.Parse("AddObject") }, Validity = 300, MaxQueriesPerIPPerHour = 100, MaxHitsPerQuery = 20, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.updateApiKey( key: "ALGOLIA_API_KEY", apiKey: ApiKey( acl: [ Acl.fromJson("search"), Acl.fromJson("addObject"), ], validity: 300, maxQueriesPerIPPerHour: 100, maxHitsPerQuery: 20, ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.UpdateApiKey(client.NewApiUpdateApiKeyRequest( "ALGOLIA_API_KEY", search.NewEmptyApiKey().SetAcl( []search.Acl{search.Acl("search"), search.Acl("addObject")}).SetValidity(300).SetMaxQueriesPerIPPerHour(100).SetMaxHitsPerQuery(20))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdateApiKeyResponse response = client.updateApiKey( "ALGOLIA_API_KEY", new ApiKey().setAcl(Arrays.asList(Acl.SEARCH, Acl.ADD_OBJECT)).setValidity(300).setMaxQueriesPerIPPerHour(100).setMaxHitsPerQuery(20) ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.updateApiKey({ key: 'ALGOLIA_API_KEY', apiKey: { acl: ['search', 'addObject'], validity: 300, maxQueriesPerIPPerHour: 100, maxHitsPerQuery: 20 }, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.updateApiKey( key = "ALGOLIA_API_KEY", apiKey = ApiKey( acl = listOf( Acl.entries.first { it.value == "search" }, Acl.entries.first { it.value == "addObject" }, ), validity = 300, maxQueriesPerIPPerHour = 100, maxHitsPerQuery = 20, ), ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->updateApiKey( 'ALGOLIA_API_KEY', ['acl' => [ 'search', 'addObject', ], 'validity' => 300, 'maxQueriesPerIPPerHour' => 100, 'maxHitsPerQuery' => 20, ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.update_api_key( key="ALGOLIA_API_KEY", api_key={ "acl": [ "search", "addObject", ], "validity": 300, "maxQueriesPerIPPerHour": 100, "maxHitsPerQuery": 20, }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.update_api_key( "ALGOLIA_API_KEY", Algolia::Search::ApiKey.new( acl: ["search", "addObject"], validity: 300, max_queries_per_ip_per_hour: 100, max_hits_per_query: 20 ) ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.updateApiKey( key = "ALGOLIA_API_KEY", apiKey = ApiKey( acl = Seq(Acl.withName("search"), Acl.withName("addObject")), validity = Some(300), maxQueriesPerIPPerHour = Some(100), maxHitsPerQuery = Some(20) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.updateApiKey( key: "ALGOLIA_API_KEY", apiKey: ApiKey( acl: [Acl.search, Acl.addObject], maxHitsPerQuery: 20, maxQueriesPerIPPerHour: 100, validity: 300 ) ) // print the response print(response) - lang: cURL label: curl source: |- curl --request PUT \ --url https://algolia_application_id.algolia.net/1/keys/ALGOLIA_API_KEY \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "acl": [ "search", "addObject" ], "description": "Used for indexing by the CLI", "indexes": [ "dev_*", "prod_en_products" ], "maxHitsPerQuery": 0, "maxQueriesPerIPPerHour": 0, "queryParameters": "typoTolerance=strict&restrictSources=192.168.1.0/24", "referers": [ "*algolia.com*" ], "validity": 86400 } ' delete: tags: - Api Keys operationId: deleteApiKey x-acl: - admin summary: Delete an API key description: Deletes the API key. parameters: - $ref: '#/components/parameters/KeyString' responses: '200': description: OK content: application/json: schema: title: deleteApiKeyResponse type: object additionalProperties: false required: - deletedAt properties: deletedAt: $ref: '#/components/schemas/deletedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.DeleteApiKeyAsync("myTestApiKey"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.deleteApiKey( key: "myTestApiKey", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.DeleteApiKey(client.NewApiDeleteApiKeyRequest( "myTestApiKey")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API DeleteApiKeyResponse response = client.deleteApiKey("myTestApiKey"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.deleteApiKey({ key: 'myTestApiKey' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.deleteApiKey(key = "myTestApiKey") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->deleteApiKey( 'myTestApiKey', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_api_key( key="myTestApiKey", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_api_key("myTestApiKey") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.deleteApiKey( key = "myTestApiKey" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.deleteApiKey(key: "myTestApiKey") // print the response print(response) - lang: cURL label: curl source: |- curl --request DELETE \ --url https://algolia_application_id.algolia.net/1/keys/ALGOLIA_API_KEY \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/keys/{key}/restore: post: tags: - Api Keys operationId: restoreApiKey x-acl: - admin summary: Restore an API key description: > Restores a deleted API key. Restoring resets the `validity` attribute to `0`. Algolia stores up to 1,000 API keys per application. If you create more, the oldest API keys are deleted and can't be restored. parameters: - $ref: '#/components/parameters/KeyString' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/addApiKeyResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.RestoreApiKeyAsync("ALGOLIA_API_KEY"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.restoreApiKey( key: "ALGOLIA_API_KEY", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.RestoreApiKey(client.NewApiRestoreApiKeyRequest( "ALGOLIA_API_KEY")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API AddApiKeyResponse response = client.restoreApiKey("ALGOLIA_API_KEY"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.restoreApiKey({ key: 'ALGOLIA_API_KEY' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.restoreApiKey(key = "ALGOLIA_API_KEY") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->restoreApiKey( 'ALGOLIA_API_KEY', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.restore_api_key( key="ALGOLIA_API_KEY", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.restore_api_key("ALGOLIA_API_KEY") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.restoreApiKey( key = "ALGOLIA_API_KEY" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.restoreApiKey(key: "ALGOLIA_API_KEY") // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/keys/ALGOLIA_API_KEY/restore \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/indexes/{indexName}/rules/{objectID}: get: tags: - Rules operationId: getRule x-acl: - settings summary: Retrieve a rule description: > Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](https://www.algolia.com/doc/rest-api/search/search-rules). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ObjectIDRule' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/rule' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetRuleAsync("", "qr-1725004648916"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getRule( indexName: "", objectID: "qr-1725004648916", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetRule(client.NewApiGetRuleRequest( "", "qr-1725004648916")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API Rule response = client.getRule("", "qr-1725004648916"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getRule({ indexName: 'cts_e2e_browse', objectID: 'qr-1725004648916' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getRule(indexName = "", objectID = "qr-1725004648916") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getRule( '', 'qr-1725004648916', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_rule( index_name="", object_id="qr-1725004648916", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_rule("", "qr-1725004648916") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getRule( indexName = "", objectID = "qr-1725004648916" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getRule(indexName: "", objectID: "qr-1725004648916") // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/rules/lorem \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' put: tags: - Rules operationId: saveRule x-acl: - editSettings summary: Create or replace a rule description: > If a rule with the specified object ID doesn't exist, it's created. Otherwise, the existing rule is replaced. To create or update more than one rule, use the [`batch` operation](https://www.algolia.com/doc/rest-api/search/save-rules). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ObjectIDRule' - $ref: '#/components/parameters/ForwardToReplicas' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/rule' responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SaveRuleAsync( "", "id1", new Rule { ObjectID = "id1", Conditions = new List { new Condition { Pattern = "apple", Anchoring = Enum.Parse("Contains") }, }, Consequence = new Consequence { Params = new ConsequenceParams { Filters = "brand:xiaomi" }, }, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.saveRule( indexName: "", objectID: "id1", rule: Rule( objectID: "id1", conditions: [ Condition( pattern: "apple", anchoring: Anchoring.fromJson("contains"), ), ], consequence: Consequence( params: ConsequenceParams( filters: "brand:xiaomi", ), ), ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SaveRule(client.NewApiSaveRuleRequest( "", "id1", search.NewEmptyRule().SetObjectID("id1").SetConditions( []search.Condition{*search.NewEmptyCondition().SetPattern("apple").SetAnchoring(search.Anchoring("contains"))}).SetConsequence( search.NewEmptyConsequence().SetParams( search.NewEmptyConsequenceParams().SetFilters("brand:xiaomi"))))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.saveRule( "", "id1", new Rule() .setObjectID("id1") .setConditions(Arrays.asList(new Condition().setPattern("apple").setAnchoring(Anchoring.CONTAINS))) .setConsequence(new Consequence().setParams(new ConsequenceParams().setFilters("brand:xiaomi"))) ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.saveRule({ indexName: 'indexName', objectID: 'id1', rule: { objectID: 'id1', conditions: [{ pattern: 'apple', anchoring: 'contains' }], consequence: { params: { filters: 'brand:xiaomi' } }, }, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.saveRule( indexName = "", objectID = "id1", rule = Rule( objectID = "id1", conditions = listOf( Condition( pattern = "apple", anchoring = Anchoring.entries.first { it.value == "contains" }, ) ), consequence = Consequence(params = ConsequenceParams(filters = "brand:xiaomi")), ), ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->saveRule( '', 'id1', ['objectID' => 'id1', 'conditions' => [ ['pattern' => 'apple', 'anchoring' => 'contains', ], ], 'consequence' => ['params' => ['filters' => 'brand:xiaomi', ], ], ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.save_rule( index_name="", object_id="id1", rule={ "objectID": "id1", "conditions": [ { "pattern": "apple", "anchoring": "contains", }, ], "consequence": { "params": { "filters": "brand:xiaomi", }, }, }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.save_rule( "", "id1", Algolia::Search::Rule.new( algolia_object_id: "id1", conditions: [Algolia::Search::Condition.new(pattern: "apple", anchoring: "contains")], consequence: Algolia::Search::Consequence.new( params: Algolia::Search::ConsequenceParams.new(filters: "brand:xiaomi") ) ) ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.saveRule( indexName = "", objectID = "id1", rule = Rule( objectID = "id1", conditions = Some( Seq( Condition( pattern = Some("apple"), anchoring = Some(Anchoring.withName("contains")) ) ) ), consequence = Consequence( params = Some( ConsequenceParams( filters = Some("brand:xiaomi") ) ) ) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.saveRule( indexName: "", objectID: "id1", rule: Rule( objectID: "id1", conditions: [SearchCondition(pattern: "apple", anchoring: SearchAnchoring.contains)], consequence: SearchConsequence(params: SearchConsequenceParams(filters: "brand:xiaomi")) ) ) // print the response print(response) - lang: cURL label: curl source: |- curl --request PUT \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/rules/lorem?forwardToReplicas=true' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "objectID": "lorem", "conditions": [ { "pattern": "{facet:genre}", "anchoring": "is", "alternatives": false, "context": "mobile", "filters": "genre:comedy" } ], "consequence": { "params": { "similarQuery": "comedy drama crime Macy Buscemi", "filters": "(category:Book OR category:Ebook) AND _tags:published", "facetFilters": [ [ "category:Book", "category:-Movie" ], "author:John Doe" ], "optionalFilters": [ "category:Book", "author:John Doe" ], "numericFilters": [ [ "inStock = 1", "deliveryDate < 1441755506" ], "price < 1000" ], "tagFilters": [ [ "Book", "Movie" ], "SciFi" ], "sumOrFiltersScores": false, "restrictSearchableAttributes": [ "title", "author" ], "facets": [ "*" ], "facetingAfterDistinct": false, "page": 0, "offset": 42, "length": 0, "aroundLatLng": "40.71,-74.01", "aroundLatLngViaIP": false, "aroundRadius": 1, "aroundPrecision": 10, "minimumAroundRadius": 1, "insideBoundingBox": "lorem", "insidePolygon": [ [ 47.3165, 4.9665, 47.3424, 5.0201, 47.32, 4.9 ], [ 40.9234, 2.1185, 38.643, 1.9916, 39.2587, 2.0104 ] ], "naturalLanguages": [], "ruleContexts": [ "mobile" ], "personalizationImpact": 100, "userToken": "test-user-123", "getRankingInfo": false, "synonyms": true, "clickAnalytics": false, "analytics": true, "analyticsTags": [], "percentileComputation": true, "enableABTest": true, "attributesToRetrieve": [ "author", "title", "content" ], "ranking": [ "typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom" ], "relevancyStrictness": 90, "attributesToHighlight": [ "author", "title", "conten", "content" ], "attributesToSnippet": [ "content:80", "description" ], "highlightPreTag": "", "highlightPostTag": "", "snippetEllipsisText": "…", "restrictHighlightAndSnippetArrays": false, "hitsPerPage": 20, "minWordSizefor1Typo": 4, "minWordSizefor2Typos": 8, "typoTolerance": true, "allowTyposOnNumericTokens": true, "disableTypoToleranceOnAttributes": [ "sku" ], "ignorePlurals": [ "ca", "es" ], "removeStopWords": [ "ca", "es" ], "queryLanguages": [ "es" ], "decompoundQuery": true, "enableRules": true, "enablePersonalization": false, "queryType": "prefixLast", "removeWordsIfNoResults": "firstWords", "mode": "keywordSearch", "semanticSearch": { "eventSources": [ "lorem" ] }, "advancedSyntax": false, "optionalWords": "lorem", "disableExactOnAttributes": [ "description" ], "exactOnSingleWordQuery": "attribute", "alternativesAsExact": [ "ignorePlurals", "singleWordSynonym" ], "advancedSyntaxFeatures": [ "exactPhrase", "excludeWords" ], "distinct": 1, "replaceSynonymsInHighlight": false, "minProximity": 1, "responseFields": [ "*" ], "maxValuesPerFacet": 100, "sortFacetValuesBy": "count", "attributeCriteriaComputedByMinProximity": false, "renderingContent": { "facetOrdering": { "facets": { "order": [ "lorem" ] }, "values": { "property1": { "order": [ "lorem" ], "sortRemainingBy": "count", "hide": [ "lorem" ] }, "property2": { "order": [ "lorem" ], "sortRemainingBy": "count", "hide": [ "lorem" ] } } }, "redirect": { "url": "lorem" }, "widgets": { "banners": [ { "image": { "urls": [ { "url": "lorem" } ], "title": "lorem" }, "link": { "url": "lorem" } } ] } }, "enableReRanking": true, "reRankingApplyFilter": [ [] ], "query": { "remove": [ "lorem" ], "edits": [ { "type": "remove", "delete": "lorem", "insert": "lorem" } ] }, "automaticFacetFilters": [ { "facet": "lorem", "score": 1, "disjunctive": false } ], "automaticOptionalFacetFilters": [ { "facet": "lorem", "score": 1, "disjunctive": false } ] }, "promote": [ { "objectIDs": [ "test-record-123" ], "position": 0 } ], "filterPromotes": false, "hide": [ { "objectID": "test-record-123" } ], "redirect": { "indexName": "lorem" }, "userData": { "settingID": "f2a7b51e3503acc6a39b3784ffb84300", "pluginVersion": "1.6.0" } }, "description": "Display a promotional banner", "enabled": true, "validity": [ { "from": 42, "until": 42 } ], "tags": [ "lorem" ], "scope": "lorem", "condition": { "pattern": "{facet:genre}", "anchoring": "is", "alternatives": false, "context": "mobile", "filters": "genre:comedy" } } ' delete: tags: - Rules operationId: deleteRule x-acl: - editSettings summary: Delete a rule description: > Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](https://www.algolia.com/doc/rest-api/search/search-rules). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ObjectIDRule' - $ref: '#/components/parameters/ForwardToReplicas' responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.DeleteRuleAsync("", "id1"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.deleteRule( indexName: "", objectID: "id1", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.DeleteRule(client.NewApiDeleteRuleRequest( "", "id1")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.deleteRule("", "id1"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.deleteRule({ indexName: 'indexName', objectID: 'id1' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.deleteRule(indexName = "", objectID = "id1") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->deleteRule( '', 'id1', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_rule( index_name="", object_id="id1", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_rule("", "id1") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.deleteRule( indexName = "", objectID = "id1" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.deleteRule(indexName: "", objectID: "id1") // print the response print(response) - lang: cURL label: curl source: |- curl --request DELETE \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/rules/lorem?forwardToReplicas=true' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/indexes/{indexName}/rules/batch: post: tags: - Rules operationId: saveRules x-acl: - editSettings summary: Create or update rules description: > Create or update multiple rules. If a rule with the specified object ID doesn't exist, Algolia creates a new one. Otherwise, existing rules are replaced. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia). x-codegen-request-body-name: rules parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ClearExistingRules' - $ref: '#/components/parameters/ForwardToReplicas' requestBody: required: true content: application/json: schema: type: array description: Rules to add or replace. items: $ref: '#/components/schemas/rule' responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SaveRulesAsync( "", new List { new Rule { ObjectID = "a-rule-id", Conditions = new List { new Condition { Pattern = "smartphone", Anchoring = Enum.Parse("Contains") }, }, Consequence = new Consequence { Params = new ConsequenceParams { Filters = "brand:apple" }, }, }, new Rule { ObjectID = "a-second-rule-id", Conditions = new List { new Condition { Pattern = "apple", Anchoring = Enum.Parse("Contains") }, }, Consequence = new Consequence { Params = new ConsequenceParams { Filters = "brand:samsung" }, }, }, }, false, true ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.saveRules( indexName: "", rules: [ Rule( objectID: "a-rule-id", conditions: [ Condition( pattern: "smartphone", anchoring: Anchoring.fromJson("contains"), ), ], consequence: Consequence( params: ConsequenceParams( filters: "brand:apple", ), ), ), Rule( objectID: "a-second-rule-id", conditions: [ Condition( pattern: "apple", anchoring: Anchoring.fromJson("contains"), ), ], consequence: Consequence( params: ConsequenceParams( filters: "brand:samsung", ), ), ), ], forwardToReplicas: false, clearExistingRules: true, ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SaveRules(client.NewApiSaveRulesRequest( "", []search.Rule{*search.NewEmptyRule().SetObjectID("a-rule-id").SetConditions( []search.Condition{*search.NewEmptyCondition().SetPattern("smartphone").SetAnchoring(search.Anchoring("contains"))}).SetConsequence( search.NewEmptyConsequence().SetParams( search.NewEmptyConsequenceParams().SetFilters("brand:apple"))), *search.NewEmptyRule().SetObjectID("a-second-rule-id").SetConditions( []search.Condition{*search.NewEmptyCondition().SetPattern("apple").SetAnchoring(search.Anchoring("contains"))}).SetConsequence( search.NewEmptyConsequence().SetParams( search.NewEmptyConsequenceParams().SetFilters("brand:samsung")))}).WithForwardToReplicas(false).WithClearExistingRules(true)) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.saveRules( "", Arrays.asList( new Rule() .setObjectID("a-rule-id") .setConditions(Arrays.asList(new Condition().setPattern("smartphone").setAnchoring(Anchoring.CONTAINS))) .setConsequence(new Consequence().setParams(new ConsequenceParams().setFilters("brand:apple"))), new Rule() .setObjectID("a-second-rule-id") .setConditions(Arrays.asList(new Condition().setPattern("apple").setAnchoring(Anchoring.CONTAINS))) .setConsequence(new Consequence().setParams(new ConsequenceParams().setFilters("brand:samsung"))) ), false, true ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.saveRules({ indexName: '', rules: [ { objectID: 'a-rule-id', conditions: [{ pattern: 'smartphone', anchoring: 'contains' }], consequence: { params: { filters: 'brand:apple' } }, }, { objectID: 'a-second-rule-id', conditions: [{ pattern: 'apple', anchoring: 'contains' }], consequence: { params: { filters: 'brand:samsung' } }, }, ], forwardToReplicas: false, clearExistingRules: true, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.saveRules( indexName = "", rules = listOf( Rule( objectID = "a-rule-id", conditions = listOf( Condition( pattern = "smartphone", anchoring = Anchoring.entries.first { it.value == "contains" }, ) ), consequence = Consequence(params = ConsequenceParams(filters = "brand:apple")), ), Rule( objectID = "a-second-rule-id", conditions = listOf( Condition( pattern = "apple", anchoring = Anchoring.entries.first { it.value == "contains" }, ) ), consequence = Consequence(params = ConsequenceParams(filters = "brand:samsung")), ), ), forwardToReplicas = false, clearExistingRules = true, ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->saveRules( '', [ ['objectID' => 'a-rule-id', 'conditions' => [ ['pattern' => 'smartphone', 'anchoring' => 'contains', ], ], 'consequence' => ['params' => ['filters' => 'brand:apple', ], ], ], ['objectID' => 'a-second-rule-id', 'conditions' => [ ['pattern' => 'apple', 'anchoring' => 'contains', ], ], 'consequence' => ['params' => ['filters' => 'brand:samsung', ], ], ], ], false, true, ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.save_rules( index_name="", rules=[ { "objectID": "a-rule-id", "conditions": [ { "pattern": "smartphone", "anchoring": "contains", }, ], "consequence": { "params": { "filters": "brand:apple", }, }, }, { "objectID": "a-second-rule-id", "conditions": [ { "pattern": "apple", "anchoring": "contains", }, ], "consequence": { "params": { "filters": "brand:samsung", }, }, }, ], forward_to_replicas=False, clear_existing_rules=True, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.save_rules( "", [ Algolia::Search::Rule.new( algolia_object_id: "a-rule-id", conditions: [Algolia::Search::Condition.new(pattern: "smartphone", anchoring: "contains")], consequence: Algolia::Search::Consequence.new( params: Algolia::Search::ConsequenceParams.new(filters: "brand:apple") ) ), Algolia::Search::Rule.new( algolia_object_id: "a-second-rule-id", conditions: [Algolia::Search::Condition.new(pattern: "apple", anchoring: "contains")], consequence: Algolia::Search::Consequence.new( params: Algolia::Search::ConsequenceParams.new(filters: "brand:samsung") ) ) ], false, true ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.saveRules( indexName = "", rules = Seq( Rule( objectID = "a-rule-id", conditions = Some( Seq( Condition( pattern = Some("smartphone"), anchoring = Some(Anchoring.withName("contains")) ) ) ), consequence = Consequence( params = Some( ConsequenceParams( filters = Some("brand:apple") ) ) ) ), Rule( objectID = "a-second-rule-id", conditions = Some( Seq( Condition( pattern = Some("apple"), anchoring = Some(Anchoring.withName("contains")) ) ) ), consequence = Consequence( params = Some( ConsequenceParams( filters = Some("brand:samsung") ) ) ) ) ), forwardToReplicas = Some(false), clearExistingRules = Some(true) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.saveRules( indexName: "", rules: [ Rule(objectID: "a-rule-id", conditions: [SearchCondition( pattern: "smartphone", anchoring: SearchAnchoring.contains )], consequence: SearchConsequence(params: SearchConsequenceParams(filters: "brand:apple"))), Rule( objectID: "a-second-rule-id", conditions: [SearchCondition(pattern: "apple", anchoring: SearchAnchoring.contains)], consequence: SearchConsequence(params: SearchConsequenceParams(filters: "brand:samsung")) ), ], forwardToReplicas: false, clearExistingRules: true ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/rules/batch?forwardToReplicas=true&clearExistingRules=true' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' [ { "objectID": "lorem", "conditions": [ { "pattern": "{facet:genre}", "anchoring": "is", "alternatives": false, "context": "mobile", "filters": "genre:comedy" } ], "consequence": { "params": { "similarQuery": "comedy drama crime Macy Buscemi", "filters": "(category:Book OR category:Ebook) AND _tags:published", "facetFilters": [ [ "category:Book", "category:-Movie" ], "author:John Doe" ], "optionalFilters": [ "category:Book", "author:John Doe" ], "numericFilters": [ [ "inStock = 1", "deliveryDate < 1441755506" ], "price < 1000" ], "tagFilters": [ [ "Book", "Movie" ], "SciFi" ], "sumOrFiltersScores": false, "restrictSearchableAttributes": [ "title", "author" ], "facets": [ "*" ], "facetingAfterDistinct": false, "page": 0, "offset": 42, "length": 0, "aroundLatLng": "40.71,-74.01", "aroundLatLngViaIP": false, "aroundRadius": 1, "aroundPrecision": 10, "minimumAroundRadius": 1, "insideBoundingBox": "lorem", "insidePolygon": [ [ 47.3165, 4.9665, 47.3424, 5.0201, 47.32, 4.9 ], [ 40.9234, 2.1185, 38.643, 1.9916, 39.2587, 2.0104 ] ], "naturalLanguages": [], "ruleContexts": [ "mobile" ], "personalizationImpact": 100, "userToken": "test-user-123", "getRankingInfo": false, "synonyms": true, "clickAnalytics": false, "analytics": true, "analyticsTags": [], "percentileComputation": true, "enableABTest": true, "attributesToRetrieve": [ "author", "title", "content" ], "ranking": [ "typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom" ], "relevancyStrictness": 90, "attributesToHighlight": [ "author", "title", "conten", "content" ], "attributesToSnippet": [ "content:80", "description" ], "highlightPreTag": "", "highlightPostTag": "", "snippetEllipsisText": "…", "restrictHighlightAndSnippetArrays": false, "hitsPerPage": 20, "minWordSizefor1Typo": 4, "minWordSizefor2Typos": 8, "typoTolerance": true, "allowTyposOnNumericTokens": true, "disableTypoToleranceOnAttributes": [ "sku" ], "ignorePlurals": [ "ca", "es" ], "removeStopWords": [ "ca", "es" ], "queryLanguages": [ "es" ], "decompoundQuery": true, "enableRules": true, "enablePersonalization": false, "queryType": "prefixLast", "removeWordsIfNoResults": "firstWords", "mode": "keywordSearch", "semanticSearch": { "eventSources": [ "lorem" ] }, "advancedSyntax": false, "optionalWords": "lorem", "disableExactOnAttributes": [ "description" ], "exactOnSingleWordQuery": "attribute", "alternativesAsExact": [ "ignorePlurals", "singleWordSynonym" ], "advancedSyntaxFeatures": [ "exactPhrase", "excludeWords" ], "distinct": 1, "replaceSynonymsInHighlight": false, "minProximity": 1, "responseFields": [ "*" ], "maxValuesPerFacet": 100, "sortFacetValuesBy": "count", "attributeCriteriaComputedByMinProximity": false, "renderingContent": { "facetOrdering": { "facets": { "order": [ "lorem" ] }, "values": { "property1": { "order": [ "lorem" ], "sortRemainingBy": "count", "hide": [ "lorem" ] }, "property2": { "order": [ "lorem" ], "sortRemainingBy": "count", "hide": [ "lorem" ] } } }, "redirect": { "url": "lorem" }, "widgets": { "banners": [ { "image": { "urls": [ { "url": "lorem" } ], "title": "lorem" }, "link": { "url": "lorem" } } ] } }, "enableReRanking": true, "reRankingApplyFilter": [ [] ], "query": { "remove": [ "lorem" ], "edits": [ { "type": "remove", "delete": "lorem", "insert": "lorem" } ] }, "automaticFacetFilters": [ { "facet": "lorem", "score": 1, "disjunctive": false } ], "automaticOptionalFacetFilters": [ { "facet": "lorem", "score": 1, "disjunctive": false } ] }, "promote": [ { "objectIDs": [ "test-record-123" ], "position": 0 } ], "filterPromotes": false, "hide": [ { "objectID": "test-record-123" } ], "redirect": { "indexName": "lorem" }, "userData": { "settingID": "f2a7b51e3503acc6a39b3784ffb84300", "pluginVersion": "1.6.0" } }, "description": "Display a promotional banner", "enabled": true, "validity": [ { "from": 42, "until": 42 } ], "tags": [ "lorem" ], "scope": "lorem", "condition": { "pattern": "{facet:genre}", "anchoring": "is", "alternatives": false, "context": "mobile", "filters": "genre:comedy" } } ] ' /1/indexes/{indexName}/rules/clear: post: tags: - Rules operationId: clearRules x-acl: - editSettings summary: Delete all rules description: Deletes all rules from the index. parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ForwardToReplicas' responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.ClearRulesAsync(""); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.clearRules( indexName: "", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.ClearRules(client.NewApiClearRulesRequest( "")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.clearRules(""); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.clearRules({ indexName: 'indexName' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.clearRules(indexName = "") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->clearRules( '', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.clear_rules( index_name="", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.clear_rules("") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.clearRules( indexName = "" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.clearRules(indexName: "") // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url 'https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/rules/clear?forwardToReplicas=true' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/indexes/{indexName}/rules/search: post: tags: - Rules operationId: searchRules x-mcp-tool: true x-use-read-transporter: true x-cacheable: true x-acl: - settings summary: Search for rules description: Searches for rules in your index. parameters: - $ref: '#/components/parameters/IndexName' requestBody: content: application/json: schema: title: searchRulesParams type: object description: Rules search parameters. additionalProperties: false properties: anchoring: $ref: '#/components/schemas/anchoring' context: type: string description: Only return rules that match the context (exact match). example: mobile enabled: oneOf: - type: boolean description: | If `true`, return only enabled rules. If `false`, return only inactive rules. By default, _all_ rules are returned. - type: 'null' default: null hitsPerPage: $ref: '#/components/schemas/parameters_hitsPerPage' page: $ref: '#/components/schemas/parameters_page' query: $ref: '#/components/schemas/parameters_query' responses: '200': description: OK content: application/json: schema: title: searchRulesResponse type: object additionalProperties: false required: - hits - nbHits - page - nbPages properties: hits: type: array description: Rules that matched the search criteria. items: $ref: '#/components/schemas/rule' nbHits: type: integer description: Number of rules that matched the search criteria. nbPages: type: integer description: Number of pages. page: type: integer description: Current page. '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SearchRulesAsync( "", new SearchRulesParams { Query = "zorro" } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.searchRules( indexName: "", searchRulesParams: SearchRulesParams( query: "zorro", ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SearchRules(client.NewApiSearchRulesRequest( "").WithSearchRulesParams( search.NewEmptySearchRulesParams().SetQuery("zorro"))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API SearchRulesResponse response = client.searchRules("", new SearchRulesParams().setQuery("zorro")); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.searchRules({ indexName: 'cts_e2e_browse', searchRulesParams: { query: 'zorro' } }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.searchRules( indexName = "", searchRulesParams = SearchRulesParams(query = "zorro"), ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->searchRules( '', ['query' => 'zorro', ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_rules( index_name="", search_rules_params={ "query": "zorro", }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_rules("", Algolia::Search::SearchRulesParams.new(query: "zorro")) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.searchRules( indexName = "", searchRulesParams = Some( SearchRulesParams( query = Some("zorro") ) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.searchRules( indexName: "", searchRulesParams: SearchRulesParams(query: "zorro") ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/rules/search \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "query": "", "anchoring": "is", "context": "mobile", "page": 0, "hitsPerPage": 20, "enabled": true } ' /1/dictionaries/{dictionaryName}/batch: post: tags: - Dictionaries operationId: batchDictionaryEntries x-acl: - editSettings description: >- Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries. summary: Add or delete dictionary entries parameters: - $ref: '#/components/parameters/DictionaryName' requestBody: required: true content: application/json: schema: title: batchDictionaryEntriesParams description: Request body for updating dictionary entries. type: object required: - requests additionalProperties: false properties: requests: type: array description: List of additions and deletions to your dictionaries. items: title: batchDictionaryEntriesRequest type: object additionalProperties: false required: - action - body properties: action: $ref: '#/components/schemas/dictionaryAction' body: $ref: '#/components/schemas/dictionaryEntry' clearExistingDictionaryEntries: type: boolean default: false description: >- Whether to replace all custom entries in the dictionary with the ones sent with this request. responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.BatchDictionaryEntriesAsync( Enum.Parse("Plurals"), new BatchDictionaryEntriesParams { ClearExistingDictionaryEntries = true, Requests = new List { new BatchDictionaryEntriesRequest { Action = Enum.Parse("AddEntry"), Body = new DictionaryEntry { ObjectID = "1", Language = Enum.Parse("En"), Word = "fancy", Words = new List { "believe", "algolia" }, Decomposition = new List { "trust", "algolia" }, State = Enum.Parse("Enabled"), }, }, }, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.batchDictionaryEntries( dictionaryName: DictionaryType.fromJson("plurals"), batchDictionaryEntriesParams: BatchDictionaryEntriesParams( clearExistingDictionaryEntries: true, requests: [ BatchDictionaryEntriesRequest( action: DictionaryAction.fromJson("addEntry"), body: DictionaryEntry( objectID: "1", language: SupportedLanguage.fromJson("en"), word: "fancy", words: [ "believe", "algolia", ], decomposition: [ "trust", "algolia", ], state: DictionaryEntryState.fromJson("enabled"), ), ), ], ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.BatchDictionaryEntries(client.NewApiBatchDictionaryEntriesRequest( search.DictionaryType("plurals"), search.NewEmptyBatchDictionaryEntriesParams().SetClearExistingDictionaryEntries(true).SetRequests( []search.BatchDictionaryEntriesRequest{ *search.NewEmptyBatchDictionaryEntriesRequest().SetAction(search.DictionaryAction("addEntry")).SetBody( search.NewEmptyDictionaryEntry().SetObjectID("1").SetLanguage(search.SupportedLanguage("en")).SetWord("fancy").SetWords( []string{"believe", "algolia"}).SetDecomposition( []string{"trust", "algolia"}).SetState(search.DictionaryEntryState("enabled"))), }), )) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.batchDictionaryEntries( DictionaryType.PLURALS, new BatchDictionaryEntriesParams() .setClearExistingDictionaryEntries(true) .setRequests( Arrays.asList( new BatchDictionaryEntriesRequest() .setAction(DictionaryAction.ADD_ENTRY) .setBody( new DictionaryEntry() .setObjectID("1") .setLanguage(SupportedLanguage.EN) .setWord("fancy") .setWords(Arrays.asList("believe", "algolia")) .setDecomposition(Arrays.asList("trust", "algolia")) .setState(DictionaryEntryState.ENABLED) ) ) ) ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.batchDictionaryEntries({ dictionaryName: 'plurals', batchDictionaryEntriesParams: { clearExistingDictionaryEntries: true, requests: [ { action: 'addEntry', body: { objectID: '1', language: 'en', word: 'fancy', words: ['believe', 'algolia'], decomposition: ['trust', 'algolia'], state: 'enabled', }, }, ], }, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.batchDictionaryEntries( dictionaryName = DictionaryType.entries.first { it.value == "plurals" }, batchDictionaryEntriesParams = BatchDictionaryEntriesParams( clearExistingDictionaryEntries = true, requests = listOf( BatchDictionaryEntriesRequest( action = DictionaryAction.entries.first { it.value == "addEntry" }, body = DictionaryEntry( objectID = "1", language = SupportedLanguage.entries.first { it.value == "en" }, word = "fancy", words = listOf("believe", "algolia"), decomposition = listOf("trust", "algolia"), state = DictionaryEntryState.entries.first { it.value == "enabled" }, ), ) ), ), ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->batchDictionaryEntries( 'plurals', ['clearExistingDictionaryEntries' => true, 'requests' => [ ['action' => 'addEntry', 'body' => ['objectID' => '1', 'language' => 'en', 'word' => 'fancy', 'words' => [ 'believe', 'algolia', ], 'decomposition' => [ 'trust', 'algolia', ], 'state' => 'enabled', ], ], ], ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.batch_dictionary_entries( dictionary_name="plurals", batch_dictionary_entries_params={ "clearExistingDictionaryEntries": True, "requests": [ { "action": "addEntry", "body": { "objectID": "1", "language": "en", "word": "fancy", "words": [ "believe", "algolia", ], "decomposition": [ "trust", "algolia", ], "state": "enabled", }, }, ], }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.batch_dictionary_entries( "plurals", Algolia::Search::BatchDictionaryEntriesParams.new( clear_existing_dictionary_entries: true, requests: [ Algolia::Search::BatchDictionaryEntriesRequest.new( action: "addEntry", body: Algolia::Search::DictionaryEntry.new( algolia_object_id: "1", language: "en", word: "fancy", words: ["believe", "algolia"], decomposition: ["trust", "algolia"], state: "enabled" ) ) ] ) ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.batchDictionaryEntries( dictionaryName = DictionaryType.withName("plurals"), batchDictionaryEntriesParams = BatchDictionaryEntriesParams( clearExistingDictionaryEntries = Some(true), requests = Seq( BatchDictionaryEntriesRequest( action = DictionaryAction.withName("addEntry"), body = DictionaryEntry( objectID = "1", language = Some(SupportedLanguage.withName("en")), word = Some("fancy"), words = Some(Seq("believe", "algolia")), decomposition = Some(Seq("trust", "algolia")), state = Some(DictionaryEntryState.withName("enabled")) ) ) ) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.batchDictionaryEntries( dictionaryName: DictionaryType.plurals, batchDictionaryEntriesParams: BatchDictionaryEntriesParams( clearExistingDictionaryEntries: true, requests: [BatchDictionaryEntriesRequest( action: DictionaryAction.addEntry, body: DictionaryEntry( objectID: "1", language: SearchSupportedLanguage.en, word: "fancy", words: ["believe", "algolia"], decomposition: ["trust", "algolia"], state: DictionaryEntryState.enabled ) )] ) ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/dictionaries/plurals/batch \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "clearExistingDictionaryEntries": false, "requests": [ { "action": "addEntry", "body": { "objectID": "828afd405e1f4fe950b6b98c2c43c032", "language": "af", "word": "the", "words": [ "cheval", "cheveaux" ], "decomposition": [ "kopf", "schmerz", "tablette" ], "state": "enabled", "type": "custom" } } ] } ' /1/dictionaries/{dictionaryName}/search: post: tags: - Dictionaries operationId: searchDictionaryEntries x-use-read-transporter: true x-cacheable: true x-acl: - settings description: Searches for standard and custom dictionary entries. summary: Search dictionary entries parameters: - $ref: '#/components/parameters/DictionaryName' requestBody: required: true content: application/json: schema: title: searchDictionaryEntriesParams description: Search parameter. type: object required: - query additionalProperties: false properties: query: $ref: '#/components/schemas/query' hitsPerPage: $ref: '#/components/schemas/hitsPerPage' language: $ref: '#/components/schemas/supportedLanguage' page: $ref: '#/components/schemas/page' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/searchDictionaryEntriesResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SearchDictionaryEntriesAsync( Enum.Parse("Stopwords"), new SearchDictionaryEntriesParams { Query = "about" } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.searchDictionaryEntries( dictionaryName: DictionaryType.fromJson("stopwords"), searchDictionaryEntriesParams: SearchDictionaryEntriesParams( query: "about", ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SearchDictionaryEntries(client.NewApiSearchDictionaryEntriesRequest( search.DictionaryType("stopwords"), search.NewEmptySearchDictionaryEntriesParams().SetQuery("about"))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // parameters // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API SearchDictionaryEntriesResponse response = client.searchDictionaryEntries( DictionaryType.STOPWORDS, new SearchDictionaryEntriesParams().setQuery("about") ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.searchDictionaryEntries({ dictionaryName: 'stopwords', searchDictionaryEntriesParams: { query: 'about' }, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // parameters // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.searchDictionaryEntries( dictionaryName = DictionaryType.entries.first { it.value == "stopwords" }, searchDictionaryEntriesParams = SearchDictionaryEntriesParams(query = "about"), ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->searchDictionaryEntries( 'stopwords', ['query' => 'about', ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_dictionary_entries( dictionary_name="stopwords", search_dictionary_entries_params={ "query": "about", }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_dictionary_entries( "stopwords", Algolia::Search::SearchDictionaryEntriesParams.new(query: "about") ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.searchDictionaryEntries( dictionaryName = DictionaryType.withName("stopwords"), searchDictionaryEntriesParams = SearchDictionaryEntriesParams( query = "about" ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.searchDictionaryEntries( dictionaryName: DictionaryType.stopwords, searchDictionaryEntriesParams: SearchDictionaryEntriesParams(query: "about") ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/dictionaries/plurals/search \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "query": "", "page": 0, "hitsPerPage": 20, "language": "af" } ' /1/dictionaries/*/settings: get: tags: - Dictionaries operationId: getDictionarySettings x-acl: - settings summary: Retrieve dictionary settings description: >- Retrieves the languages for which standard dictionary entries are turned off. responses: '200': description: OK content: application/json: schema: title: getDictionarySettingsResponse additionalProperties: false type: object required: - disableStandardEntries properties: disableStandardEntries: $ref: '#/components/schemas/standardEntries' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetDictionarySettingsAsync(); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getDictionarySettings(); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetDictionarySettings() if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API GetDictionarySettingsResponse response = client.getDictionarySettings(); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getDictionarySettings(); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getDictionarySettings() // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getDictionarySettings(); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_dictionary_settings() # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_dictionary_settings # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getDictionarySettings( ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getDictionarySettings() // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url 'https://algolia_application_id.algolia.net/1/dictionaries/*/settings' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' put: tags: - Dictionaries operationId: setDictionarySettings x-acl: - editSettings description: >- Turns standard stop word dictionary entries on or off for a given language. summary: Update dictionary settings requestBody: required: true content: application/json: schema: title: dictionarySettingsParams type: object additionalProperties: false description: > Turn on or off the built-in Algolia stop words for a specific language. required: - disableStandardEntries properties: disableStandardEntries: $ref: '#/components/schemas/standardEntries' responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SetDictionarySettingsAsync( new DictionarySettingsParams { DisableStandardEntries = new StandardEntries { Plurals = new Dictionary { { "fr", false }, { "en", false }, { "ru", true }, }, }, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.setDictionarySettings( dictionarySettingsParams: DictionarySettingsParams( disableStandardEntries: StandardEntries( plurals: { 'fr': false, 'en': false, 'ru': true, }, ), ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SetDictionarySettings(client.NewApiSetDictionarySettingsRequest( search.NewEmptyDictionarySettingsParams().SetDisableStandardEntries( search.NewEmptyStandardEntries().SetPlurals(map[string]bool{"fr": false, "en": false, "ru": true})))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.setDictionarySettings( new DictionarySettingsParams().setDisableStandardEntries( new StandardEntries().setPlurals( new HashMap() { { put("fr", false); put("en", false); put("ru", true); } } ) ) ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.setDictionarySettings({ disableStandardEntries: { plurals: { fr: false, en: false, ru: true } }, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.setDictionarySettings( dictionarySettingsParams = DictionarySettingsParams( disableStandardEntries = StandardEntries(plurals = mapOf("fr" to false, "en" to false, "ru" to true)) ) ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->setDictionarySettings( ['disableStandardEntries' => ['plurals' => ['fr' => false, 'en' => false, 'ru' => true, ], ], ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.set_dictionary_settings( dictionary_settings_params={ "disableStandardEntries": { "plurals": { "fr": False, "en": False, "ru": True, }, }, }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.set_dictionary_settings( Algolia::Search::DictionarySettingsParams.new( disable_standard_entries: Algolia::Search::StandardEntries.new(plurals: {fr: false, en: false, ru: true}) ) ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.setDictionarySettings( dictionarySettingsParams = DictionarySettingsParams( disableStandardEntries = StandardEntries( plurals = Some(Map("fr" -> false, "en" -> false, "ru" -> true)) ) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client .setDictionarySettings( dictionarySettingsParams: DictionarySettingsParams(disableStandardEntries: StandardEntries(plurals: [ "fr": false, "en": false, "ru": true, ])) ) // print the response print(response) - lang: cURL label: curl source: |- curl --request PUT \ --url 'https://algolia_application_id.algolia.net/1/dictionaries/*/settings' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "disableStandardEntries": { "plurals": { "fr": false }, "stopwords": { "fr": false }, "compounds": { "fr": false } } } ' /1/dictionaries/*/languages: get: tags: - Dictionaries operationId: getDictionaryLanguages x-acl: - settings description: > Lists supported languages with their supported dictionary types and number of custom entries. summary: List available languages externalDocs: url: >- https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages description: Supported languages. responses: '200': description: OK content: application/json: schema: title: getDictionaryLanguagesResponse type: object additionalProperties: x-additionalPropertiesName: language $ref: '#/components/schemas/languages' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetDictionaryLanguagesAsync(); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getDictionaryLanguages(); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetDictionaryLanguages() if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API Map response = client.getDictionaryLanguages(); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getDictionaryLanguages(); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getDictionaryLanguages() // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getDictionaryLanguages(); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_dictionary_languages() # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_dictionary_languages # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getDictionaryLanguages( ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getDictionaryLanguages() // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url 'https://algolia_application_id.algolia.net/1/dictionaries/*/languages' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/clusters/mapping: post: tags: - Clusters operationId: assignUserId deprecated: true x-acl: - admin summary: Assign or move a user ID description: > Assigns or moves a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID. parameters: - $ref: '#/components/parameters/UserIDInHeader' requestBody: required: true content: application/json: schema: title: assignUserIdParams type: object description: Assign userID parameters. additionalProperties: false properties: cluster: $ref: '#/components/schemas/clusterName' required: - cluster responses: '200': $ref: '#/components/responses/CreatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.AssignUserIdAsync( "user42", new AssignUserIdParams { Cluster = "d4242-eu" } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.assignUserId( xAlgoliaUserID: "user42", assignUserIdParams: AssignUserIdParams( cluster: "d4242-eu", ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.AssignUserId(client.NewApiAssignUserIdRequest( "user42", search.NewEmptyAssignUserIdParams().SetCluster("d4242-eu"))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API CreatedAtResponse response = client.assignUserId("user42", new AssignUserIdParams().setCluster("d4242-eu")); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.assignUserId({ xAlgoliaUserID: 'user42', assignUserIdParams: { cluster: 'd4242-eu' } }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.assignUserId( xAlgoliaUserID = "user42", assignUserIdParams = AssignUserIdParams(cluster = "d4242-eu"), ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->assignUserId( 'user42', ['cluster' => 'd4242-eu', ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.assign_user_id( x_algolia_user_id="user42", assign_user_id_params={ "cluster": "d4242-eu", }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.assign_user_id("user42", Algolia::Search::AssignUserIdParams.new(cluster: "d4242-eu")) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.assignUserId( xAlgoliaUserID = "user42", assignUserIdParams = AssignUserIdParams( cluster = "d4242-eu" ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.assignUserId( xAlgoliaUserID: "user42", assignUserIdParams: AssignUserIdParams(cluster: "d4242-eu") ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/clusters/mapping \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --header 'x-algolia-user-id: user1' \ --data ' { "cluster": "c11-test" } ' get: tags: - Clusters operationId: listUserIds deprecated: true x-acl: - admin summary: List user IDs description: > Lists the userIDs assigned to a multi-cluster application. Since it can take a few seconds to get the data from the different clusters, the response isn't real-time. parameters: - $ref: '#/components/parameters/HitsPerPage' - $ref: '#/components/parameters/Page' responses: '200': description: OK content: application/json: schema: title: listUserIdsResponse type: object description: User ID data. properties: userIDs: type: array description: User IDs. items: $ref: '#/components/schemas/userId' required: - userIDs '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.ListUserIdsAsync(); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.listUserIds(); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.ListUserIds(client.NewApiListUserIdsRequest()) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API ListUserIdsResponse response = client.listUserIds(); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.listUserIds(); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.listUserIds() // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->listUserIds(); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.list_user_ids() # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.list_user_ids # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.listUserIds( ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.listUserIds() // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url 'https://algolia_application_id.algolia.net/1/clusters/mapping?page=0&hitsPerPage=100' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/clusters/mapping/batch: post: tags: - Clusters operationId: batchAssignUserIds deprecated: true x-acl: - admin summary: Assign multiple userIDs description: | Assigns multiple user IDs to a cluster. **You can't move users with this operation**. parameters: - $ref: '#/components/parameters/UserIDInHeader' requestBody: required: true content: application/json: schema: title: batchAssignUserIdsParams type: object description: Assign userID parameters. additionalProperties: false properties: cluster: $ref: '#/components/schemas/clusterName' users: type: array description: User IDs to assign. example: - einstein - bohr - feynman items: type: string required: - cluster - users responses: '200': $ref: '#/components/responses/CreatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.BatchAssignUserIdsAsync( "userID", new BatchAssignUserIdsParams { Cluster = "theCluster", Users = new List { "user1", "user2" }, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.batchAssignUserIds( xAlgoliaUserID: "userID", batchAssignUserIdsParams: BatchAssignUserIdsParams( cluster: "theCluster", users: [ "user1", "user2", ], ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.BatchAssignUserIds(client.NewApiBatchAssignUserIdsRequest( "userID", search.NewEmptyBatchAssignUserIdsParams().SetCluster("theCluster").SetUsers( []string{"user1", "user2"}))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API CreatedAtResponse response = client.batchAssignUserIds( "userID", new BatchAssignUserIdsParams().setCluster("theCluster").setUsers(Arrays.asList("user1", "user2")) ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.batchAssignUserIds({ xAlgoliaUserID: 'userID', batchAssignUserIdsParams: { cluster: 'theCluster', users: ['user1', 'user2'] }, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.batchAssignUserIds( xAlgoliaUserID = "userID", batchAssignUserIdsParams = BatchAssignUserIdsParams(cluster = "theCluster", users = listOf("user1", "user2")), ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->batchAssignUserIds( 'userID', ['cluster' => 'theCluster', 'users' => [ 'user1', 'user2', ], ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.batch_assign_user_ids( x_algolia_user_id="userID", batch_assign_user_ids_params={ "cluster": "theCluster", "users": [ "user1", "user2", ], }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.batch_assign_user_ids( "userID", Algolia::Search::BatchAssignUserIdsParams.new(cluster: "theCluster", users: ["user1", "user2"]) ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.batchAssignUserIds( xAlgoliaUserID = "userID", batchAssignUserIdsParams = BatchAssignUserIdsParams( cluster = "theCluster", users = Seq("user1", "user2") ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.batchAssignUserIds( xAlgoliaUserID: "userID", batchAssignUserIdsParams: BatchAssignUserIdsParams(cluster: "theCluster", users: ["user1", "user2"]) ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/clusters/mapping/batch \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --header 'x-algolia-user-id: user1' \ --data ' { "cluster": "c11-test", "users": [ "einstein", "bohr", "feynman" ] } ' /1/clusters/mapping/top: get: tags: - Clusters operationId: getTopUserIds deprecated: true x-acl: - admin summary: Get top user IDs description: > Get the IDs of the 10 users with the highest number of records per cluster. Since it can take a few seconds to get the data from the different clusters, the response isn't real-time. responses: '200': description: OK content: application/json: schema: title: getTopUserIdsResponse type: object description: User IDs and clusters. properties: topUsers: type: array description: >- Key-value pairs with cluster names as keys and lists of users with the highest number of records per cluster as values. items: type: object additionalProperties: x-additionalPropertiesName: cluster type: array items: $ref: '#/components/schemas/userId' required: - topUsers '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetTopUserIdsAsync(); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getTopUserIds(); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetTopUserIds() if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API GetTopUserIdsResponse response = client.getTopUserIds(); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getTopUserIds(); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getTopUserIds() // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getTopUserIds(); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_top_user_ids() # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_top_user_ids # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getTopUserIds( ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getTopUserIds() // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url https://algolia_application_id.algolia.net/1/clusters/mapping/top \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/clusters/mapping/{userID}: get: tags: - Clusters operationId: getUserId deprecated: true x-acl: - admin summary: Retrieve user ID description: > Returns the user ID data stored in the mapping. Since it can take a few seconds to get the data from the different clusters, the response isn't real-time. parameters: - $ref: '#/components/parameters/UserIDInPath' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/userId' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetUserIdAsync("uniqueID"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getUserId( userID: "uniqueID", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetUserId(client.NewApiGetUserIdRequest( "uniqueID")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UserId response = client.getUserId("uniqueID"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getUserId({ userID: 'uniqueID' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getUserId(userID = "uniqueID") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getUserId( 'uniqueID', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_user_id( user_id="uniqueID", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_user_id("uniqueID") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getUserId( userID = "uniqueID" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getUserId(userID: "uniqueID") // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url https://algolia_application_id.algolia.net/1/clusters/mapping/top \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' delete: tags: - Clusters operationId: removeUserId deprecated: true x-acl: - admin summary: Delete user ID description: Deletes a user ID and its associated data from the clusters. parameters: - $ref: '#/components/parameters/UserIDInPath' responses: '200': description: OK content: application/json: schema: title: removeUserIdResponse type: object additionalProperties: false properties: deletedAt: $ref: '#/components/schemas/deletedAt' required: - deletedAt '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.RemoveUserIdAsync("uniqueID"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.removeUserId( userID: "uniqueID", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.RemoveUserId(client.NewApiRemoveUserIdRequest( "uniqueID")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API RemoveUserIdResponse response = client.removeUserId("uniqueID"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.removeUserId({ userID: 'uniqueID' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.removeUserId(userID = "uniqueID") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->removeUserId( 'uniqueID', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.remove_user_id( user_id="uniqueID", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.remove_user_id("uniqueID") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.removeUserId( userID = "uniqueID" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.removeUserId(userID: "uniqueID") // print the response print(response) - lang: cURL label: curl source: |- curl --request DELETE \ --url https://algolia_application_id.algolia.net/1/clusters/mapping/user1 \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/clusters: get: tags: - Clusters operationId: listClusters deprecated: true x-acl: - admin summary: List clusters description: Lists the available clusters in a multi-cluster setup. responses: '200': description: OK content: application/json: schema: title: listClustersResponse type: object description: Clusters. properties: topUsers: type: array description: >- Key-value pairs with cluster names as keys and lists of users with the highest number of records per cluster as values. items: $ref: '#/components/schemas/clusterName' required: - topUsers '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.ListClustersAsync(); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.listClusters(); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.ListClusters() if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API ListClustersResponse response = client.listClusters(); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.listClusters(); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.listClusters() // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->listClusters(); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.list_clusters() # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.list_clusters # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.listClusters( ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.listClusters() // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url https://algolia_application_id.algolia.net/1/clusters \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/clusters/mapping/search: post: tags: - Clusters operationId: searchUserIds deprecated: true x-use-read-transporter: true x-cacheable: true x-acl: - admin summary: Search for user IDs description: > Since it can take a few seconds to get the data from the different clusters, the response isn't real-time. To ensure rapid updates, the user IDs index isn't built at the same time as the mapping. Instead, it's built every 12 hours, at the same time as the update of user ID usage. For example, if you add or move a user ID, the search will show an old value until the next time the mapping is rebuilt (every 12 hours). requestBody: required: true content: application/json: schema: title: searchUserIdsParams type: object description: OK additionalProperties: false properties: query: type: string clusterName: $ref: '#/components/schemas/clusterName' hitsPerPage: $ref: '#/components/schemas/hitsPerPage' page: $ref: '#/components/schemas/page' required: - query responses: '200': description: OK content: application/json: schema: title: searchUserIdsResponse type: object description: userIDs data. properties: hits: type: array description: User objects that match the query. items: title: userHit type: object properties: _highlightResult: title: userHighlightResult type: object properties: clusterName: $ref: '#/components/schemas/highlightResult' userID: $ref: '#/components/schemas/highlightResult' required: - userID - clusterName clusterName: $ref: '#/components/schemas/clusterName' dataSize: $ref: '#/components/schemas/dataSize' nbRecords: $ref: '#/components/schemas/nbRecords' objectID: type: string description: userID of the requested user. Same as userID. userID: $ref: '#/components/schemas/userID' required: - userID - clusterName - nbRecords - dataSize - objectID - _highlightResult hitsPerPage: $ref: '#/components/schemas/parameters_hitsPerPage' nbHits: $ref: '#/components/schemas/nbHits' page: $ref: '#/components/schemas/page' updatedAt: $ref: '#/components/schemas/updatedAt' required: - hits - nbHits - page - hitsPerPage - updatedAt '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.SearchUserIdsAsync( new SearchUserIdsParams { Query = "test", ClusterName = "theClusterName", Page = 5, HitsPerPage = 10, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.searchUserIds( searchUserIdsParams: SearchUserIdsParams( query: "test", clusterName: "theClusterName", page: 5, hitsPerPage: 10, ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.SearchUserIds(client.NewApiSearchUserIdsRequest( search.NewEmptySearchUserIdsParams().SetQuery("test").SetClusterName("theClusterName").SetPage(5).SetHitsPerPage(10))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API SearchUserIdsResponse response = client.searchUserIds( new SearchUserIdsParams().setQuery("test").setClusterName("theClusterName").setPage(5).setHitsPerPage(10) ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.searchUserIds({ query: 'test', clusterName: 'theClusterName', page: 5, hitsPerPage: 10, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.searchUserIds( searchUserIdsParams = SearchUserIdsParams( query = "test", clusterName = "theClusterName", page = 5, hitsPerPage = 10, ) ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->searchUserIds( ['query' => 'test', 'clusterName' => 'theClusterName', 'page' => 5, 'hitsPerPage' => 10, ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_user_ids( search_user_ids_params={ "query": "test", "clusterName": "theClusterName", "page": 5, "hitsPerPage": 10, }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.search_user_ids( Algolia::Search::SearchUserIdsParams.new(query: "test", cluster_name: "theClusterName", page: 5, hits_per_page: 10) ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.searchUserIds( searchUserIdsParams = SearchUserIdsParams( query = "test", clusterName = Some("theClusterName"), page = Some(5), hitsPerPage = Some(10) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.searchUserIds(searchUserIdsParams: SearchUserIdsParams( query: "test", clusterName: "theClusterName", page: 5, hitsPerPage: 10 )) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/clusters/mapping/search \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "query": "lorem", "clusterName": "c11-test", "page": 0, "hitsPerPage": 20 } ' /1/clusters/mapping/pending: get: tags: - Clusters operationId: hasPendingMappings deprecated: true x-acl: - admin summary: Get migration and user mapping status description: > To determine when the time-consuming process of creating a large batch of users or migrating users from one cluster to another is complete, this operation retrieves the status of the process. parameters: - in: query name: getClusters description: >- Whether to include the cluster's pending mapping state in the response. schema: type: boolean responses: '200': description: OK content: application/json: schema: title: hasPendingMappingsResponse type: object additionalProperties: false properties: pending: description: >- Whether there are clusters undergoing migration, creation, or deletion. type: boolean clusters: description: > Cluster pending mapping state: migrating, creating, deleting. type: object additionalProperties: type: array items: type: string required: - pending '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.HasPendingMappingsAsync(); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.hasPendingMappings(); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.HasPendingMappings(client.NewApiHasPendingMappingsRequest()) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API HasPendingMappingsResponse response = client.hasPendingMappings(); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.hasPendingMappings(); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.hasPendingMappings() // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->hasPendingMappings(); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.has_pending_mappings() # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.has_pending_mappings # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.hasPendingMappings( ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.hasPendingMappings() // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url 'https://algolia_application_id.algolia.net/1/clusters/mapping/pending?getClusters=true' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/security/sources: get: tags: - Vaults operationId: getSources x-acl: - admin summary: List allowed sources description: Retrieves all allowed IP addresses with access to your application. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/sources' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetSourcesAsync(); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getSources(); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetSources() if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API List response = client.getSources(); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getSources(); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getSources() // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getSources(); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_sources() # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_sources # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getSources( ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getSources() // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url https://algolia_application_id.algolia.net/1/security/sources \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' put: tags: - Vaults operationId: replaceSources x-acl: - admin summary: Replace allowed sources description: Replaces the list of allowed sources. requestBody: required: true description: Allowed sources. content: application/json: schema: $ref: '#/components/schemas/sources' responses: '200': description: OK content: application/json: schema: title: replaceSourceResponse type: object additionalProperties: false required: - updatedAt properties: updatedAt: $ref: '#/components/schemas/updatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.ReplaceSourcesAsync( new List { new Source { VarSource = "theSource", Description = "theDescription" }, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.replaceSources( source: [ Source( source: "theSource", description: "theDescription", ), ], ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.ReplaceSources(client.NewApiReplaceSourcesRequest( []search.Source{*search.NewEmptySource().SetSource("theSource").SetDescription("theDescription")})) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API ReplaceSourceResponse response = client.replaceSources( Arrays.asList(new Source().setSource("theSource").setDescription("theDescription")) ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.replaceSources({ source: [{ source: 'theSource', description: 'theDescription' }] }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.replaceSources( source = listOf(Source(source = "theSource", description = "theDescription")) ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->replaceSources( [ ['source' => 'theSource', 'description' => 'theDescription', ], ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.replace_sources( source=[ { "source": "theSource", "description": "theDescription", }, ], ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.replace_sources([Algolia::Search::Source.new(source: "theSource", description: "theDescription")]) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.replaceSources( source = Seq( Source( source = "theSource", description = Some("theDescription") ) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.replaceSources(source: [SearchSource( source: "theSource", description: "theDescription" )]) // print the response print(response) - lang: cURL label: curl source: |- curl --request PUT \ --url https://algolia_application_id.algolia.net/1/security/sources \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' [ { "source": "10.0.0.1/32", "description": "Server subnet" } ] ' /1/security/sources/append: post: tags: - Vaults operationId: appendSource x-acl: - admin description: Adds a source to the list of allowed sources. summary: Add a source requestBody: required: true description: Source to add. content: application/json: schema: $ref: '#/components/schemas/source' responses: '200': $ref: '#/components/responses/CreatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.AppendSourceAsync( new Source { VarSource = "theSource", Description = "theDescription" } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.appendSource( source: Source( source: "theSource", description: "theDescription", ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.AppendSource(client.NewApiAppendSourceRequest( search.NewEmptySource().SetSource("theSource").SetDescription("theDescription"))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API CreatedAtResponse response = client.appendSource(new Source().setSource("theSource").setDescription("theDescription")); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.appendSource({ source: 'theSource', description: 'theDescription' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.appendSource(source = Source(source = "theSource", description = "theDescription")) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->appendSource( ['source' => 'theSource', 'description' => 'theDescription', ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.append_source( source={ "source": "theSource", "description": "theDescription", }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.append_source(Algolia::Search::Source.new(source: "theSource", description: "theDescription")) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.appendSource( source = Source( source = "theSource", description = Some("theDescription") ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.appendSource(source: SearchSource( source: "theSource", description: "theDescription" )) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/security/sources/append \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "source": "10.0.0.1/32", "description": "Server subnet" } ' /1/security/sources/{source}: delete: tags: - Vaults operationId: deleteSource x-acl: - admin description: Deletes a source from the list of allowed sources. summary: Delete a source parameters: - name: source in: path required: true description: IP address range of the source. schema: type: string example: 10.0.0.1/32 responses: '200': description: OK content: application/json: schema: title: deleteSourceResponse type: object additionalProperties: false required: - deletedAt properties: deletedAt: $ref: '#/components/schemas/deletedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.DeleteSourceAsync("theSource"); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.deleteSource( source: "theSource", ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.DeleteSource(client.NewApiDeleteSourceRequest( "theSource")) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API DeleteSourceResponse response = client.deleteSource("theSource"); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.deleteSource({ source: 'theSource' }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.deleteSource(source = "theSource") // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->deleteSource( 'theSource', ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_source( source="theSource", ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.delete_source("theSource") # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.deleteSource( source = "theSource" ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.deleteSource(source: "theSource") // print the response print(response) - lang: cURL label: curl source: |- curl --request DELETE \ --url https://algolia_application_id.algolia.net/1/security/sources/10.0.0.1%2F32 \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/logs: get: tags: - Advanced operationId: getLogs x-acl: - logs description: > The request must be authenticated by an API key with the [`logs` ACL](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). - Logs are held for the last seven days. - Up to 1,000 API requests per server are logged. - This request counts towards your [operations quota](https://support.algolia.com/hc/articles/17245378392977-How-does-Algolia-count-records-and-operations) but doesn't appear in the logs itself. summary: Retrieve log entries parameters: - name: indexName in: query description: | Index for which to retrieve log entries. By default, log entries are retrieved for all indices. example: products schema: oneOf: - type: string - type: 'null' - name: length in: query description: Maximum number of entries to retrieve. schema: type: integer default: 10 maximum: 1000 - name: offset in: query description: >- First log entry to retrieve. The most recent entries are listed first. schema: type: integer default: 0 - name: type in: query description: | Type of log entries to retrieve. By default, all log entries are retrieved. schema: $ref: '#/components/schemas/logType' responses: '200': description: OK content: application/json: schema: title: getLogsResponse type: object additionalProperties: false required: - logs properties: logs: type: array items: title: log type: object properties: answer: type: string maxLength: 1000 description: Response body. example: > 'n{\n "results": [\n {\n "hits": [\n {\n "name": "Amazon - Fire TV Stick",\n "description": "Amazon Fire TV Stick connects to your TV's HDMI port. Just grab and go to enjoy Netflix, Prime Instant Video, Hulu Plus, YouTube.com, music, and much more.",\n "brand": "Amazon",\n "categories": [\n "TV & Home Theater",\n "Streaming Media Players"\n ],\n "hierarchicalCategories": {\n "lvl0": "TV & Home Theater",\n "lvl1": "TV & Home Theater > Streaming Media Players"\n },\n "type": "Streaming media player",\n "price": 39.99,\n "price_range": "1 }\n ]\n }\n ]\n}' answer_code: type: string description: HTTP status code of the response. example: '200' ip: type: string format: ipv4 description: IP address of the client that performed the request. example: 93.184.216.34 method: type: string description: HTTP method of the request. example: GET processing_time_ms: type: string description: | Processing time for the query in milliseconds. This doesn't include latency due to the network. example: '2' query_body: type: string maxLength: 1000 description: Request body. example: >- {\n \"requests\": [\n {\n \"indexName\": \"best_buy\",\n \"params\": \"query=&hitsPerPage=10&page=0&attributesToRetrieve=*&highlightPreTag=%3Cais-highlight-0000000000%3E&highlightPostTag=%3C%2Fais-highlight-0000000000%3E&getRankingInfo=1&facets=%5B%22brand%22%2C%22categories%22%2C%22free_shipping%22%2C%22type%22%5D&tagFilters=\"\n }\n ]\n}\n query_headers: type: string description: Request headers (API keys are obfuscated). example: >- User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5\nHost: example.com\nAccept: */*\nContent-Type: application/json; charset=utf-8\nX-Algolia-API-Key: 20f***************************\nX-Algolia-Application-Id: MyApplicationID\n sha1: type: string description: SHA1 signature of the log entry. example: 26c53bd7e38ca71f4741b71994cd94a600b7ac68 timestamp: type: string description: >- Date and time of the API request, in RFC 3339 format. example: '2023-03-08T12:34:56Z' url: type: string format: uri-reference description: URL of the API endpoint. example: /1/indexes index: type: string description: Index targeted by the query. example: products inner_queries: type: array description: Queries performed for the given request. items: title: logQuery type: object properties: index_name: type: string description: Index targeted by the query. example: products query_id: type: string description: Unique query identifier. example: 96f59a3145dd9bd8963dc223950507c8 user_token: type: string description: A user identifier. example: 93.189.166.128 nb_api_calls: type: string description: Number of API requests. example: '1' query_nb_hits: type: string description: >- Number of search results (hits) returned for the query. example: '1' query_params: type: string description: Query parameters sent with the request. example: query=georgia&attributesToRetrieve=name,city,country required: - timestamp - method - answer_code - query_body - answer - url - ip - query_headers - sha1 - processing_time_ms '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetLogsAsync(); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getLogs(); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetLogs(client.NewApiGetLogsRequest()) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API GetLogsResponse response = client.getLogs(); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getLogs(); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getLogs() // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getLogs(); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_logs() # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_logs # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getLogs( ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getLogs() // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url 'https://algolia_application_id.algolia.net/1/logs?offset=0&length=10&indexName=products&type=all' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/task/{taskID}: get: tags: - Advanced operationId: getAppTask x-acl: - editSettings description: | Checks the status of a given application task. summary: Check application task status parameters: - name: taskID in: path description: Unique task identifier. required: true schema: type: integer format: int64 example: 1506303845001 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/GetTaskResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetAppTaskAsync(123L); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getAppTask( taskID: 123, ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetAppTask(client.NewApiGetAppTaskRequest( 123)) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API GetTaskResponse response = client.getAppTask(123L); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getAppTask({ taskID: 123 }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getAppTask(taskID = 123L) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getAppTask( 123, ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_app_task( task_id=123, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_app_task(123) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getAppTask( taskID = 123L ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getAppTask(taskID: Int64(123)) // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url https://algolia_application_id.algolia.net/1/task/1506303845001 \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/indexes/{indexName}/task/{taskID}: get: tags: - Indices operationId: getTask x-acl: - addObject description: > Checks the status of a given task. Indexing tasks are asynchronous. When you add, update, or delete records or indices, a task is created on a queue and completed depending on the load on the server. The indexing tasks' responses include a task ID that you can use to check the status. summary: Check task status parameters: - $ref: '#/components/parameters/IndexName' - name: taskID in: path description: Unique task identifier. required: true schema: type: integer format: int64 example: 1506303845001 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/GetTaskResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.GetTaskAsync("", 123L); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.getTask( indexName: "", taskID: 123, ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.GetTask(client.NewApiGetTaskRequest( "", 123)) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API GetTaskResponse response = client.getTask("", 123L); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.getTask({ indexName: 'theIndexName', taskID: 123 }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.getTask(indexName = "", taskID = 123L) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->getTask( '', 123, ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_task( index_name="", task_id=123, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.get_task("", 123) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.getTask( indexName = "", taskID = 123L ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.getTask(indexName: "", taskID: Int64(123)) // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/task/1506303845001 \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' /1/indexes/{indexName}/operation: post: tags: - Indices operationId: operationIndex x-acl: - addObject summary: Copy or move an index description: > Copies or moves (renames) an index within the same Algolia application. Notes: - Existing destination indices are overwritten, except for their analytics data. - If the destination index doesn't exist yet, it's created. - This operation is resource-intensive. **Copy** - If the source index doesn't exist, copying creates a new index with 0 records and default settings. - API keys from the source index are merged with the existing keys in the destination index. - You can't copy the `enableReRanking`, `mode`, and `replicas` settings. - You can't copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - For more information, see [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices). **Move** - If the source index doesn't exist, moving is ignored without returning an error. - When moving an index, the analytics data keeps its original name, and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - For more information, see [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices). This operation is subject to [indexing rate limits](https://support.algolia.com/hc/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia). parameters: - $ref: '#/components/parameters/IndexName' requestBody: required: true content: application/json: schema: title: operationIndexParams type: object additionalProperties: false properties: destination: $ref: '#/components/schemas/indexName' operation: $ref: '#/components/schemas/operationType' scope: type: array items: $ref: '#/components/schemas/scopeType' description: > **Only for copying.** If you specify a scope, only the selected scopes are copied. Records and the other scopes are left unchanged. If you omit the `scope` parameter, everything is copied: records, settings, synonyms, and rules. required: - operation - destination responses: '200': $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.OperationIndexAsync( "", new OperationIndexParams { Operation = Enum.Parse("Move"), Destination = "", Scope = new List { Enum.Parse("Rules"), Enum.Parse("Settings"), }, } ); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.operationIndex( indexName: "", operationIndexParams: OperationIndexParams( operation: OperationType.fromJson("move"), destination: "", scope: [ ScopeType.fromJson("rules"), ScopeType.fromJson("settings"), ], ), ); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.OperationIndex(client.NewApiOperationIndexRequest( "", search.NewEmptyOperationIndexParams().SetOperation(search.OperationType("move")).SetDestination("").SetScope( []search.ScopeType{search.ScopeType("rules"), search.ScopeType("settings")}))) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API UpdatedAtResponse response = client.operationIndex( "", new OperationIndexParams() .setOperation(OperationType.MOVE) .setDestination("") .setScope(Arrays.asList(ScopeType.RULES, ScopeType.SETTINGS)) ); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.operationIndex({ indexName: '', operationIndexParams: { operation: 'move', destination: '', scope: ['rules', 'settings'] }, }); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.operationIndex( indexName = "", operationIndexParams = OperationIndexParams( operation = OperationType.entries.first { it.value == "move" }, destination = "", scope = listOf( ScopeType.entries.first { it.value == "rules" }, ScopeType.entries.first { it.value == "settings" }, ), ), ) // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->operationIndex( '', ['operation' => 'move', 'destination' => '', 'scope' => [ 'rules', 'settings', ], ], ); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.operation_index( index_name="", operation_index_params={ "operation": "move", "destination": "", "scope": [ "rules", "settings", ], }, ) # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.operation_index( "", Algolia::Search::OperationIndexParams.new( operation: "move", destination: "", scope: ["rules", "settings"] ) ) # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.operationIndex( indexName = "", operationIndexParams = OperationIndexParams( operation = OperationType.withName("move"), destination = "", scope = Some(Seq(ScopeType.withName("rules"), ScopeType.withName("settings"))) ) ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.operationIndex( indexName: "", operationIndexParams: OperationIndexParams( operation: OperationType.move, destination: "", scope: [ScopeType.rules, ScopeType.settings] ) ) // print the response print(response) - lang: cURL label: curl source: |- curl --request POST \ --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/operation \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ --data ' { "operation": "copy", "destination": "products", "scope": [ "settings" ] } ' /1/indexes: get: tags: - Indices operationId: listIndices x-mcp-tool: true x-acl: - listIndexes summary: List indices description: > Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request. parameters: - $ref: '#/components/parameters/HitsPerPage' - $ref: '#/components/parameters/Page' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/listIndicesResponse' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/FeatureNotEnabled' '403': $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' x-codeSamples: - lang: csharp label: C# source: >- // Initialize the client var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")); // Call the API var response = await client.ListIndicesAsync(); // print the response Console.WriteLine(response); - lang: dart label: Dart source: |- // Initialize the client final client = SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'); // Call the API final response = await client.listIndices(); // print the response print(response); - lang: go label: Go source: >- // Initialize the client client, err := search.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) } // Call the API response, err := client.ListIndices(client.NewApiListIndicesRequest()) if err != nil { // handle the eventual error panic(err) } // print the response print(response) - lang: java label: Java source: >- // Initialize the client SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"); // Call the API ListIndicesResponse response = client.listIndices(); // print the response System.out.println(response); - lang: javascript label: JavaScript source: >- // Initialize the client const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API const response = await client.listIndices(); // print the response console.log(response); - lang: kotlin label: Kotlin source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API var response = client.listIndices() // print the response println(response) - lang: php label: PHP source: >- // Initialize the client $client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'); // Call the API $response = $client->listIndices(); // print the response var_dump($response); - lang: python label: Python source: >- # Initialize the client # In an asynchronous context, you can use SearchClient instead, which exposes the exact same methods. client = SearchClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.list_indices() # print the response print(response) - lang: ruby label: Ruby source: >- # Initialize the client client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") # Call the API response = client.list_indices # print the response puts(response) - lang: scala label: Scala source: >- // Initialize the client val client = SearchClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY") // Call the API val response = Await.result( client.listIndices( ), Duration(100, "sec") ) // print the response println(response) - lang: swift label: Swift source: >- // Initialize the client let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY") // Call the API let response = try await client.listIndices() // print the response print(response) - lang: cURL label: curl source: |- curl --request GET \ --url 'https://algolia_application_id.algolia.net/1/indexes?page=0&hitsPerPage=100' \ --header 'accept: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' components: securitySchemes: appId: type: apiKey in: header name: x-algolia-application-id description: Your Algolia application ID. apiKey: type: apiKey in: header name: x-algolia-api-key description: > Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference. schemas: attributeToUpdate: x-keep-model: true deprecated: true oneOf: - type: string - $ref: '#/components/schemas/builtInOperation' ErrorBase: description: Error. type: object x-keep-model: true additionalProperties: true properties: message: type: string example: Invalid Application-Id or API-Key paramsAsString: description: Search parameters as a URL-encoded query string. example: hitsPerPage=2&getRankingInfo=1 type: string default: '' searchParamsString: type: object title: Search parameters as query string description: Search parameters as query string. additionalProperties: false x-discriminator-fields: - params properties: params: $ref: '#/components/schemas/paramsAsString' query: type: string description: Search query. default: '' x-categories: - Search searchParamsQuery: type: object additionalProperties: false properties: query: $ref: '#/components/schemas/query' similarQuery: type: string description: > Keywords to be used instead of the search query to conduct a more broader search Using the `similarQuery` parameter changes other settings - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords` Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results. default: '' example: comedy drama crime Macy Buscemi x-categories: - Search filters: type: string description: > Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** ` `, where `` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `: TO `, where `` and `` are the lower and upper limits of the range (inclusive). - **Facet filters.** `:`, where `` is a facet attribute (case-sensitive) and `` a facet value. - **Tag filters.** `_tags:` or just `` (case-sensitive). - **Boolean filters.** `: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can't use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can't combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes if the facet attribute name or facet value contains spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering). example: (category:Book OR category:Ebook) AND _tags:published x-categories: - Filtering facetFilters: description: > Filter the search by facet values, so that only records with the same facet values are retrieved. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** - `[filter1, filter2]` is interpreted as `filter1 AND filter2`. - `[[filter1, filter2], filter3]` is interpreted as `filter1 OR filter2 AND filter3`. - `facet:-value` is interpreted as `NOT facet:value`. While it's best to avoid attributes that start with a `-`, you can still filter them by escaping with a backslash: `facet:\-value`. example: - - category:Book - category:-Movie - author:John Doe oneOf: - type: array items: $ref: '#/components/schemas/facetFilters' - type: string x-categories: - Filtering optionalFilters: description: > Filters to promote or demote records in the search results. Optional filters work like facet filters, but they don't exclude records from the search results. Records that match the optional filter rank before records that don't match. If you're using a negative filter `facet:-value`, matching records rank after records that don't match. - Optional filters are applied _after_ sort-by attributes. - Optional filters are applied _before_ custom ranking attributes (in the default [ranking](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria)). - Optional filters don't work with numeric attributes. - On virtual replicas, optional filters are applied _after_ the replica's [relevant sort](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/relevant-sort). example: - category:Book - author:John Doe oneOf: - type: array items: $ref: '#/components/schemas/optionalFilters' - type: string x-categories: - Filtering numericFilters: description: > Filter by numeric facets. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** You can use numeric comparison operators: `<`, `<=`, `=`, `!=`, `>`, `>=`. Comparisons are precise up to 3 decimals. You can also provide ranges: `facet: TO `. The range includes the lower and upper boundaries. The same combination rules apply as for `facetFilters`. example: - - inStock = 1 - deliveryDate < 1441755506 - price < 1000 oneOf: - type: array items: $ref: '#/components/schemas/numericFilters' - type: string x-categories: - Filtering tagFilters: description: > Filter the search by values of the special `_tags` attribute. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** Different from regular facets, `_tags` can only be used for filtering (including or excluding records). You won't get a facet count. The same combination and escaping rules apply as for `facetFilters`. example: - - Book - Movie - SciFi oneOf: - type: array items: $ref: '#/components/schemas/tagFilters' - type: string x-categories: - Filtering sumOrFiltersScores: type: boolean description: > Whether to sum all filter scores If true, all filter scores are summed. Otherwise, the maximum filter score is kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). default: false x-categories: - Filtering restrictSearchableAttributes: type: array items: type: string example: - title - author description: | Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive. default: [] x-categories: - Filtering facetingAfterDistinct: type: boolean description: > Whether faceting should be applied after deduplication with `distinct` This leads to accurate facet counts when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`. default: false x-categories: - Faceting page: type: integer description: Page of search results to retrieve. default: 0 minimum: 0 x-categories: - Pagination length: type: integer description: Number of hits to retrieve (used in combination with `offset`). minimum: 0 maximum: 1000 x-categories: - Pagination aroundLatLng: type: string description: > Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`. example: 40.71,-74.01 default: '' x-categories: - Geo-Search aroundLatLngViaIP: type: boolean description: Whether to obtain the coordinates from the request's IP address. default: false x-categories: - Geo-Search aroundRadiusAll: title: all type: string description: >- Return all records with a valid `_geoloc` attribute. Don't filter by distance. enum: - all aroundRadius: description: > Maximum radius for a search around a central location. This parameter works in combination with the `aroundLatLng` and `aroundLatLngViaIP` parameters. By default, the search radius is determined automatically from the density of hits around the central location. The search radius is small if there are many hits close to the central coordinates. oneOf: - type: integer minimum: 1 description: Maximum search radius around a central location in meters. - $ref: '#/components/schemas/aroundRadiusAll' x-categories: - Geo-Search aroundPrecisionFromValue: title: range objects type: array items: title: range type: object description: >- Range object with lower and upper values in meters to define custom ranges. properties: from: type: integer description: >- Lower boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal. example: 20 value: type: integer description: >- Upper boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal. aroundPrecision: description: > Precision of a coordinate-based search in meters to group results with similar distances. The Geo ranking criterion considers all matches within the same range of distances to be equal. oneOf: - type: integer default: 10 description: > Distance in meters to group results by similar distances. For example, if you set `aroundPrecision` to 100, records wihin 100 meters to the central coordinate are considered to have the same distance, as are records between 100 and 199 meters. - $ref: '#/components/schemas/aroundPrecisionFromValue' x-categories: - Geo-Search minimumAroundRadius: type: integer description: >- Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. minimum: 1 x-categories: - Geo-Search insideBoundingBoxArray: type: array items: type: array minItems: 4 maxItems: 4 items: type: number format: double description: > Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). example: - - 47.3165 - 4.9665 - 47.3424 - 5.0201 - - 40.9234 - 2.1185 - 38.643 - 1.9916 x-categories: - Geo-Search insideBoundingBox: oneOf: - type: string - type: 'null' - $ref: '#/components/schemas/insideBoundingBoxArray' insidePolygon: type: array items: type: array minItems: 6 maxItems: 20000 items: type: number format: double description: > Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. example: - - 47.3165 - 4.9665 - 47.3424 - 5.0201 - 47.32 - 4.9 - - 40.9234 - 2.1185 - 38.643 - 1.9916 - 39.2587 - 2.0104 x-categories: - Geo-Search supportedLanguage: type: string description: ISO code for a supported language. enum: - af - ar - az - bg - bn - ca - cs - cy - da - de - el - en - eo - es - et - eu - fa - fi - fo - fr - ga - gl - he - hi - hu - hy - id - is - it - ja - ka - kk - ko - ku - ky - lt - lv - mi - mn - mr - ms - mt - nb - nl - 'no' - ns - pl - ps - pt - pt-br - qu - ro - ru - sk - sq - sv - sw - ta - te - th - tl - tn - tr - tt - uk - ur - uz - zh naturalLanguages: type: array items: $ref: '#/components/schemas/supportedLanguage' description: > ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches) - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. default: [] x-categories: - Languages ruleContexts: type: array items: type: string description: > Assigns a rule context to the search query [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. default: [] example: - mobile x-categories: - Rules personalizationImpact: type: integer description: > Impact that Personalization should have on this search The higher this value is, the more Personalization determines the ranking compared to other factors. For more information, see [Understanding Personalization impact](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact). default: 100 minimum: 0 maximum: 100 x-categories: - Personalization userToken: type: string description: > Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken). example: test-user-123 x-categories: - Personalization getRankingInfo: type: boolean description: Whether the search response should include detailed ranking information. default: false x-categories: - Advanced synonyms: type: boolean description: Whether to take into account an index's synonyms for this search. default: true x-categories: - Advanced clickAnalytics: type: boolean description: > Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started). default: false x-categories: - Analytics analytics: type: boolean description: Whether this search will be included in Analytics. default: true x-categories: - Analytics analyticsTags: type: array items: type: string description: >- Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments). default: [] percentileComputation: type: boolean description: >- Whether to include this search when calculating processing-time percentiles. default: true x-categories: - Advanced enableABTest: type: boolean description: Whether to enable A/B testing for this search. default: true x-categories: - Advanced baseSearchParamsWithoutQuery: type: object additionalProperties: false properties: analytics: $ref: '#/components/schemas/analytics' analyticsTags: $ref: '#/components/schemas/analyticsTags' x-categories: - Analytics aroundLatLng: $ref: '#/components/schemas/aroundLatLng' aroundLatLngViaIP: $ref: '#/components/schemas/aroundLatLngViaIP' aroundPrecision: $ref: '#/components/schemas/aroundPrecision' aroundRadius: $ref: '#/components/schemas/aroundRadius' clickAnalytics: $ref: '#/components/schemas/clickAnalytics' enableABTest: $ref: '#/components/schemas/enableABTest' facetFilters: $ref: '#/components/schemas/facetFilters' facetingAfterDistinct: $ref: '#/components/schemas/facetingAfterDistinct' facets: type: array items: type: string description: > Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts). default: [] example: - '*' x-categories: - Faceting filters: $ref: '#/components/schemas/filters' getRankingInfo: $ref: '#/components/schemas/getRankingInfo' insideBoundingBox: $ref: '#/components/schemas/insideBoundingBox' insidePolygon: $ref: '#/components/schemas/insidePolygon' length: $ref: '#/components/schemas/length' minimumAroundRadius: $ref: '#/components/schemas/minimumAroundRadius' naturalLanguages: $ref: '#/components/schemas/naturalLanguages' numericFilters: $ref: '#/components/schemas/numericFilters' offset: type: integer description: Position of the first hit to retrieve. x-categories: - Pagination optionalFilters: $ref: '#/components/schemas/optionalFilters' page: $ref: '#/components/schemas/page' percentileComputation: $ref: '#/components/schemas/percentileComputation' personalizationImpact: $ref: '#/components/schemas/personalizationImpact' restrictSearchableAttributes: $ref: '#/components/schemas/restrictSearchableAttributes' ruleContexts: $ref: '#/components/schemas/ruleContexts' similarQuery: $ref: '#/components/schemas/similarQuery' sumOrFiltersScores: $ref: '#/components/schemas/sumOrFiltersScores' synonyms: $ref: '#/components/schemas/synonyms' tagFilters: $ref: '#/components/schemas/tagFilters' userToken: $ref: '#/components/schemas/userToken' baseSearchParams: type: object properties: analytics: $ref: '#/components/schemas/analytics' analyticsTags: $ref: '#/components/schemas/analyticsTags' x-categories: - Analytics aroundLatLng: $ref: '#/components/schemas/aroundLatLng' aroundLatLngViaIP: $ref: '#/components/schemas/aroundLatLngViaIP' aroundPrecision: $ref: '#/components/schemas/aroundPrecision' aroundRadius: $ref: '#/components/schemas/aroundRadius' clickAnalytics: $ref: '#/components/schemas/clickAnalytics' enableABTest: $ref: '#/components/schemas/enableABTest' facetFilters: $ref: '#/components/schemas/facetFilters' facetingAfterDistinct: $ref: '#/components/schemas/facetingAfterDistinct' facets: type: array items: type: string description: > Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts). default: [] example: - '*' x-categories: - Faceting filters: $ref: '#/components/schemas/filters' getRankingInfo: $ref: '#/components/schemas/getRankingInfo' insideBoundingBox: $ref: '#/components/schemas/insideBoundingBox' insidePolygon: $ref: '#/components/schemas/insidePolygon' length: $ref: '#/components/schemas/length' minimumAroundRadius: $ref: '#/components/schemas/minimumAroundRadius' naturalLanguages: $ref: '#/components/schemas/naturalLanguages' numericFilters: $ref: '#/components/schemas/numericFilters' offset: type: integer description: Position of the first hit to retrieve. x-categories: - Pagination optionalFilters: $ref: '#/components/schemas/optionalFilters' page: $ref: '#/components/schemas/page' percentileComputation: $ref: '#/components/schemas/percentileComputation' personalizationImpact: $ref: '#/components/schemas/personalizationImpact' query: $ref: '#/components/schemas/query' restrictSearchableAttributes: $ref: '#/components/schemas/restrictSearchableAttributes' ruleContexts: $ref: '#/components/schemas/ruleContexts' similarQuery: $ref: '#/components/schemas/similarQuery' sumOrFiltersScores: $ref: '#/components/schemas/sumOrFiltersScores' synonyms: $ref: '#/components/schemas/synonyms' tagFilters: $ref: '#/components/schemas/tagFilters' userToken: $ref: '#/components/schemas/userToken' additionalProperties: false attributesToRetrieve: type: array items: type: string example: - author - title - content description: > Attributes to include in the API response To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `["*", "-ATTRIBUTE"]`. - The `objectID` attribute is always included. default: - '*' x-categories: - Attributes relevancyStrictness: type: integer example: 90 description: > Relevancy threshold below which less relevant results aren't included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results. default: 100 x-categories: - Ranking attributesToHighlight: type: array items: type: string example: - author - title - conten - content description: > Attributes to highlight By default, all searchable attributes are highlighted. Use `*` to highlight all attributes or use an empty array `[]` to turn off highlighting. Attribute names are case-sensitive With highlighting, strings that match the search query are surrounded by HTML tags defined by `highlightPreTag` and `highlightPostTag`. You can use this to visually highlight matching parts of a search query in your UI For more information, see [Highlighting and snippeting](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/highlighting-snippeting/js). x-categories: - Highlighting and Snippeting attributesToSnippet: type: array items: type: string example: - content:80 - description description: > Attributes for which to enable snippets. Attribute names are case-sensitive Snippets provide additional context to matched words. If you enable snippets, they include 10 words, including the matched word. The matched word will also be wrapped by HTML tags for highlighting. You can adjust the number of words with the following notation: `ATTRIBUTE:NUMBER`, where `NUMBER` is the number of words to be extracted. default: [] x-categories: - Highlighting and Snippeting highlightPreTag: type: string description: >- HTML tag to insert before the highlighted parts in all highlighted results and snippets. default: x-categories: - Highlighting and Snippeting highlightPostTag: type: string description: >- HTML tag to insert after the highlighted parts in all highlighted results and snippets. default: x-categories: - Highlighting and Snippeting snippetEllipsisText: type: string description: String used as an ellipsis indicator when a snippet is truncated. default: … x-categories: - Highlighting and Snippeting restrictHighlightAndSnippetArrays: type: boolean description: > Whether to restrict highlighting and snippeting to items that at least partially matched the search query. By default, all items are highlighted and snippeted. default: false x-categories: - Highlighting and Snippeting hitsPerPage: type: integer description: Number of hits per page. default: 20 minimum: 1 maximum: 1000 x-categories: - Pagination minWordSizefor1Typo: type: integer description: >- Minimum number of characters a word in the search query must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). default: 4 x-categories: - Typos minWordSizefor2Typos: type: integer description: >- Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). default: 8 x-categories: - Typos typoToleranceEnum: type: string title: typo tolerance description: | - `min`. Return matches with the lowest number of typos. For example, if you have matches without typos, only include those. But if there are no matches without typos (with 1 typo), include matches with 1 typo (2 typos). - `strict`. Return matches with the two lowest numbers of typos. With `strict`, the Typo ranking criterion is applied first in the `ranking` setting. enum: - min - strict - 'true' - 'false' typoTolerance: description: > Whether [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance) is enabled and how it is applied. If typo tolerance is true, `min`, or `strict`, [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation) are also active. oneOf: - type: boolean default: true description: >- Whether typo tolerance is active. If true, matches with typos are included in the search results and rank after exact matches. - $ref: '#/components/schemas/typoToleranceEnum' x-categories: - Typos allowTyposOnNumericTokens: type: boolean description: | Whether to allow typos on numbers in the search query Turn off this setting to reduce the number of irrelevant matches when searching in large sets of similar numbers. default: true x-categories: - Typos disableTypoToleranceOnAttributes: type: array items: type: string example: - sku description: > Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance). Attribute names are case-sensitive Returning only exact matches can help when - [Searching in hyphenated attributes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes). - Reducing the number of matches when you have too many. This can happen with attributes that are long blocks of text, such as product descriptions Consider alternatives such as `disableTypoToleranceOnWords` or adding synonyms if your attributes have intentional unusual spellings that might look like typos. default: [] x-categories: - Typos booleanString: type: string enum: - 'true' - 'false' ignorePlurals: description: | Treat singular, plurals, and other forms of declensions as equivalent. Only use this feature for the languages used in your index. example: - ca - es oneOf: - type: array description: | ISO code for languages for which this feature should be active. This overrides languages you set with `queryLanguages`. items: $ref: '#/components/schemas/supportedLanguage' - $ref: '#/components/schemas/booleanString' - type: boolean description: > If true, `ignorePlurals` is active for all languages included in `queryLanguages`, or for all supported languages, if `queryLanguges` is empty. If false, singulars, plurals, and other declensions won't be considered equivalent. default: false x-categories: - Languages removeStopWords: description: > Removes stop words from the search query. Stop words are common words like articles, conjunctions, prepositions, or pronouns that have little or no meaning on their own. In English, "the", "a", or "and" are stop words. Only use this feature for the languages used in your index. example: - ca - es oneOf: - type: array description: >- ISO code for languages for which stop words should be removed. This overrides languages you set in `queryLanguges`. items: $ref: '#/components/schemas/supportedLanguage' - type: boolean default: false description: > If true, stop words are removed for all languages you included in `queryLanguages`, or for all supported languages, if `queryLanguages` is empty. If false, stop words are not removed. x-categories: - Languages queryLanguages: type: array items: $ref: '#/components/schemas/supportedLanguage' example: - es description: > Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, place the CJK language **first**. **Always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations). default: [] x-categories: - Languages decompoundQuery: type: boolean description: > Whether to split compound words in the query into their building blocks For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian. Decompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308). default: true x-categories: - Languages enableRules: type: boolean description: Whether to enable rules. default: true x-categories: - Rules enablePersonalization: type: boolean description: Whether to enable Personalization. default: false x-categories: - Personalization queryType: type: string enum: - prefixLast - prefixAll - prefixNone description: > Determines if and how query words are interpreted as prefixes. By default, only the last query word is treated as a prefix (`prefixLast`). To turn off prefix search, use `prefixNone`. Avoid `prefixAll`, which treats all query words as prefixes. This might lead to counterintuitive results and makes your search slower. For more information, see [Prefix searching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching). default: prefixLast x-categories: - Query strategy removeWordsIfNoResults: type: string enum: - none - lastWords - firstWords - allOptional example: firstWords description: > Strategy for removing words from the query when it doesn't return any results. This helps to avoid returning empty search results. - `none`. No words are removed when a query doesn't return results. - `lastWords`. Treat the last (then second to last, then third to last) word as optional, until there are results or at most 5 words have been removed. - `firstWords`. Treat the first (then second, then third) word as optional, until there are results or at most 5 words have been removed. - `allOptional`. Treat all words as optional. For more information, see [Remove words to improve results](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results). default: none x-categories: - Query strategy mode: type: string enum: - neuralSearch - keywordSearch description: > Search mode the index will use to query for results. This setting only applies to indices, for which Algolia enabled NeuralSearch for you. default: keywordSearch x-categories: - Query strategy semanticSearch: type: object description: | Settings for the semantic search part of NeuralSearch. Only used when `mode` is `neuralSearch`. properties: eventSources: oneOf: - type: array description: | Indices from which to collect click and conversion events. If null, the current index and all its replicas are used. items: type: string - type: 'null' advancedSyntax: type: boolean description: > Whether to support phrase matching and excluding words from search queries Use the `advancedSyntaxFeatures` parameter to control which feature is supported. default: false x-categories: - Query strategy optionalWordsArray: type: array items: type: string example: - blue - iphone case description: >- List of [optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). default: [] x-categories: - Query strategy optionalWords: description: > Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is "action video" and "video" is optional, the search engine runs two queries: one for "action video" and one for "action". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has fewer than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word; results 1,001 to 2,000 need 2 matched words. - If `optionalWords` has 10 or more words, the required number of matched words increases by the number of optional words divided by 5 (rounded down). Example: with 18 optional words, results 1 to 1,000 require 1 matched word; results 1,001 to 2,000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). oneOf: - type: string - type: 'null' - $ref: '#/components/schemas/optionalWordsArray' disableExactOnAttributes: type: array items: type: string example: - description description: > Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. default: [] x-categories: - Query strategy exactOnSingleWordQuery: type: string enum: - attribute - none - word description: > Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) is computed when the search query has only one word. - `attribute`. The Exact ranking criterion is 1 if the query word and attribute value are the same. For example, a search for "road" will match the value "road", but not "road trip". - `none`. The Exact ranking criterion is ignored on single-word searches. - `word`. The Exact ranking criterion is 1 if the query word is found in the attribute value. The query word must have at least 3 characters and must not be a stop word. Only exact matches will be highlighted, partial and prefix matches won't. default: attribute x-categories: - Query strategy alternativesAsExact: type: string enum: - ignorePlurals - singleWordSynonym - multiWordsSynonym - ignoreConjugations x-categories: - Query strategy IndexSettings_alternativesAsExact: type: array items: $ref: '#/components/schemas/alternativesAsExact' description: > Determine which plurals and synonyms should be considered an exact matches By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example - "swimsuit" and "swimsuits" are treated the same - "swimsuit" and "swimwear" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)) - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches - `singleWordSynonym`. Single-word synonyms, such as "NY" = "NYC", are considered exact matches - `multiWordsSynonym`. Multi-word synonyms, such as "NY" = "New York", are considered exact matches. default: - ignorePlurals - singleWordSynonym x-categories: - Query strategy advancedSyntaxFeatures: type: string enum: - exactPhrase - excludeWords x-categories: - Query strategy IndexSettings_advancedSyntaxFeatures: type: array items: $ref: '#/components/schemas/advancedSyntaxFeatures' description: | Advanced search syntax features you want to support - `exactPhrase`. Phrases in quotes must match exactly. For example, `sparkly blue "iPhone case"` only returns records with the exact string "iPhone case" - `excludeWords`. Query words prefixed with a `-` must not occur in a record. For example, `search -engine` matches records that contain "search" but not "engine" This setting only has an effect if `advancedSyntax` is true. default: - exactPhrase - excludeWords x-categories: - Query strategy distinct: description: > Determines how many records of a group are included in the search results. Records with the same value for the `attributeForDistinct` attribute are considered a group. The `distinct` setting controls how many members of the group are returned. This is useful for [deduplication and grouping](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature). The `distinct` setting is ignored if `attributeForDistinct` is not set. example: 1 oneOf: - type: boolean description: >- Whether deduplication is turned on. If true, only one member of a group is shown in the search results. - type: integer description: > Number of members of a group of records to include in the search results. - Don't use `distinct > 1` for records that might be [promoted by rules](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/promote-hits). The number of hits won't be correct and faceting won't work as expected. - With `distinct > 1`, the `hitsPerPage` parameter controls the number of returned groups. For example, with `hitsPerPage: 10` and `distinct: 2`, up to 20 records are returned. Likewise, the `nbHits` response attribute contains the number of returned groups. minimum: 0 maximum: 4 default: 0 x-categories: - Advanced replaceSynonymsInHighlight: type: boolean description: > Whether to replace a highlighted word with the matched synonym By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either "home" or "house" are included in the search results, and either "home" or "house" are highlighted With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of "house" are replaced by "home" in the highlighted response. default: false x-categories: - Highlighting and Snippeting minProximity: type: integer minimum: 1 maximum: 7 description: > Minimum proximity score for two matching words This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. default: 1 x-categories: - Advanced responseFields: type: array items: type: string description: > Properties to include in the API response of search and browse requests By default, all response properties are included. To reduce the response size, you can select which properties should be included An empty list may lead to an empty API response (except properties you can't exclude) You can't exclude these properties: `message`, `warning`, `cursor`, `abTestVariantID`, or any property added by setting `getRankingInfo` to true Your search depends on the `hits` field. If you omit this field, searches won't return any results. Your UI might also depend on other properties, for example, for pagination. Before restricting the response size, check the impact on your search experience. default: - '*' x-categories: - Advanced maxValuesPerFacet: type: integer description: Maximum number of facet values to return for each facet. default: 100 maximum: 1000 x-categories: - Faceting sortFacetValuesBy: type: string description: > Order in which to retrieve facet values - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value - `alpha`. Retrieve facet values alphabetically This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js). default: count x-categories: - Faceting attributeCriteriaComputedByMinProximity: type: boolean description: > Whether the best matching attribute should be determined by minimum proximity This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. default: false x-categories: - Advanced order: description: > Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list. type: array items: type: string facets: description: Order of facet names. type: object additionalProperties: false properties: order: $ref: '#/components/schemas/order' sortRemainingBy: description: > Order of facet values that aren't explicitly positioned with the `order` setting. - `count`. Order remaining facet values by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Sort facet values alphabetically. - `hidden`. Don't show facet values that aren't explicitly positioned. type: string enum: - count - alpha - hidden hide: description: Hide facet values. type: array items: type: string value: type: object additionalProperties: false properties: hide: $ref: '#/components/schemas/hide' order: $ref: '#/components/schemas/order' sortRemainingBy: $ref: '#/components/schemas/sortRemainingBy' values: description: Order of facet values. One object for each facet. type: object additionalProperties: x-additionalPropertiesName: facet $ref: '#/components/schemas/value' facetOrdering: description: Order of facet names and facet values in your UI. type: object additionalProperties: false properties: facets: $ref: '#/components/schemas/facets' values: $ref: '#/components/schemas/values' redirectURL: description: The redirect rule container. type: object additionalProperties: false properties: url: type: string bannerImageUrl: description: URL for an image to show inside a banner. type: object additionalProperties: false properties: url: type: string bannerImage: description: Image to show inside a banner. type: object additionalProperties: false properties: title: type: string urls: type: array items: $ref: '#/components/schemas/bannerImageUrl' bannerLink: description: Link for a banner defined in the Merchandising Studio. type: object additionalProperties: false properties: url: type: string banner: description: Banner with image and link to redirect users. type: object additionalProperties: false properties: image: $ref: '#/components/schemas/bannerImage' link: $ref: '#/components/schemas/bannerLink' banners: description: Banners defined in the Merchandising Studio for a given search. type: array items: $ref: '#/components/schemas/banner' widgets: description: Widgets returned from any rules that are applied to the current search. type: object additionalProperties: false properties: banners: $ref: '#/components/schemas/banners' renderingContent: description: > Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as the order of facet names and values without changing your frontend code. type: object additionalProperties: false properties: facetOrdering: $ref: '#/components/schemas/facetOrdering' redirect: $ref: '#/components/schemas/redirectURL' widgets: $ref: '#/components/schemas/widgets' x-categories: - Advanced enableReRanking: type: boolean description: > Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking) This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. default: true x-categories: - Filtering reRankingApplyFilter: description: > Restrict [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking) to records that match these filters. oneOf: - type: array items: $ref: '#/components/schemas/reRankingApplyFilter' - type: string x-categories: - Filtering indexSettingsAsSearchParams: type: object additionalProperties: false properties: advancedSyntax: $ref: '#/components/schemas/advancedSyntax' advancedSyntaxFeatures: $ref: '#/components/schemas/IndexSettings_advancedSyntaxFeatures' allowTyposOnNumericTokens: $ref: '#/components/schemas/allowTyposOnNumericTokens' alternativesAsExact: $ref: '#/components/schemas/IndexSettings_alternativesAsExact' attributeCriteriaComputedByMinProximity: $ref: '#/components/schemas/attributeCriteriaComputedByMinProximity' attributesToHighlight: $ref: '#/components/schemas/attributesToHighlight' attributesToRetrieve: $ref: '#/components/schemas/attributesToRetrieve' attributesToSnippet: $ref: '#/components/schemas/attributesToSnippet' decompoundQuery: $ref: '#/components/schemas/decompoundQuery' disableExactOnAttributes: $ref: '#/components/schemas/disableExactOnAttributes' disableTypoToleranceOnAttributes: $ref: '#/components/schemas/disableTypoToleranceOnAttributes' distinct: $ref: '#/components/schemas/distinct' enablePersonalization: $ref: '#/components/schemas/enablePersonalization' enableReRanking: $ref: '#/components/schemas/enableReRanking' enableRules: $ref: '#/components/schemas/enableRules' exactOnSingleWordQuery: $ref: '#/components/schemas/exactOnSingleWordQuery' highlightPostTag: $ref: '#/components/schemas/highlightPostTag' highlightPreTag: $ref: '#/components/schemas/highlightPreTag' hitsPerPage: $ref: '#/components/schemas/hitsPerPage' ignorePlurals: $ref: '#/components/schemas/ignorePlurals' maxValuesPerFacet: $ref: '#/components/schemas/maxValuesPerFacet' minProximity: $ref: '#/components/schemas/minProximity' minWordSizefor1Typo: $ref: '#/components/schemas/minWordSizefor1Typo' minWordSizefor2Typos: $ref: '#/components/schemas/minWordSizefor2Typos' mode: $ref: '#/components/schemas/mode' optionalWords: $ref: '#/components/schemas/optionalWords' queryLanguages: $ref: '#/components/schemas/queryLanguages' queryType: $ref: '#/components/schemas/queryType' ranking: type: array items: type: string description: > Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute), you put the sorting attribute at the top of the list. **Modifiers** - `asc("ATTRIBUTE")`. Sort the index by the values of an attribute, in ascending order. - `desc("ATTRIBUTE")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing). default: - typo - geo - words - filters - proximity - attribute - exact - custom x-categories: - Ranking relevancyStrictness: $ref: '#/components/schemas/relevancyStrictness' removeStopWords: $ref: '#/components/schemas/removeStopWords' removeWordsIfNoResults: $ref: '#/components/schemas/removeWordsIfNoResults' renderingContent: $ref: '#/components/schemas/renderingContent' replaceSynonymsInHighlight: $ref: '#/components/schemas/replaceSynonymsInHighlight' reRankingApplyFilter: oneOf: - $ref: '#/components/schemas/reRankingApplyFilter' - type: 'null' responseFields: $ref: '#/components/schemas/responseFields' restrictHighlightAndSnippetArrays: $ref: '#/components/schemas/restrictHighlightAndSnippetArrays' semanticSearch: $ref: '#/components/schemas/semanticSearch' snippetEllipsisText: $ref: '#/components/schemas/snippetEllipsisText' sortFacetValuesBy: $ref: '#/components/schemas/sortFacetValuesBy' typoTolerance: $ref: '#/components/schemas/typoTolerance' searchParamsObject: type: object properties: advancedSyntax: $ref: '#/components/schemas/advancedSyntax' advancedSyntaxFeatures: $ref: '#/components/schemas/IndexSettings_advancedSyntaxFeatures' allowTyposOnNumericTokens: $ref: '#/components/schemas/allowTyposOnNumericTokens' alternativesAsExact: $ref: '#/components/schemas/IndexSettings_alternativesAsExact' analytics: $ref: '#/components/schemas/analytics' analyticsTags: $ref: '#/components/schemas/analyticsTags' x-categories: - Analytics aroundLatLng: $ref: '#/components/schemas/aroundLatLng' aroundLatLngViaIP: $ref: '#/components/schemas/aroundLatLngViaIP' aroundPrecision: $ref: '#/components/schemas/aroundPrecision' aroundRadius: $ref: '#/components/schemas/aroundRadius' attributeCriteriaComputedByMinProximity: $ref: '#/components/schemas/attributeCriteriaComputedByMinProximity' attributesToHighlight: $ref: '#/components/schemas/attributesToHighlight' attributesToRetrieve: $ref: '#/components/schemas/attributesToRetrieve' attributesToSnippet: $ref: '#/components/schemas/attributesToSnippet' clickAnalytics: $ref: '#/components/schemas/clickAnalytics' decompoundQuery: $ref: '#/components/schemas/decompoundQuery' disableExactOnAttributes: $ref: '#/components/schemas/disableExactOnAttributes' disableTypoToleranceOnAttributes: $ref: '#/components/schemas/disableTypoToleranceOnAttributes' distinct: $ref: '#/components/schemas/distinct' enableABTest: $ref: '#/components/schemas/enableABTest' enablePersonalization: $ref: '#/components/schemas/enablePersonalization' enableReRanking: $ref: '#/components/schemas/enableReRanking' enableRules: $ref: '#/components/schemas/enableRules' exactOnSingleWordQuery: $ref: '#/components/schemas/exactOnSingleWordQuery' facetFilters: $ref: '#/components/schemas/facetFilters' facetingAfterDistinct: $ref: '#/components/schemas/facetingAfterDistinct' facets: type: array items: type: string description: > Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts). default: [] example: - '*' x-categories: - Faceting filters: $ref: '#/components/schemas/filters' getRankingInfo: $ref: '#/components/schemas/getRankingInfo' highlightPostTag: $ref: '#/components/schemas/highlightPostTag' highlightPreTag: $ref: '#/components/schemas/highlightPreTag' hitsPerPage: $ref: '#/components/schemas/hitsPerPage' ignorePlurals: $ref: '#/components/schemas/ignorePlurals' insideBoundingBox: $ref: '#/components/schemas/insideBoundingBox' insidePolygon: $ref: '#/components/schemas/insidePolygon' length: $ref: '#/components/schemas/length' maxValuesPerFacet: $ref: '#/components/schemas/maxValuesPerFacet' minimumAroundRadius: $ref: '#/components/schemas/minimumAroundRadius' minProximity: $ref: '#/components/schemas/minProximity' minWordSizefor1Typo: $ref: '#/components/schemas/minWordSizefor1Typo' minWordSizefor2Typos: $ref: '#/components/schemas/minWordSizefor2Typos' mode: $ref: '#/components/schemas/mode' naturalLanguages: $ref: '#/components/schemas/naturalLanguages' numericFilters: $ref: '#/components/schemas/numericFilters' offset: type: integer description: Position of the first hit to retrieve. x-categories: - Pagination optionalFilters: $ref: '#/components/schemas/optionalFilters' optionalWords: $ref: '#/components/schemas/optionalWords' page: $ref: '#/components/schemas/page' percentileComputation: $ref: '#/components/schemas/percentileComputation' personalizationImpact: $ref: '#/components/schemas/personalizationImpact' query: $ref: '#/components/schemas/query' queryLanguages: $ref: '#/components/schemas/queryLanguages' queryType: $ref: '#/components/schemas/queryType' ranking: type: array items: type: string description: > Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute), you put the sorting attribute at the top of the list. **Modifiers** - `asc("ATTRIBUTE")`. Sort the index by the values of an attribute, in ascending order. - `desc("ATTRIBUTE")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing). default: - typo - geo - words - filters - proximity - attribute - exact - custom x-categories: - Ranking relevancyStrictness: $ref: '#/components/schemas/relevancyStrictness' removeStopWords: $ref: '#/components/schemas/removeStopWords' removeWordsIfNoResults: $ref: '#/components/schemas/removeWordsIfNoResults' renderingContent: $ref: '#/components/schemas/renderingContent' replaceSynonymsInHighlight: $ref: '#/components/schemas/replaceSynonymsInHighlight' reRankingApplyFilter: oneOf: - $ref: '#/components/schemas/reRankingApplyFilter' - type: 'null' responseFields: $ref: '#/components/schemas/responseFields' restrictHighlightAndSnippetArrays: $ref: '#/components/schemas/restrictHighlightAndSnippetArrays' restrictSearchableAttributes: $ref: '#/components/schemas/restrictSearchableAttributes' ruleContexts: $ref: '#/components/schemas/ruleContexts' semanticSearch: $ref: '#/components/schemas/semanticSearch' similarQuery: $ref: '#/components/schemas/similarQuery' snippetEllipsisText: $ref: '#/components/schemas/snippetEllipsisText' sortFacetValuesBy: $ref: '#/components/schemas/sortFacetValuesBy' sumOrFiltersScores: $ref: '#/components/schemas/sumOrFiltersScores' synonyms: $ref: '#/components/schemas/synonyms' tagFilters: $ref: '#/components/schemas/tagFilters' typoTolerance: $ref: '#/components/schemas/typoTolerance' userToken: $ref: '#/components/schemas/userToken' additionalProperties: false description: >- Each parameter value, including the `query` must not be larger than 512 bytes. title: Search parameters as object searchParams: oneOf: - $ref: '#/components/schemas/searchParamsString' - $ref: '#/components/schemas/searchParamsObject' processingTimeMS: type: integer description: Time the server took to process the request, in milliseconds. example: 20 RedirectRuleIndexMetadata: type: object properties: data: title: redirectRuleIndexData type: object description: Redirect rule data. required: - ruleObjectID properties: ruleObjectID: type: string dest: type: string description: Destination index for the redirect rule. reason: type: string description: Reason for the redirect rule. source: type: string description: Source index for the redirect rule. succeed: type: boolean description: Redirect rule status. required: - data - succeed - reason - dest - source userData: example: settingID: f2a7b51e3503acc6a39b3784ffb84300 pluginVersion: 1.6.0 description: | An object with custom data. You can store up to 32kB as custom data. default: {} x-categories: - Advanced baseSearchResponse: type: object additionalProperties: true properties: _automaticInsights: type: boolean description: Whether automatic events collection is enabled for the application. abTestID: type: integer description: >- A/B test ID. This is only included in the response for indices that are part of an A/B test. abTestVariantID: type: integer minimum: 1 description: >- Variant ID. This is only included in the response for indices that are part of an A/B test. appliedRules: description: Rules applied to the query. title: appliedRules type: array items: type: object aroundLatLng: type: string description: Computed geographical location. example: 40.71,-74.01 pattern: ^(-?\d+(\.\d+)?),\s*(-?\d+(\.\d+)?)$ automaticRadius: type: string description: Distance from a central coordinate provided by `aroundLatLng`. exhaustive: title: exhaustive type: object description: >- Whether certain properties of the search response are calculated exhaustive (exact) or approximated. properties: facetsCount: type: boolean title: facetsCount description: >- Whether the facet count is exhaustive (`true`) or approximate (`false`). See the [related discussion](https://support.algolia.com/hc/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate). facetValues: type: boolean title: facetValues description: The value is `false` if not all facet values are retrieved. nbHits: type: boolean title: nbHits description: >- Whether the `nbHits` is exhaustive (`true`) or approximate (`false`). When the query takes more than 50ms to be processed, the engine makes an approximation. This can happen when using complex filters on millions of records, when typo-tolerance was not exhaustive, or when enough hits have been retrieved (for example, after the engine finds 10,000 exact matches). `nbHits` is reported as non-exhaustive whenever an approximation is made, even if the approximation didn’t, in the end, impact the exhaustivity of the query. rulesMatch: type: boolean title: rulesMatch description: >- Rules matching exhaustivity. The value is `false` if rules were enable for this query, and could not be fully processed due a timeout. This is generally caused by the number of alternatives (such as typos) which is too large. typo: type: boolean title: typo description: >- Whether the typo search was exhaustive (`true`) or approximate (`false`). An approximation is done when the typo search query part takes more than 10% of the query budget (ie. 5ms by default) to be processed (this can happen when a lot of typo alternatives exist for the query). This field will not be included when typo-tolerance is entirely disabled. exhaustiveFacetsCount: type: boolean description: >- See the `facetsCount` field of the `exhaustive` object in the response. deprecated: true exhaustiveNbHits: type: boolean description: See the `nbHits` field of the `exhaustive` object in the response. deprecated: true exhaustiveTypo: type: boolean description: See the `typo` field of the `exhaustive` object in the response. deprecated: true facets: title: facets type: object additionalProperties: x-additionalPropertiesName: facet type: object additionalProperties: x-additionalPropertiesName: facet count type: integer description: Facet counts. example: category: food: 1 tech: 42 facets_stats: type: object description: Statistics for numerical facets. additionalProperties: title: facetStats type: object properties: avg: type: number format: double description: Average facet value in the results. max: type: number format: double description: Maximum value in the results. min: type: number format: double description: Minimum value in the results. sum: type: number format: double description: Sum of all values in the results. index: type: string example: indexName description: Index name used for the query. indexUsed: type: string description: >- Index name used for the query. During A/B testing, the targeted index isn't always the index used by the query. example: indexNameAlt message: type: string description: Warnings about the query. nbSortedHits: type: integer description: Number of hits selected and sorted by the relevant sort algorithm. example: 20 parsedQuery: type: string description: >- Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean) query string that will be searched. example: george clo processingTimeMS: $ref: '#/components/schemas/processingTimeMS' processingTimingsMS: type: object description: >- Experimental. List of processing steps and their times, in milliseconds. You can use this list to investigate performance issues. queryAfterRemoval: type: string description: >- Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set. queryID: type: string description: >- Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics). example: a00dbc80a8d13c4565a442e7e2dca80a redirect: title: redirect type: object description: > [Redirect results to a URL](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/redirects), this this parameter is for internal use only. properties: index: type: array items: $ref: '#/components/schemas/RedirectRuleIndexMetadata' renderingContent: $ref: '#/components/schemas/renderingContent' serverTimeMS: type: integer description: Time the server took to process the request, in milliseconds. example: 20 serverUsed: type: string description: Host name of the server that processed the request. example: c2-uk-3.algolia.net userData: $ref: '#/components/schemas/userData' nbHits: type: integer description: Number of results (hits). example: 20 nbPages: type: integer description: Number of pages of results. example: 1 SearchPagination: type: object additionalProperties: false properties: hitsPerPage: $ref: '#/components/schemas/hitsPerPage' nbHits: $ref: '#/components/schemas/nbHits' nbPages: $ref: '#/components/schemas/nbPages' page: $ref: '#/components/schemas/page' objectID: type: string description: Unique record identifier. example: test-record-123 highlightedValue: type: string description: Highlighted attribute value, including HTML tags. example: George Clooney matchLevel: type: string description: Whether the whole query string matches or only a part. enum: - none - partial - full highlightResultOption: title: highlightResultOption type: object description: Surround words that match the query with HTML tags for highlighting. additionalProperties: false properties: matchedWords: type: array description: List of matched words from the search query. example: - action items: type: string matchLevel: $ref: '#/components/schemas/matchLevel' value: $ref: '#/components/schemas/highlightedValue' fullyHighlighted: type: boolean description: Whether the entire attribute value is highlighted. required: - value - matchLevel - matchedWords x-discriminator-fields: - matchLevel - matchedWords highlightResultMap: title: highlightResultMap type: object description: Surround words that match the query with HTML tags for highlighting. x-is-free-form: false additionalProperties: x-additionalPropertiesName: attribute $ref: '#/components/schemas/highlightResult' highlightResult: oneOf: - $ref: '#/components/schemas/highlightResultOption' - $ref: '#/components/schemas/highlightResultMap' - $ref: '#/components/schemas/highlightResultArray' highlightResultArray: title: highlightResultArray type: array description: Surround words that match the query with HTML tags for highlighting. items: $ref: '#/components/schemas/highlightResult' snippetResultOption: title: snippetResultOption type: object description: Snippets that show the context around a matching search query. additionalProperties: false properties: matchLevel: $ref: '#/components/schemas/matchLevel' value: $ref: '#/components/schemas/highlightedValue' required: - value - matchLevel x-discriminator-fields: - matchLevel snippetResultMap: title: snippetResultMap type: object description: Snippets that show the context around a matching search query. x-is-free-form: false additionalProperties: x-additionalPropertiesName: attribute $ref: '#/components/schemas/snippetResult' snippetResult: oneOf: - $ref: '#/components/schemas/snippetResultOption' - $ref: '#/components/schemas/snippetResultMap' - $ref: '#/components/schemas/snippetResultArray' snippetResultArray: title: snippetResultArray type: array description: Snippets that show the context around a matching search query. items: $ref: '#/components/schemas/snippetResult' matchedGeoLocation: type: object properties: distance: type: integer description: >- Distance between the matched location and the search location (in meters). lat: type: number format: double description: Latitude of the matched location. lng: type: number format: double description: Longitude of the matched location. personalization: type: object properties: filtersScore: type: integer description: The score of the filters. rankingScore: type: integer description: The score of the ranking. score: type: integer description: The score of the event. rankingInfo: type: object description: Object with detailed information about the record's ranking. additionalProperties: false properties: firstMatchedWord: type: integer minimum: 0 description: >- Position of the first matched word in the best matching attribute of the record. geoDistance: type: integer minimum: 0 description: >- Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters). nbExactWords: type: integer minimum: 0 description: Number of exactly matched words. nbTypos: type: integer minimum: 0 description: Number of typos encountered when matching the record. userScore: type: integer description: >- Overall ranking of the record, expressed as a single integer. This attribute is internal. filters: type: integer minimum: 0 description: Whether a filter matched the query. geoPrecision: type: integer minimum: 1 description: Precision used when computing the geo distance, in meters. matchedGeoLocation: $ref: '#/components/schemas/matchedGeoLocation' personalization: $ref: '#/components/schemas/personalization' promoted: type: boolean description: Whether the record was promoted by a rule. promotedByReRanking: type: boolean description: Whether the record is re-ranked. proximityDistance: type: integer minimum: 0 description: >- Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0. words: type: integer minimum: 1 description: Number of matched words. required: - nbTypos - firstMatchedWord - geoDistance - nbExactWords - userScore distinctSeqID: type: integer hit: type: object description: > Search result. A hit is a record from your index, augmented with special attributes for highlighting, snippeting, and ranking. x-is-generic: true x-is-hit-object: true additionalProperties: true required: - objectID properties: objectID: $ref: '#/components/schemas/objectID' _distinctSeqID: $ref: '#/components/schemas/distinctSeqID' _highlightResult: $ref: '#/components/schemas/highlightResultMap' _rankingInfo: $ref: '#/components/schemas/rankingInfo' _snippetResult: $ref: '#/components/schemas/snippetResultMap' queryCategorization_type: type: string enum: - narrow - broad - ambiguous - none description: Classification of the query scope. categoryPrediction_bin: type: string enum: - certain - very high - high - low - very low description: Confidence level of the category prediction. hierarchyPathEntry: type: object properties: depth: type: integer description: Depth level in the category hierarchy, starting at 0. facetName: type: string description: >- Facet attribute name at this hierarchy level, for example, `categories.lvl0`. facetValue: type: string description: Facet value at this level of the category hierarchy. categoryPrediction: type: object properties: bin: $ref: '#/components/schemas/categoryPrediction_bin' hierarchyPath: type: array description: Ordered list of category levels from root to the predicted category. items: $ref: '#/components/schemas/hierarchyPathEntry' autoFilteringFilterEntry: oneOf: - type: string - type: array items: type: string autoFilteringResult: type: object description: Result of automatic filtering applied by Query Categorization. properties: enabled: type: boolean description: Whether automatic filtering was applied to this query. facetFilters: type: array description: Facet filters automatically applied to the query. items: $ref: '#/components/schemas/autoFilteringFilterEntry' maxDepth: type: integer description: Maximum category hierarchy depth used for filtering. optionalFilters: type: array description: Optional filters automatically applied to boost relevant categories. items: $ref: '#/components/schemas/autoFilteringFilterEntry' queryCategorization: type: object description: > Query Categorization prediction returned by the AI model. This field is empty when the model cannot categorize the query. See [Query Categorization](https://www.algolia.com/doc/guides/algolia-ai/query-categorization/). properties: autofiltering: $ref: '#/components/schemas/autoFilteringResult' categories: type: array description: List of category predictions with confidence levels. items: $ref: '#/components/schemas/categoryPrediction' count: type: integer description: >- Number of times this normalized query was observed during the training window. normalizedQuery: type: string description: Processed and normalized version of the original search query. type: $ref: '#/components/schemas/queryCategorization_type' responseExtensions: type: object description: > AI-generated metadata returned alongside search results. Present when Algolia AI features such as [Query Categorization](https://www.algolia.com/doc/guides/algolia-ai/query-categorization/) are enabled. properties: queryCategorization: $ref: '#/components/schemas/queryCategorization' searchHits: type: object additionalProperties: true properties: hits: type: array description: > Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting. items: $ref: '#/components/schemas/hit' extensions: $ref: '#/components/schemas/responseExtensions' params: type: string description: URL-encoded string of all search parameters. example: query=a&hitsPerPage=20 query: $ref: '#/components/schemas/query' required: - hits searchResponse: additionalProperties: true allOf: - $ref: '#/components/schemas/baseSearchResponse' - $ref: '#/components/schemas/SearchPagination' - $ref: '#/components/schemas/searchHits' indexName: type: string example: products description: Index name (case-sensitive). searchTypeDefault: type: string enum: - default default: default description: > - `default`: perform a search query - `facet` [searches for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). searchExtensionsQueryCategorization: type: object description: >- Parameters for the [Query Categorization](https://www.algolia.com/doc/guides/algolia-ai/query-categorization/) AI feature. properties: enableAutoFiltering: type: boolean description: >- Whether to automatically apply category-based filters and boosts to search results. default: false enableCategoriesRetrieval: type: boolean description: >- Whether to retrieve category predictions in the response `extensions.queryCategorization` field. default: false searchExtensions: type: object description: > Additional parameters for Algolia AI features. Used to enable [Query Categorization](https://www.algolia.com/doc/guides/algolia-ai/query-categorization/) and other AI-powered capabilities. properties: queryCategorization: $ref: '#/components/schemas/searchExtensionsQueryCategorization' searchForHitsOptions: x-is-SearchForHitsOptions: true type: object properties: indexName: $ref: '#/components/schemas/indexName' extensions: $ref: '#/components/schemas/searchExtensions' type: $ref: '#/components/schemas/searchTypeDefault' required: - indexName SearchForHits: allOf: - $ref: '#/components/schemas/searchParams' - $ref: '#/components/schemas/searchForHitsOptions' facetQuery: type: string description: Text to search inside the facet's values. example: george default: '' maxFacetHits: type: integer description: >- Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). maximum: 100 default: 10 x-categories: - Advanced searchTypeFacet: type: string enum: - facet default: facet description: > - `default`: perform a search query - `facet` [searches for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). searchForFacetsOptions: type: object properties: facet: type: string description: Facet name. indexName: $ref: '#/components/schemas/indexName' type: $ref: '#/components/schemas/searchTypeFacet' facetQuery: $ref: '#/components/schemas/facetQuery' maxFacetHits: $ref: '#/components/schemas/maxFacetHits' required: - indexName - type - facet SearchForFacets: allOf: - $ref: '#/components/schemas/searchParams' - $ref: '#/components/schemas/searchForFacetsOptions' x-discriminator-fields: - facet - type SearchQuery: oneOf: - $ref: '#/components/schemas/SearchForHits' - $ref: '#/components/schemas/SearchForFacets' searchStrategy: type: string enum: - none - stopIfEnoughMatches description: > Strategy for multiple search queries: - `none`. Run all queries. - `stopIfEnoughMatches`. Run the queries one by one, stopping as soon as a query matches at least the `hitsPerPage` number of results. searchForFacetValuesResponse: type: object additionalProperties: false required: - facetHits - exhaustiveFacetsCount x-discriminator-fields: - facetHits properties: exhaustiveFacetsCount: type: boolean description: > Whether the facet count is exhaustive (true) or approximate (false). For more information, see [Why are my facet and hit counts not accurate](https://support.algolia.com/hc/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate). facetHits: type: array description: Matching facet values. items: title: facetHits type: object additionalProperties: false required: - value - highlighted - count properties: count: description: >- Number of records with this facet value. [The count may be approximated](https://support.algolia.com/hc/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate). type: integer highlighted: $ref: '#/components/schemas/highlightedValue' value: description: Facet value. example: Mobile phone type: string processingTimeMS: $ref: '#/components/schemas/processingTimeMS' searchResponsePartial: description: > Partial search response returned when the `responseFields` parameter excludes fields like `hits`. Contains all possible search response properties but none are required, so it acts as an unconditional fallback during oneOf deserialization. additionalProperties: true allOf: - $ref: '#/components/schemas/baseSearchResponse' - $ref: '#/components/schemas/SearchPagination' - type: object additionalProperties: true properties: extensions: $ref: '#/components/schemas/responseExtensions' hits: type: array description: > Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting. items: $ref: '#/components/schemas/hit' params: type: string description: URL-encoded string of all search parameters. example: query=a&hitsPerPage=20 query: $ref: '#/components/schemas/query' searchResult: oneOf: - $ref: '#/components/schemas/searchResponse' - $ref: '#/components/schemas/searchForFacetValuesResponse' - $ref: '#/components/schemas/searchResponsePartial' cursor: type: object additionalProperties: false properties: cursor: type: string description: > Cursor to get the next page of the response. The parameter must match the value returned in the response of a previous request. The last page of the response does not return a `cursor` attribute. example: jMDY3M2MwM2QwMWUxMmQwYWI0ZTN browseParamsObject: type: object properties: advancedSyntax: $ref: '#/components/schemas/advancedSyntax' advancedSyntaxFeatures: $ref: '#/components/schemas/IndexSettings_advancedSyntaxFeatures' allowTyposOnNumericTokens: $ref: '#/components/schemas/allowTyposOnNumericTokens' alternativesAsExact: $ref: '#/components/schemas/IndexSettings_alternativesAsExact' analytics: $ref: '#/components/schemas/analytics' analyticsTags: $ref: '#/components/schemas/analyticsTags' x-categories: - Analytics aroundLatLng: $ref: '#/components/schemas/aroundLatLng' aroundLatLngViaIP: $ref: '#/components/schemas/aroundLatLngViaIP' aroundPrecision: $ref: '#/components/schemas/aroundPrecision' aroundRadius: $ref: '#/components/schemas/aroundRadius' attributeCriteriaComputedByMinProximity: $ref: '#/components/schemas/attributeCriteriaComputedByMinProximity' attributesToHighlight: $ref: '#/components/schemas/attributesToHighlight' attributesToRetrieve: $ref: '#/components/schemas/attributesToRetrieve' attributesToSnippet: $ref: '#/components/schemas/attributesToSnippet' clickAnalytics: $ref: '#/components/schemas/clickAnalytics' cursor: type: string description: > Cursor to get the next page of the response. The parameter must match the value returned in the response of a previous request. The last page of the response does not return a `cursor` attribute. example: jMDY3M2MwM2QwMWUxMmQwYWI0ZTN decompoundQuery: $ref: '#/components/schemas/decompoundQuery' disableExactOnAttributes: $ref: '#/components/schemas/disableExactOnAttributes' disableTypoToleranceOnAttributes: $ref: '#/components/schemas/disableTypoToleranceOnAttributes' distinct: $ref: '#/components/schemas/distinct' enableABTest: $ref: '#/components/schemas/enableABTest' enablePersonalization: $ref: '#/components/schemas/enablePersonalization' enableReRanking: $ref: '#/components/schemas/enableReRanking' enableRules: $ref: '#/components/schemas/enableRules' exactOnSingleWordQuery: $ref: '#/components/schemas/exactOnSingleWordQuery' facetFilters: $ref: '#/components/schemas/facetFilters' facetingAfterDistinct: $ref: '#/components/schemas/facetingAfterDistinct' facets: type: array items: type: string description: > Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts). default: [] example: - '*' x-categories: - Faceting filters: $ref: '#/components/schemas/filters' getRankingInfo: $ref: '#/components/schemas/getRankingInfo' highlightPostTag: $ref: '#/components/schemas/highlightPostTag' highlightPreTag: $ref: '#/components/schemas/highlightPreTag' hitsPerPage: $ref: '#/components/schemas/hitsPerPage' ignorePlurals: $ref: '#/components/schemas/ignorePlurals' insideBoundingBox: $ref: '#/components/schemas/insideBoundingBox' insidePolygon: $ref: '#/components/schemas/insidePolygon' length: $ref: '#/components/schemas/length' maxValuesPerFacet: $ref: '#/components/schemas/maxValuesPerFacet' minimumAroundRadius: $ref: '#/components/schemas/minimumAroundRadius' minProximity: $ref: '#/components/schemas/minProximity' minWordSizefor1Typo: $ref: '#/components/schemas/minWordSizefor1Typo' minWordSizefor2Typos: $ref: '#/components/schemas/minWordSizefor2Typos' mode: $ref: '#/components/schemas/mode' naturalLanguages: $ref: '#/components/schemas/naturalLanguages' numericFilters: $ref: '#/components/schemas/numericFilters' offset: type: integer description: Position of the first hit to retrieve. x-categories: - Pagination optionalFilters: $ref: '#/components/schemas/optionalFilters' optionalWords: $ref: '#/components/schemas/optionalWords' page: $ref: '#/components/schemas/page' percentileComputation: $ref: '#/components/schemas/percentileComputation' personalizationImpact: $ref: '#/components/schemas/personalizationImpact' query: $ref: '#/components/schemas/query' queryLanguages: $ref: '#/components/schemas/queryLanguages' queryType: $ref: '#/components/schemas/queryType' ranking: type: array items: type: string description: > Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute), you put the sorting attribute at the top of the list. **Modifiers** - `asc("ATTRIBUTE")`. Sort the index by the values of an attribute, in ascending order. - `desc("ATTRIBUTE")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing). default: - typo - geo - words - filters - proximity - attribute - exact - custom x-categories: - Ranking relevancyStrictness: $ref: '#/components/schemas/relevancyStrictness' removeStopWords: $ref: '#/components/schemas/removeStopWords' removeWordsIfNoResults: $ref: '#/components/schemas/removeWordsIfNoResults' renderingContent: $ref: '#/components/schemas/renderingContent' replaceSynonymsInHighlight: $ref: '#/components/schemas/replaceSynonymsInHighlight' reRankingApplyFilter: oneOf: - $ref: '#/components/schemas/reRankingApplyFilter' - type: 'null' responseFields: $ref: '#/components/schemas/responseFields' restrictHighlightAndSnippetArrays: $ref: '#/components/schemas/restrictHighlightAndSnippetArrays' restrictSearchableAttributes: $ref: '#/components/schemas/restrictSearchableAttributes' ruleContexts: $ref: '#/components/schemas/ruleContexts' semanticSearch: $ref: '#/components/schemas/semanticSearch' similarQuery: $ref: '#/components/schemas/similarQuery' snippetEllipsisText: $ref: '#/components/schemas/snippetEllipsisText' sortFacetValuesBy: $ref: '#/components/schemas/sortFacetValuesBy' sumOrFiltersScores: $ref: '#/components/schemas/sumOrFiltersScores' synonyms: $ref: '#/components/schemas/synonyms' tagFilters: $ref: '#/components/schemas/tagFilters' typoTolerance: $ref: '#/components/schemas/typoTolerance' userToken: $ref: '#/components/schemas/userToken' additionalProperties: false description: >- Each parameter value, including the `query` must not be larger than 512 bytes. title: Search parameters as object browseParams: oneOf: - title: Search parameters as object $ref: '#/components/schemas/browseParamsObject' - $ref: '#/components/schemas/searchParamsString' BrowsePagination: type: object additionalProperties: false properties: hitsPerPage: $ref: '#/components/schemas/hitsPerPage' nbHits: $ref: '#/components/schemas/nbHits' nbPages: $ref: '#/components/schemas/nbPages' page: $ref: '#/components/schemas/page' browseResponse: allOf: - $ref: '#/components/schemas/baseSearchResponse' - $ref: '#/components/schemas/BrowsePagination' - $ref: '#/components/schemas/searchHits' - $ref: '#/components/schemas/cursor' createdAt: type: string example: '2023-07-04T12:49:15Z' description: Date and time when the object was created, in RFC 3339 format. taskID: type: integer format: int64 example: 1514562690001 description: > Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the [`task` operation](https://www.algolia.com/doc/rest-api/search/get-task) and this task ID. deletedAt: type: string example: '2023-06-27T14:42:38.831Z' description: Date and time when the object was deleted, in RFC 3339 format. updatedAt: type: string example: '2023-07-04T12:49:15Z' description: Date and time when the object was updated, in RFC 3339 format. deleteByParams: type: object additionalProperties: false properties: aroundLatLng: $ref: '#/components/schemas/aroundLatLng' aroundRadius: $ref: '#/components/schemas/aroundRadius' facetFilters: $ref: '#/components/schemas/facetFilters' filters: $ref: '#/components/schemas/filters' insideBoundingBox: $ref: '#/components/schemas/insideBoundingBox' insidePolygon: $ref: '#/components/schemas/insidePolygon' numericFilters: $ref: '#/components/schemas/numericFilters' tagFilters: $ref: '#/components/schemas/tagFilters' updatedAtResponse: type: object description: Response, taskID, and update timestamp. additionalProperties: false required: - taskID - updatedAt properties: taskID: $ref: '#/components/schemas/taskID' updatedAt: $ref: '#/components/schemas/updatedAt' action: type: string enum: - addObject - updateObject - partialUpdateObject - partialUpdateObjectNoCreate - deleteObject - delete - clear description: > Which indexing operation to perform: - `addObject`: adds records to an index. Equivalent to the "Add a new record (with auto-generated object ID)" operation. - `updateObject`: adds or replaces records in an index. Equivalent to the "Add or replace a record" operation. - `partialUpdateObject`: adds or updates attributes within records. Equivalent to the "Add or update attributes" operation with the `createIfNoExists` parameter set to true. (If a record with the specified `objectID` doesn't exist in the specified index, this action creates adds the record to the index) - `partialUpdateObjectNoCreate`: same as `partialUpdateObject`, but with `createIfNoExists` set to false. (A record isn't added to the index if its `objectID` doesn't exist) - `deleteObject`: delete records from an index. Equivalent to the "Delete a record" operation. - `delete`. Delete an index. Equivalent to the "Delete an index" operation. - `clear`: delete all records from an index. Equivalent to the "Delete all records from an index operation". batchWriteParams: title: batchWriteParams description: Batch parameters. type: object additionalProperties: false properties: requests: type: array items: title: batchRequest type: object additionalProperties: false properties: action: $ref: '#/components/schemas/action' body: type: object description: Operation arguments (varies with specified `action`). example: name: Betty Jane McCamey company: Vita Foods Inc. email: betty@mccamey.com required: - action - body required: - requests example: requests: - action: addObject body: name: Betty Jane McCamey company: Vita Foods Inc. email: betty@mccamey.com - action: addObject body: name: Gayla geimer company: Ortman McCain Co. email: gayla@geimer.com objectIDs: type: array items: type: string example: - record-1 - record-2 description: Unique record identifiers. batchResponse: type: object additionalProperties: false properties: objectIDs: $ref: '#/components/schemas/objectIDs' taskID: $ref: '#/components/schemas/taskID' required: - taskID - objectIDs baseIndexSettings: type: object additionalProperties: false properties: allowCompressionOfIntegerArray: type: boolean description: > Whether arrays with exclusively non-negative integers should be compressed for better performance. If true, the compressed arrays may be reordered. default: false x-categories: - Performance attributeForDistinct: description: > Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. example: url type: string attributesForFaceting: type: array items: type: string example: - author - filterOnly(isbn) - searchable(edition) - afterDistinct(category) - afterDistinct(searchable(publisher)) description: > Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly("ATTRIBUTE")`. Allows the attribute to be used as a filter but doesn't evaluate the facet values. - `searchable("ATTRIBUTE")`. Allows searching for facet values. - `afterDistinct("ATTRIBUTE")`. Evaluates the facet count _after_ deduplication with `distinct`. This ensures accurate facet counts. You can apply this modifier to searchable facets: `afterDistinct(searchable(ATTRIBUTE))`. default: [] x-categories: - Faceting attributesToTransliterate: description: > Attributes, for which you want to support [Japanese transliteration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#japanese-transliteration-and-type-ahead). Transliteration supports searching in any of the Japanese writing systems. To support transliteration, you must set the indexing language to Japanese. Attribute names are case-sensitive. type: array items: type: string example: - name - description x-categories: - Languages camelCaseAttributes: type: array items: type: string example: - description description: > Attributes for which to split [camel case](https://wikipedia.org/wiki/Camel_case) words. Attribute names are case-sensitive. default: [] x-categories: - Languages customNormalization: description: > Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization). type: object example: default: ä: ae ü: ue additionalProperties: type: object additionalProperties: type: string x-categories: - Languages customRanking: type: array items: type: string example: - desc(popularity) - asc(price) description: > Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc("ATTRIBUTE")`. Sort the index by the values of an attribute, in ascending order. - `desc("ATTRIBUTE")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision) of your first attributes, or the other attributes will never be applied. default: [] x-categories: - Ranking decompoundedAttributes: type: object example: de: - name description: > Searchable attributes to which Algolia should apply [word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation) (decompounding). Attribute names are case-sensitive. Compound words are formed by combining two or more individual words, and are particularly prevalent in Germanic languages—for example, "firefighter". With decompounding, the individual components are indexed separately. You can specify different lists for different languages. Decompounding is supported for these languages: Dutch (`nl`), German (`de`), Finnish (`fi`), Danish (`da`), Swedish (`sv`), and Norwegian (`no`). Decompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308). default: {} x-categories: - Languages disablePrefixOnAttributes: type: array items: type: string example: - sku description: > Searchable attributes for which you want to turn off [prefix matching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#adjusting-prefix-search). Attribute names are case-sensitive. default: [] x-categories: - Query strategy disableTypoToleranceOnWords: type: array items: type: string example: - wheel - 1X2BCD description: > Creates a list of [words which require exact matches](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#turn-off-typo-tolerance-for-certain-words). This also turns off [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation) for the specified words. default: [] x-categories: - Typos indexLanguages: type: array items: $ref: '#/components/schemas/supportedLanguage' example: - ja description: > Languages for language-specific processing steps, such as word detection and dictionary settings. **Always specify an indexing language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations). default: [] x-categories: - Languages keepDiacriticsOnCharacters: type: string example: øé description: | Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics. default: '' x-categories: - Languages maxFacetHits: $ref: '#/components/schemas/maxFacetHits' numericAttributesForFiltering: type: array items: type: string description: > Numeric attributes that can be used as [numerical filters](https://www.algolia.com/doc/guides/managing-results/rules/detecting-intent/how-to/applying-a-custom-filter-for-a-specific-query/#numerical-filters). Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. To turn off filtering for all numeric attributes, specify an attribute that doesn't exist in your index, such as `NO_NUMERIC_FILTERING`. **Modifier** - `equalOnly("ATTRIBUTE")`. Support only filtering based on equality comparisons `=` and `!=`. example: - equalOnly(quantity) - popularity default: [] x-categories: - Performance paginationLimitedTo: type: integer example: 100 description: > Maximum number of search results that can be obtained through pagination. Higher pagination limits might slow down your search. For pagination limits above 1,000, the sorting of results beyond the 1,000th hit can't be guaranteed. default: 1000 maximum: 20000 replicas: type: array items: type: string example: - virtual(prod_products_price_asc) - dev_products_replica description: > Creates [replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas). Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you'll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer be synced with the primary index. **Modifier** - `virtual("REPLICA")`. Create a virtual replica, Virtual replicas don't increase the number of records and are optimized for [Relevant sorting](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/relevant-sort). default: [] x-categories: - Ranking searchableAttributes: type: array items: type: string example: - title,alternative_title - author - unordered(text) - emails.personal description: > Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the [Attribute](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute) ranking criterion is turned off. With a non-empty list, Algolia only returns results with matches in the selected attributes. In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of `searchableAttributes` rank first. To make matches in two attributes rank equally, include them in a comma-separated string, such as `"title,alternate_title"`. Attributes with the same priority are always unordered. For more information, see [Searchable attributes](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes). **Modifier** - `unordered("ATTRIBUTE")`. Ignore the position of a match within the attribute. Without a modifier, matches at the beginning of an attribute rank higher than matches at the end. default: [] x-categories: - Attributes separatorsToIndex: type: string example: +# description: > Control which non-alphanumeric characters are indexed. By default, Algolia ignores [non-alphanumeric characters](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes/#handling-non-alphanumeric-characters) like hyphen (`-`), plus (`+`), and parentheses (`(`,`)`). To include such characters, define them with `separatorsToIndex`. Separators are all non-letter characters except spaces and currency characters, such as $€£¥. With `separatorsToIndex`, Algolia treats separator characters as separate words. For example, in a search for "Disney+", Algolia considers "Disney" and "+" as two separate words. default: '' x-categories: - Typos unretrievableAttributes: type: array items: type: string example: - total_sales description: > Attributes that can't be retrieved at query time. This can be useful if you want to use an attribute for ranking or to [restrict access](https://www.algolia.com/doc/guides/security/api-keys/how-to/user-restricted-access-to-data), but don't want to include it in the search results. Attribute names are case-sensitive. default: [] x-categories: - Attributes userData: $ref: '#/components/schemas/userData' indexSettings: type: object properties: advancedSyntax: $ref: '#/components/schemas/advancedSyntax' advancedSyntaxFeatures: $ref: '#/components/schemas/IndexSettings_advancedSyntaxFeatures' allowCompressionOfIntegerArray: type: boolean description: > Whether arrays with exclusively non-negative integers should be compressed for better performance. If true, the compressed arrays may be reordered. default: false x-categories: - Performance allowTyposOnNumericTokens: $ref: '#/components/schemas/allowTyposOnNumericTokens' alternativesAsExact: $ref: '#/components/schemas/IndexSettings_alternativesAsExact' attributeCriteriaComputedByMinProximity: $ref: '#/components/schemas/attributeCriteriaComputedByMinProximity' attributeForDistinct: description: > Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. example: url type: string attributesForFaceting: type: array items: type: string example: - author - filterOnly(isbn) - searchable(edition) - afterDistinct(category) - afterDistinct(searchable(publisher)) description: > Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly("ATTRIBUTE")`. Allows the attribute to be used as a filter but doesn't evaluate the facet values. - `searchable("ATTRIBUTE")`. Allows searching for facet values. - `afterDistinct("ATTRIBUTE")`. Evaluates the facet count _after_ deduplication with `distinct`. This ensures accurate facet counts. You can apply this modifier to searchable facets: `afterDistinct(searchable(ATTRIBUTE))`. default: [] x-categories: - Faceting attributesToHighlight: $ref: '#/components/schemas/attributesToHighlight' attributesToRetrieve: $ref: '#/components/schemas/attributesToRetrieve' attributesToSnippet: $ref: '#/components/schemas/attributesToSnippet' attributesToTransliterate: description: > Attributes, for which you want to support [Japanese transliteration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#japanese-transliteration-and-type-ahead). Transliteration supports searching in any of the Japanese writing systems. To support transliteration, you must set the indexing language to Japanese. Attribute names are case-sensitive. type: array items: type: string example: - name - description x-categories: - Languages camelCaseAttributes: type: array items: type: string example: - description description: > Attributes for which to split [camel case](https://wikipedia.org/wiki/Camel_case) words. Attribute names are case-sensitive. default: [] x-categories: - Languages customNormalization: description: > Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization). type: object example: default: ä: ae ü: ue additionalProperties: type: object additionalProperties: type: string x-categories: - Languages customRanking: type: array items: type: string example: - desc(popularity) - asc(price) description: > Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc("ATTRIBUTE")`. Sort the index by the values of an attribute, in ascending order. - `desc("ATTRIBUTE")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision) of your first attributes, or the other attributes will never be applied. default: [] x-categories: - Ranking decompoundedAttributes: type: object example: de: - name description: > Searchable attributes to which Algolia should apply [word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation) (decompounding). Attribute names are case-sensitive. Compound words are formed by combining two or more individual words, and are particularly prevalent in Germanic languages—for example, "firefighter". With decompounding, the individual components are indexed separately. You can specify different lists for different languages. Decompounding is supported for these languages: Dutch (`nl`), German (`de`), Finnish (`fi`), Danish (`da`), Swedish (`sv`), and Norwegian (`no`). Decompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308). default: {} x-categories: - Languages decompoundQuery: $ref: '#/components/schemas/decompoundQuery' disableExactOnAttributes: $ref: '#/components/schemas/disableExactOnAttributes' disablePrefixOnAttributes: type: array items: type: string example: - sku description: > Searchable attributes for which you want to turn off [prefix matching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#adjusting-prefix-search). Attribute names are case-sensitive. default: [] x-categories: - Query strategy disableTypoToleranceOnAttributes: $ref: '#/components/schemas/disableTypoToleranceOnAttributes' disableTypoToleranceOnWords: type: array items: type: string example: - wheel - 1X2BCD description: > Creates a list of [words which require exact matches](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#turn-off-typo-tolerance-for-certain-words). This also turns off [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation) for the specified words. default: [] x-categories: - Typos distinct: $ref: '#/components/schemas/distinct' enablePersonalization: $ref: '#/components/schemas/enablePersonalization' enableReRanking: $ref: '#/components/schemas/enableReRanking' enableRules: $ref: '#/components/schemas/enableRules' exactOnSingleWordQuery: $ref: '#/components/schemas/exactOnSingleWordQuery' highlightPostTag: $ref: '#/components/schemas/highlightPostTag' highlightPreTag: $ref: '#/components/schemas/highlightPreTag' hitsPerPage: $ref: '#/components/schemas/hitsPerPage' ignorePlurals: $ref: '#/components/schemas/ignorePlurals' indexLanguages: type: array items: $ref: '#/components/schemas/supportedLanguage' example: - ja description: > Languages for language-specific processing steps, such as word detection and dictionary settings. **Always specify an indexing language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations). default: [] x-categories: - Languages keepDiacriticsOnCharacters: type: string example: øé description: | Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics. default: '' x-categories: - Languages maxFacetHits: $ref: '#/components/schemas/maxFacetHits' maxValuesPerFacet: $ref: '#/components/schemas/maxValuesPerFacet' minProximity: $ref: '#/components/schemas/minProximity' minWordSizefor1Typo: $ref: '#/components/schemas/minWordSizefor1Typo' minWordSizefor2Typos: $ref: '#/components/schemas/minWordSizefor2Typos' mode: $ref: '#/components/schemas/mode' numericAttributesForFiltering: type: array items: type: string description: > Numeric attributes that can be used as [numerical filters](https://www.algolia.com/doc/guides/managing-results/rules/detecting-intent/how-to/applying-a-custom-filter-for-a-specific-query/#numerical-filters). Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. To turn off filtering for all numeric attributes, specify an attribute that doesn't exist in your index, such as `NO_NUMERIC_FILTERING`. **Modifier** - `equalOnly("ATTRIBUTE")`. Support only filtering based on equality comparisons `=` and `!=`. example: - equalOnly(quantity) - popularity default: [] x-categories: - Performance optionalWords: $ref: '#/components/schemas/optionalWords' paginationLimitedTo: type: integer example: 100 description: > Maximum number of search results that can be obtained through pagination. Higher pagination limits might slow down your search. For pagination limits above 1,000, the sorting of results beyond the 1,000th hit can't be guaranteed. default: 1000 maximum: 20000 queryLanguages: $ref: '#/components/schemas/queryLanguages' queryType: $ref: '#/components/schemas/queryType' ranking: type: array items: type: string description: > Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute), you put the sorting attribute at the top of the list. **Modifiers** - `asc("ATTRIBUTE")`. Sort the index by the values of an attribute, in ascending order. - `desc("ATTRIBUTE")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing). default: - typo - geo - words - filters - proximity - attribute - exact - custom x-categories: - Ranking relevancyStrictness: $ref: '#/components/schemas/relevancyStrictness' removeStopWords: $ref: '#/components/schemas/removeStopWords' removeWordsIfNoResults: $ref: '#/components/schemas/removeWordsIfNoResults' renderingContent: $ref: '#/components/schemas/renderingContent' replaceSynonymsInHighlight: $ref: '#/components/schemas/replaceSynonymsInHighlight' replicas: type: array items: type: string example: - virtual(prod_products_price_asc) - dev_products_replica description: > Creates [replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas). Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you'll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer be synced with the primary index. **Modifier** - `virtual("REPLICA")`. Create a virtual replica, Virtual replicas don't increase the number of records and are optimized for [Relevant sorting](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/relevant-sort). default: [] x-categories: - Ranking reRankingApplyFilter: oneOf: - $ref: '#/components/schemas/reRankingApplyFilter' - type: 'null' responseFields: $ref: '#/components/schemas/responseFields' restrictHighlightAndSnippetArrays: $ref: '#/components/schemas/restrictHighlightAndSnippetArrays' searchableAttributes: type: array items: type: string example: - title,alternative_title - author - unordered(text) - emails.personal description: > Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the [Attribute](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute) ranking criterion is turned off. With a non-empty list, Algolia only returns results with matches in the selected attributes. In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of `searchableAttributes` rank first. To make matches in two attributes rank equally, include them in a comma-separated string, such as `"title,alternate_title"`. Attributes with the same priority are always unordered. For more information, see [Searchable attributes](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes). **Modifier** - `unordered("ATTRIBUTE")`. Ignore the position of a match within the attribute. Without a modifier, matches at the beginning of an attribute rank higher than matches at the end. default: [] x-categories: - Attributes semanticSearch: $ref: '#/components/schemas/semanticSearch' separatorsToIndex: type: string example: +# description: > Control which non-alphanumeric characters are indexed. By default, Algolia ignores [non-alphanumeric characters](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes/#handling-non-alphanumeric-characters) like hyphen (`-`), plus (`+`), and parentheses (`(`,`)`). To include such characters, define them with `separatorsToIndex`. Separators are all non-letter characters except spaces and currency characters, such as $€£¥. With `separatorsToIndex`, Algolia treats separator characters as separate words. For example, in a search for "Disney+", Algolia considers "Disney" and "+" as two separate words. default: '' x-categories: - Typos snippetEllipsisText: $ref: '#/components/schemas/snippetEllipsisText' sortFacetValuesBy: $ref: '#/components/schemas/sortFacetValuesBy' typoTolerance: $ref: '#/components/schemas/typoTolerance' unretrievableAttributes: type: array items: type: string example: - total_sales description: > Attributes that can't be retrieved at query time. This can be useful if you want to use an attribute for ranking or to [restrict access](https://www.algolia.com/doc/guides/security/api-keys/how-to/user-restricted-access-to-data), but don't want to include it in the search results. Attribute names are case-sensitive. default: [] x-categories: - Attributes userData: $ref: '#/components/schemas/userData' additionalProperties: false description: Index settings. WithPrimary: type: object additionalProperties: false properties: primary: type: string description: > Replica indices only: the name of the primary index for this replica. settingsResponse: type: object properties: advancedSyntax: $ref: '#/components/schemas/advancedSyntax' advancedSyntaxFeatures: $ref: '#/components/schemas/IndexSettings_advancedSyntaxFeatures' allowCompressionOfIntegerArray: type: boolean description: > Whether arrays with exclusively non-negative integers should be compressed for better performance. If true, the compressed arrays may be reordered. default: false x-categories: - Performance allowTyposOnNumericTokens: $ref: '#/components/schemas/allowTyposOnNumericTokens' alternativesAsExact: $ref: '#/components/schemas/IndexSettings_alternativesAsExact' attributeCriteriaComputedByMinProximity: $ref: '#/components/schemas/attributeCriteriaComputedByMinProximity' attributeForDistinct: description: > Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. example: url type: string attributesForFaceting: type: array items: type: string example: - author - filterOnly(isbn) - searchable(edition) - afterDistinct(category) - afterDistinct(searchable(publisher)) description: > Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly("ATTRIBUTE")`. Allows the attribute to be used as a filter but doesn't evaluate the facet values. - `searchable("ATTRIBUTE")`. Allows searching for facet values. - `afterDistinct("ATTRIBUTE")`. Evaluates the facet count _after_ deduplication with `distinct`. This ensures accurate facet counts. You can apply this modifier to searchable facets: `afterDistinct(searchable(ATTRIBUTE))`. default: [] x-categories: - Faceting attributesToHighlight: $ref: '#/components/schemas/attributesToHighlight' attributesToRetrieve: $ref: '#/components/schemas/attributesToRetrieve' attributesToSnippet: $ref: '#/components/schemas/attributesToSnippet' attributesToTransliterate: description: > Attributes, for which you want to support [Japanese transliteration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#japanese-transliteration-and-type-ahead). Transliteration supports searching in any of the Japanese writing systems. To support transliteration, you must set the indexing language to Japanese. Attribute names are case-sensitive. type: array items: type: string example: - name - description x-categories: - Languages camelCaseAttributes: type: array items: type: string example: - description description: > Attributes for which to split [camel case](https://wikipedia.org/wiki/Camel_case) words. Attribute names are case-sensitive. default: [] x-categories: - Languages customNormalization: description: > Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization). type: object example: default: ä: ae ü: ue additionalProperties: type: object additionalProperties: type: string x-categories: - Languages customRanking: type: array items: type: string example: - desc(popularity) - asc(price) description: > Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc("ATTRIBUTE")`. Sort the index by the values of an attribute, in ascending order. - `desc("ATTRIBUTE")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision) of your first attributes, or the other attributes will never be applied. default: [] x-categories: - Ranking decompoundedAttributes: type: object example: de: - name description: > Searchable attributes to which Algolia should apply [word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation) (decompounding). Attribute names are case-sensitive. Compound words are formed by combining two or more individual words, and are particularly prevalent in Germanic languages—for example, "firefighter". With decompounding, the individual components are indexed separately. You can specify different lists for different languages. Decompounding is supported for these languages: Dutch (`nl`), German (`de`), Finnish (`fi`), Danish (`da`), Swedish (`sv`), and Norwegian (`no`). Decompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308). default: {} x-categories: - Languages decompoundQuery: $ref: '#/components/schemas/decompoundQuery' disableExactOnAttributes: $ref: '#/components/schemas/disableExactOnAttributes' disablePrefixOnAttributes: type: array items: type: string example: - sku description: > Searchable attributes for which you want to turn off [prefix matching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#adjusting-prefix-search). Attribute names are case-sensitive. default: [] x-categories: - Query strategy disableTypoToleranceOnAttributes: $ref: '#/components/schemas/disableTypoToleranceOnAttributes' disableTypoToleranceOnWords: type: array items: type: string example: - wheel - 1X2BCD description: > Creates a list of [words which require exact matches](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#turn-off-typo-tolerance-for-certain-words). This also turns off [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation) for the specified words. default: [] x-categories: - Typos distinct: $ref: '#/components/schemas/distinct' enablePersonalization: $ref: '#/components/schemas/enablePersonalization' enableReRanking: $ref: '#/components/schemas/enableReRanking' enableRules: $ref: '#/components/schemas/enableRules' exactOnSingleWordQuery: $ref: '#/components/schemas/exactOnSingleWordQuery' highlightPostTag: $ref: '#/components/schemas/highlightPostTag' highlightPreTag: $ref: '#/components/schemas/highlightPreTag' hitsPerPage: $ref: '#/components/schemas/hitsPerPage' ignorePlurals: $ref: '#/components/schemas/ignorePlurals' indexLanguages: type: array items: $ref: '#/components/schemas/supportedLanguage' example: - ja description: > Languages for language-specific processing steps, such as word detection and dictionary settings. **Always specify an indexing language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations). default: [] x-categories: - Languages keepDiacriticsOnCharacters: type: string example: øé description: | Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics. default: '' x-categories: - Languages maxFacetHits: $ref: '#/components/schemas/maxFacetHits' maxValuesPerFacet: $ref: '#/components/schemas/maxValuesPerFacet' minProximity: $ref: '#/components/schemas/minProximity' minWordSizefor1Typo: $ref: '#/components/schemas/minWordSizefor1Typo' minWordSizefor2Typos: $ref: '#/components/schemas/minWordSizefor2Typos' mode: $ref: '#/components/schemas/mode' numericAttributesForFiltering: type: array items: type: string description: > Numeric attributes that can be used as [numerical filters](https://www.algolia.com/doc/guides/managing-results/rules/detecting-intent/how-to/applying-a-custom-filter-for-a-specific-query/#numerical-filters). Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. To turn off filtering for all numeric attributes, specify an attribute that doesn't exist in your index, such as `NO_NUMERIC_FILTERING`. **Modifier** - `equalOnly("ATTRIBUTE")`. Support only filtering based on equality comparisons `=` and `!=`. example: - equalOnly(quantity) - popularity default: [] x-categories: - Performance optionalWords: $ref: '#/components/schemas/optionalWords' paginationLimitedTo: type: integer example: 100 description: > Maximum number of search results that can be obtained through pagination. Higher pagination limits might slow down your search. For pagination limits above 1,000, the sorting of results beyond the 1,000th hit can't be guaranteed. default: 1000 maximum: 20000 primary: type: string description: > Replica indices only: the name of the primary index for this replica. queryLanguages: $ref: '#/components/schemas/queryLanguages' queryType: $ref: '#/components/schemas/queryType' ranking: type: array items: type: string description: > Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute), you put the sorting attribute at the top of the list. **Modifiers** - `asc("ATTRIBUTE")`. Sort the index by the values of an attribute, in ascending order. - `desc("ATTRIBUTE")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing). default: - typo - geo - words - filters - proximity - attribute - exact - custom x-categories: - Ranking relevancyStrictness: $ref: '#/components/schemas/relevancyStrictness' removeStopWords: $ref: '#/components/schemas/removeStopWords' removeWordsIfNoResults: $ref: '#/components/schemas/removeWordsIfNoResults' renderingContent: $ref: '#/components/schemas/renderingContent' replaceSynonymsInHighlight: $ref: '#/components/schemas/replaceSynonymsInHighlight' replicas: type: array items: type: string example: - virtual(prod_products_price_asc) - dev_products_replica description: > Creates [replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas). Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you'll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer be synced with the primary index. **Modifier** - `virtual("REPLICA")`. Create a virtual replica, Virtual replicas don't increase the number of records and are optimized for [Relevant sorting](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/relevant-sort). default: [] x-categories: - Ranking reRankingApplyFilter: oneOf: - $ref: '#/components/schemas/reRankingApplyFilter' - type: 'null' responseFields: $ref: '#/components/schemas/responseFields' restrictHighlightAndSnippetArrays: $ref: '#/components/schemas/restrictHighlightAndSnippetArrays' searchableAttributes: type: array items: type: string example: - title,alternative_title - author - unordered(text) - emails.personal description: > Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the [Attribute](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute) ranking criterion is turned off. With a non-empty list, Algolia only returns results with matches in the selected attributes. In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of `searchableAttributes` rank first. To make matches in two attributes rank equally, include them in a comma-separated string, such as `"title,alternate_title"`. Attributes with the same priority are always unordered. For more information, see [Searchable attributes](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes). **Modifier** - `unordered("ATTRIBUTE")`. Ignore the position of a match within the attribute. Without a modifier, matches at the beginning of an attribute rank higher than matches at the end. default: [] x-categories: - Attributes semanticSearch: $ref: '#/components/schemas/semanticSearch' separatorsToIndex: type: string example: +# description: > Control which non-alphanumeric characters are indexed. By default, Algolia ignores [non-alphanumeric characters](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes/#handling-non-alphanumeric-characters) like hyphen (`-`), plus (`+`), and parentheses (`(`,`)`). To include such characters, define them with `separatorsToIndex`. Separators are all non-letter characters except spaces and currency characters, such as $€£¥. With `separatorsToIndex`, Algolia treats separator characters as separate words. For example, in a search for "Disney+", Algolia considers "Disney" and "+" as two separate words. default: '' x-categories: - Typos snippetEllipsisText: $ref: '#/components/schemas/snippetEllipsisText' sortFacetValuesBy: $ref: '#/components/schemas/sortFacetValuesBy' typoTolerance: $ref: '#/components/schemas/typoTolerance' unretrievableAttributes: type: array items: type: string example: - total_sales description: > Attributes that can't be retrieved at query time. This can be useful if you want to use an attribute for ranking or to [restrict access](https://www.algolia.com/doc/guides/security/api-keys/how-to/user-restricted-access-to-data), but don't want to include it in the search results. Attribute names are case-sensitive. default: [] x-categories: - Attributes userData: $ref: '#/components/schemas/userData' additionalProperties: false description: Index settings. SynonymType: type: string description: Synonym type. example: onewaysynonym enum: - synonym - onewaysynonym - altcorrection1 - altcorrection2 - placeholder - oneWaySynonym - altCorrection1 - altCorrection2 synonymHit: type: object description: Synonym object. additionalProperties: false properties: objectID: type: string description: Unique identifier of a synonym object. example: synonymID type: $ref: '#/components/schemas/SynonymType' corrections: type: array items: type: string description: Words to be matched in records. example: - vehicle - auto input: type: string description: >- Word or phrase to appear in query strings (for [`onewaysynonym`s](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/in-depth/one-way-synonyms)). example: car placeholder: type: string description: > [Placeholder token](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/in-depth/synonyms-placeholders) to be put inside records. example: replacements: type: array items: type: string description: >- Query words that will match the [placeholder token](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/in-depth/synonyms-placeholders). example: - street - st synonyms: type: array items: type: string description: Words or phrases considered equivalent. example: - vehicle - auto word: type: string description: >- Word or phrase to appear in query strings (for [`altcorrection1` and `altcorrection2`](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/in-depth/synonyms-alternative-corrections)). example: car required: - objectID - type id: type: string example: '12' description: Unique identifier of a synonym object. synonymHits: type: array description: Matching synonyms. items: $ref: '#/components/schemas/synonymHit' searchSynonymsResponse: type: object additionalProperties: true properties: hits: $ref: '#/components/schemas/synonymHits' nbHits: $ref: '#/components/schemas/nbHits' required: - hits - nbHits keyString: type: string description: API key. example: 13ad45b4d0a2f6ea65ecbddf6aa260f2 createdAtTimestamp: type: integer format: int64 example: 1656345570000 description: >- Timestamp when the object was created, in milliseconds since the Unix epoch. baseGetApiKeyResponse: type: object additionalProperties: false properties: createdAt: $ref: '#/components/schemas/createdAtTimestamp' value: $ref: '#/components/schemas/keyString' required: - value - createdAt acl: description: Access control list permissions. type: string enum: - addObject - analytics - browse - deleteObject - deleteIndex - editSettings - inference - listIndexes - logs - personalization - recommendation - search - seeUnretrievableAttributes - settings - usage - nluWriteProject - nluReadProject - nluWriteEntity - nluReadEntity - nluWriteIntent - nluReadIntent - nluPrediction - nluReadAnswers apiKey: type: object description: API key object. additionalProperties: false properties: acl: type: array description: > Permissions that determine the type of API requests this key can make. The required ACL is listed in each endpoint's reference. For more information, see [access control list](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). example: - search - addObject default: [] items: $ref: '#/components/schemas/acl' description: type: string description: Description of an API key to help you identify this API key. example: Used for indexing by the CLI default: '' indexes: type: array description: > Index names or patterns that this API key can access. By default, an API key can access all indices in the same application. You can use leading and trailing wildcard characters (`*`): - `dev_*` matches all indices starting with "dev_" - `*_dev` matches all indices ending with "_dev" - `*_products_*` matches all indices containing "_products_". example: - dev_* - prod_en_products default: [] items: type: string maxHitsPerQuery: type: integer description: | Maximum number of results this API key can retrieve in one query. By default, there's no limit. default: 0 maxQueriesPerIPPerHour: type: integer description: > Maximum number of API requests allowed per IP address or [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken) per hour. If this limit is reached, the API returns an error with status code `429`. By default, there's no limit. default: 0 queryParameters: type: string description: > Query parameters to add when making API requests with this API key. To restrict this API key to specific IP addresses, add the `restrictSources` parameter. You can only add a single source, but you can provide a range of IP addresses. Creating an API key fails if the request is made from an IP address outside the restricted range. example: typoTolerance=strict&restrictSources=192.168.1.0/24 default: '' referers: type: array description: > Allowed HTTP referrers for this API key. By default, all referrers are allowed. You can use leading and trailing wildcard characters (`*`): - `https://algolia.com/*` allows all referrers starting with "https://algolia.com/" - `*.algolia.com` allows all referrers ending with ".algolia.com" - `*algolia.com*` allows all referrers in the domain "algolia.com". Like all HTTP headers, referrers can be spoofed. Don't rely on them to secure your data. For more information, see [HTTP referrer restrictions](https://www.algolia.com/doc/guides/security/security-best-practices/#http-referrers-restrictions). example: - '*algolia.com*' default: [] items: type: string validity: type: integer description: | Duration (in seconds) after which the API key expires. By default, API keys don't expire. example: 86400 default: 0 required: - acl getApiKeyResponse: type: object properties: acl: type: array description: > Permissions that determine the type of API requests this key can make. The required ACL is listed in each endpoint's reference. For more information, see [access control list](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). example: - search - addObject default: [] items: $ref: '#/components/schemas/acl' createdAt: $ref: '#/components/schemas/createdAtTimestamp' value: $ref: '#/components/schemas/keyString' description: type: string description: Description of an API key to help you identify this API key. example: Used for indexing by the CLI default: '' indexes: type: array description: > Index names or patterns that this API key can access. By default, an API key can access all indices in the same application. You can use leading and trailing wildcard characters (`*`): - `dev_*` matches all indices starting with "dev_" - `*_dev` matches all indices ending with "_dev" - `*_products_*` matches all indices containing "_products_". example: - dev_* - prod_en_products default: [] items: type: string maxHitsPerQuery: type: integer description: | Maximum number of results this API key can retrieve in one query. By default, there's no limit. default: 0 maxQueriesPerIPPerHour: type: integer description: > Maximum number of API requests allowed per IP address or [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken) per hour. If this limit is reached, the API returns an error with status code `429`. By default, there's no limit. default: 0 queryParameters: type: string description: > Query parameters to add when making API requests with this API key. To restrict this API key to specific IP addresses, add the `restrictSources` parameter. You can only add a single source, but you can provide a range of IP addresses. Creating an API key fails if the request is made from an IP address outside the restricted range. example: typoTolerance=strict&restrictSources=192.168.1.0/24 default: '' referers: type: array description: > Allowed HTTP referrers for this API key. By default, all referrers are allowed. You can use leading and trailing wildcard characters (`*`): - `https://algolia.com/*` allows all referrers starting with "https://algolia.com/" - `*.algolia.com` allows all referrers ending with ".algolia.com" - `*algolia.com*` allows all referrers in the domain "algolia.com". Like all HTTP headers, referrers can be spoofed. Don't rely on them to secure your data. For more information, see [HTTP referrer restrictions](https://www.algolia.com/doc/guides/security/security-best-practices/#http-referrers-restrictions). example: - '*algolia.com*' default: [] items: type: string validity: type: integer description: | Duration (in seconds) after which the API key expires. By default, API keys don't expire. example: 86400 default: 0 required: - value - createdAt - acl additionalProperties: false description: API key object. addApiKeyResponse: type: object additionalProperties: false properties: createdAt: $ref: '#/components/schemas/createdAt' key: $ref: '#/components/schemas/keyString' required: - key - createdAt ruleID: title: objectID type: string description: Unique identifier of a rule object. anchoring: type: string description: | Which part of the search query the pattern should match: - `startsWith`. The pattern must match the beginning of the query. - `endsWith`. The pattern must match the end of the query. - `is`. The pattern must match the query exactly. - `contains`. The pattern must match anywhere in the query. Empty queries are only allowed as patterns with `anchoring: is`. enum: - is - startsWith - endsWith - contains context: type: string pattern: '[A-Za-z0-9_-]+' description: > An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter. For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`. A rule context must only contain alphanumeric characters. example: mobile condition: type: object additionalProperties: false properties: alternatives: type: boolean description: Whether the pattern should match plurals, synonyms, and typos. default: false anchoring: $ref: '#/components/schemas/anchoring' context: $ref: '#/components/schemas/context' filters: type: string description: > Filters that trigger the rule. You can add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected. You can use `filters` on its own or combine it with the `pattern` parameter. You can't combine multiple filters with `OR` and you can't use numeric filters. example: genre:comedy pattern: type: string description: > Query pattern that triggers the rule. You can use either a literal string, or a special pattern `{facet:ATTRIBUTE}`, where `ATTRIBUTE` is a facet name. The rule is triggered if the query matches the literal string or a value of the specified facet. For example, with `pattern: {facet:genre}`, the rule is triggered when users search for a genre, such as "comedy". example: '{facet:genre}' editType: description: Type of edit. type: string enum: - remove - replace edit: type: object additionalProperties: false properties: delete: description: Text or patterns to remove from the query string. type: string insert: description: >- Text to be added in place of the deleted text inside the query string. type: string type: $ref: '#/components/schemas/editType' consequenceQueryObject: type: object additionalProperties: false properties: edits: description: Changes to make to the search query. type: array items: $ref: '#/components/schemas/edit' remove: description: Words to remove from the search query. type: array items: type: string consequenceQuery: description: > Replace or edit the search query. If `consequenceQuery` is a string, the entire search query is replaced with that string. If `consequenceQuery` is an object, it describes incremental edits made to the query. oneOf: - $ref: '#/components/schemas/consequenceQueryObject' - type: string automaticFacetFilter: type: object description: Filter or optional filter to be applied to the search. additionalProperties: false properties: facet: type: string description: > Facet name to be applied as filter. The name must match placeholders in the `pattern` parameter. For example, with `pattern: {facet:genre}`, `automaticFacetFilters` must be `genre`. disjunctive: type: boolean default: false description: > Whether the filter is disjunctive or conjunctive. If true the filter has multiple matches, multiple occurrences are combined with the logical `OR` operation. If false, multiple occurrences are combined with the logical `AND` operation. score: type: integer default: 1 description: Filter scores to give different weights to individual filters. required: - facet automaticFacetFilters: description: > Filter to be applied to the search. You can use this to respond to search queries that match a facet value. For example, if users search for "comedy", which matches a facet value of the "genre" facet, you can filter the results to show the top-ranked comedy movies. oneOf: - type: array items: $ref: '#/components/schemas/automaticFacetFilter' - type: array items: type: string params: type: object description: > Parameters to apply to this search. You can use all search parameters, plus special `automaticFacetFilters`, `automaticOptionalFacetFilters`, and `query`. additionalProperties: false properties: automaticFacetFilters: $ref: '#/components/schemas/automaticFacetFilters' automaticOptionalFacetFilters: $ref: '#/components/schemas/automaticFacetFilters' query: $ref: '#/components/schemas/consequenceQuery' renderingContent: $ref: '#/components/schemas/renderingContent' consequenceParams: type: object properties: advancedSyntax: $ref: '#/components/schemas/advancedSyntax' advancedSyntaxFeatures: $ref: '#/components/schemas/IndexSettings_advancedSyntaxFeatures' allowTyposOnNumericTokens: $ref: '#/components/schemas/allowTyposOnNumericTokens' alternativesAsExact: $ref: '#/components/schemas/IndexSettings_alternativesAsExact' analytics: $ref: '#/components/schemas/analytics' analyticsTags: $ref: '#/components/schemas/analyticsTags' x-categories: - Analytics aroundLatLng: $ref: '#/components/schemas/aroundLatLng' aroundLatLngViaIP: $ref: '#/components/schemas/aroundLatLngViaIP' aroundPrecision: $ref: '#/components/schemas/aroundPrecision' aroundRadius: $ref: '#/components/schemas/aroundRadius' attributeCriteriaComputedByMinProximity: $ref: '#/components/schemas/attributeCriteriaComputedByMinProximity' attributesToHighlight: $ref: '#/components/schemas/attributesToHighlight' attributesToRetrieve: $ref: '#/components/schemas/attributesToRetrieve' attributesToSnippet: $ref: '#/components/schemas/attributesToSnippet' automaticFacetFilters: $ref: '#/components/schemas/automaticFacetFilters' automaticOptionalFacetFilters: $ref: '#/components/schemas/automaticFacetFilters' clickAnalytics: $ref: '#/components/schemas/clickAnalytics' decompoundQuery: $ref: '#/components/schemas/decompoundQuery' disableExactOnAttributes: $ref: '#/components/schemas/disableExactOnAttributes' disableTypoToleranceOnAttributes: $ref: '#/components/schemas/disableTypoToleranceOnAttributes' distinct: $ref: '#/components/schemas/distinct' enableABTest: $ref: '#/components/schemas/enableABTest' enablePersonalization: $ref: '#/components/schemas/enablePersonalization' enableReRanking: $ref: '#/components/schemas/enableReRanking' enableRules: $ref: '#/components/schemas/enableRules' exactOnSingleWordQuery: $ref: '#/components/schemas/exactOnSingleWordQuery' facetFilters: $ref: '#/components/schemas/facetFilters' facetingAfterDistinct: $ref: '#/components/schemas/facetingAfterDistinct' facets: type: array items: type: string description: > Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts). default: [] example: - '*' x-categories: - Faceting filters: $ref: '#/components/schemas/filters' getRankingInfo: $ref: '#/components/schemas/getRankingInfo' highlightPostTag: $ref: '#/components/schemas/highlightPostTag' highlightPreTag: $ref: '#/components/schemas/highlightPreTag' hitsPerPage: $ref: '#/components/schemas/hitsPerPage' ignorePlurals: $ref: '#/components/schemas/ignorePlurals' insideBoundingBox: $ref: '#/components/schemas/insideBoundingBox' insidePolygon: $ref: '#/components/schemas/insidePolygon' length: $ref: '#/components/schemas/length' maxValuesPerFacet: $ref: '#/components/schemas/maxValuesPerFacet' minimumAroundRadius: $ref: '#/components/schemas/minimumAroundRadius' minProximity: $ref: '#/components/schemas/minProximity' minWordSizefor1Typo: $ref: '#/components/schemas/minWordSizefor1Typo' minWordSizefor2Typos: $ref: '#/components/schemas/minWordSizefor2Typos' mode: $ref: '#/components/schemas/mode' naturalLanguages: $ref: '#/components/schemas/naturalLanguages' numericFilters: $ref: '#/components/schemas/numericFilters' offset: type: integer description: Position of the first hit to retrieve. x-categories: - Pagination optionalFilters: $ref: '#/components/schemas/optionalFilters' optionalWords: $ref: '#/components/schemas/optionalWords' page: $ref: '#/components/schemas/page' percentileComputation: $ref: '#/components/schemas/percentileComputation' personalizationImpact: $ref: '#/components/schemas/personalizationImpact' query: $ref: '#/components/schemas/consequenceQuery' queryLanguages: $ref: '#/components/schemas/queryLanguages' queryType: $ref: '#/components/schemas/queryType' ranking: type: array items: type: string description: > Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute), you put the sorting attribute at the top of the list. **Modifiers** - `asc("ATTRIBUTE")`. Sort the index by the values of an attribute, in ascending order. - `desc("ATTRIBUTE")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing). default: - typo - geo - words - filters - proximity - attribute - exact - custom x-categories: - Ranking relevancyStrictness: $ref: '#/components/schemas/relevancyStrictness' removeStopWords: $ref: '#/components/schemas/removeStopWords' removeWordsIfNoResults: $ref: '#/components/schemas/removeWordsIfNoResults' renderingContent: $ref: '#/components/schemas/renderingContent' replaceSynonymsInHighlight: $ref: '#/components/schemas/replaceSynonymsInHighlight' reRankingApplyFilter: oneOf: - $ref: '#/components/schemas/reRankingApplyFilter' - type: 'null' responseFields: $ref: '#/components/schemas/responseFields' restrictHighlightAndSnippetArrays: $ref: '#/components/schemas/restrictHighlightAndSnippetArrays' restrictSearchableAttributes: $ref: '#/components/schemas/restrictSearchableAttributes' ruleContexts: $ref: '#/components/schemas/ruleContexts' semanticSearch: $ref: '#/components/schemas/semanticSearch' similarQuery: $ref: '#/components/schemas/similarQuery' snippetEllipsisText: $ref: '#/components/schemas/snippetEllipsisText' sortFacetValuesBy: $ref: '#/components/schemas/sortFacetValuesBy' sumOrFiltersScores: $ref: '#/components/schemas/sumOrFiltersScores' synonyms: $ref: '#/components/schemas/synonyms' tagFilters: $ref: '#/components/schemas/tagFilters' typoTolerance: $ref: '#/components/schemas/typoTolerance' userToken: $ref: '#/components/schemas/userToken' additionalProperties: false description: > Parameters to apply to this search. You can use all search parameters, plus special `automaticFacetFilters`, `automaticOptionalFacetFilters`, and `query`. promotePosition: type: integer description: >- Position in the search results where you want to show the promoted records. example: 0 promoteObjectIDs: title: objectIDs description: Records to promote. type: object additionalProperties: false properties: objectIDs: type: array maxItems: 100 description: | Object IDs of the records you want to promote. The records are placed as a group at the `position`. For example, if you want to promote four records to position `0`, they will be the first four search results. items: $ref: '#/components/schemas/objectID' position: $ref: '#/components/schemas/promotePosition' required: - position - objectIDs x-discriminator-fields: - objectIDs promoteObjectID: title: objectID description: Record to promote. type: object additionalProperties: false properties: objectID: $ref: '#/components/schemas/objectID' position: $ref: '#/components/schemas/promotePosition' required: - position - objectID x-discriminator-fields: - objectID promote: oneOf: - $ref: '#/components/schemas/promoteObjectIDs' - $ref: '#/components/schemas/promoteObjectID' consequence: type: object description: > Effect of the rule. For more information, see [Consequences](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#consequences). additionalProperties: false properties: filterPromotes: type: boolean default: false description: > Determines whether promoted records must also match active filters for the consequence to apply. This ensures user-applied filters take priority and irrelevant matches aren't shown. For example, if you promote a record with `color: red` but the user filters for `color: blue`, the "red" record won't be shown. > In the Algolia dashboard, when you use the **Pin an item** consequence, `filterPromotes` appears as the checkbox: **Pinned items must match active filters to be displayed.** For examples, see [Promote results with rules](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/promote-hits/#promote-results-matching-active-filters). hide: type: array maxItems: 50 description: Records you want to hide from the search results. items: title: consequenceHide type: object description: Object ID of the record to hide. additionalProperties: false properties: objectID: $ref: '#/components/schemas/objectID' required: - objectID params: $ref: '#/components/schemas/consequenceParams' promote: type: array maxItems: 300 description: > Records you want to pin to a specific position in the search results. You can promote up to 300 records, either individually, or as groups of up to 100 records each. items: $ref: '#/components/schemas/promote' redirect: title: consequenceRedirect type: object description: | Redirect to a virtual replica index. This consequence is only valid for rules with `scope: redirect`. additionalProperties: false properties: indexName: type: string description: Name of the virtual replica index to redirect searches to. required: - indexName userData: type: object description: > A JSON object with custom data that will be appended to the `userData` array in the response. This object isn't interpreted by the API and is limited to 1 kB of minified JSON. example: settingID: f2a7b51e3503acc6a39b3784ffb84300 pluginVersion: 1.6.0 timeRange: type: object additionalProperties: false properties: from: type: integer format: int64 description: >- Timestamp when the rule should start to be active, measured in seconds since the Unix epoch. until: type: integer format: int64 description: >- Timestamp when the rule should stop to be active, measured in seconds since the Unix epoch. rule: type: object description: Rule object. additionalProperties: false properties: consequence: $ref: '#/components/schemas/consequence' objectID: $ref: '#/components/schemas/ruleID' condition: deprecated: true description: > Legacy field for a single condition. This field is maintained for backward compatibility with older rules but should not be used in new implementations. $ref: '#/components/schemas/condition' conditions: type: array minItems: 0 maxItems: 25 description: > Conditions that trigger a rule. Some consequences require specific conditions or don't require any condition. For more information, see [Conditions](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#conditions). items: $ref: '#/components/schemas/condition' description: type: string description: >- Description of the rule's purpose to help you distinguish between different rules. example: Display a promotional banner enabled: type: boolean default: true description: Whether the rule is active. scope: type: string tags: type: array items: type: string validity: type: array description: Time periods when the rule is active. items: $ref: '#/components/schemas/timeRange' required: - objectID - consequence parameters_query: type: string description: Search query for rules. default: '' parameters_page: type: integer minimum: 0 description: > Requested page of the API response. Algolia uses `page` and `hitsPerPage` to control how search results are displayed ([paginated](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js)). - `hitsPerPage`: sets the number of search results (_hits_) displayed per page. - `page`: specifies the page number of the search results you want to retrieve. Page numbering starts at 0, so the first page is `page=0`, the second is `page=1`, and so on. For example, to display 10 results per page starting from the third page, set `hitsPerPage` to 10 and `page` to 2. parameters_hitsPerPage: type: integer default: 20 minimum: 1 maximum: 1000 description: > Maximum number of hits per page. Algolia uses `page` and `hitsPerPage` to control how search results are displayed ([paginated](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js)). - `hitsPerPage`: sets the number of search results (_hits_) displayed per page. - `page`: specifies the page number of the search results you want to retrieve. Page numbering starts at 0, so the first page is `page=0`, the second is `page=1`, and so on. For example, to display 10 results per page starting from the third page, set `hitsPerPage` to 10 and `page` to 2. dictionaryType: type: string enum: - plurals - stopwords - compounds dictionaryAction: type: string enum: - addEntry - deleteEntry description: Actions to perform. dictionaryEntryState: type: string enum: - enabled - disabled default: enabled description: Whether a dictionary entry is active. dictionaryEntryType: type: string enum: - custom - standard description: >- Whether a dictionary entry is provided by Algolia (standard), or has been added by you (custom). dictionaryEntry: type: object description: Dictionary entry. additionalProperties: true required: - objectID properties: objectID: type: string description: Unique identifier for the dictionary entry. example: 828afd405e1f4fe950b6b98c2c43c032 decomposition: type: array description: >- Invividual components of a compound word in the `compounds` dictionary. example: - kopf - schmerz - tablette items: type: string language: $ref: '#/components/schemas/supportedLanguage' state: $ref: '#/components/schemas/dictionaryEntryState' type: $ref: '#/components/schemas/dictionaryEntryType' word: type: string description: >- Matching dictionary word for `stopwords` and `compounds` dictionaries. example: the words: type: array description: Matching words in the `plurals` dictionary including declensions. example: - cheval - cheveaux items: type: string searchDictionaryEntriesResponse: type: object additionalProperties: false properties: hits: type: array description: Dictionary entries matching the search criteria. items: $ref: '#/components/schemas/dictionaryEntry' nbHits: $ref: '#/components/schemas/nbHits' nbPages: $ref: '#/components/schemas/nbPages' page: $ref: '#/components/schemas/parameters_page' required: - hits - page - nbHits - nbPages standardEntry: oneOf: - type: object description: Key-value pair of a language ISO code and a boolean value. example: fr: false additionalProperties: x-additionalPropertiesName: language type: boolean - type: 'null' standardEntries: type: object description: > Key-value pairs of [supported language ISO codes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages) and boolean values. additionalProperties: false properties: compounds: $ref: '#/components/schemas/standardEntry' plurals: $ref: '#/components/schemas/standardEntry' stopwords: $ref: '#/components/schemas/standardEntry' dictionaryLanguage: oneOf: - type: object additionalProperties: false description: >- Dictionary type. If `null`, this dictionary type isn't supported for the language. properties: nbCustomEntries: description: Number of custom dictionary entries. type: integer - type: 'null' languages: type: object description: Dictionary language. additionalProperties: false required: - plurals - stopwords - compounds properties: compounds: $ref: '#/components/schemas/dictionaryLanguage' plurals: $ref: '#/components/schemas/dictionaryLanguage' stopwords: $ref: '#/components/schemas/dictionaryLanguage' userID: type: string pattern: ^[a-zA-Z0-9 \-*.]+$ description: Unique identifier of the user who makes the search request. example: user1 userId: title: userID type: object description: Unique user ID. properties: clusterName: type: string description: Cluster to which the user is assigned. example: c1-test dataSize: type: integer description: Data size used by the user. example: 0 nbRecords: type: integer description: Number of records belonging to the user. example: 42 userID: $ref: '#/components/schemas/userID' required: - userID - clusterName - nbRecords - dataSize clusterName: type: string description: Cluster name. example: c11-test nbRecords: type: integer description: Number of records in the cluster. example: 3 dataSize: type: integer description: Data size taken by all the users assigned to the cluster. example: 481 source: type: object description: Source. required: - source properties: source: description: IP address range of the source. type: string example: 10.0.0.1/32 description: description: Source description. type: string example: Server subnet sources: description: Sources. type: array items: $ref: '#/components/schemas/source' logType: type: string enum: - all - query - build - error default: all taskStatus: type: string enum: - published - notPublished description: >- Task status, `published` if the task is completed, `notPublished` otherwise. GetTaskResponse: title: getTaskResponse type: object additionalProperties: false properties: status: $ref: '#/components/schemas/taskStatus' required: - status operationType: type: string enum: - move - copy example: copy description: Operation to perform on the index. scopeType: type: string enum: - settings - synonyms - rules fetchedIndexAbTestTarget: title: abTestTarget type: object description: A/B test target criteria. Only present for v2 and later tests. properties: indexName: type: string description: Index name to match. Use `*` to target the entire application. example: movies required: - indexName fetchedIndexAbTestVariant: title: abTestVariant type: object description: A/B test variant for an index. properties: percentage: type: integer description: Percentage of search traffic routed to this variant. example: 50 customSearchParameters: type: string description: >- URL-encoded custom search parameters applied to this variant. Only present for v0/v1 tests; in v2 this moves into `payload`. indexName: type: string description: >- Index name of the variant. Only present for v0/v1 tests; in v2 this moves into `payload`. example: movies payload: type: object additionalProperties: true description: >- Type-specific configuration. Only present for v2 and later tests. Shape depends on the parent A/B test's `type`. required: - percentage fetchedIndexAbTest: title: abTest type: object description: >- A/B test metadata. Only present if the index is part of an active A/B test. properties: id: type: integer description: A/B test ID. example: 12345 variants: type: array description: A/B test variants. items: $ref: '#/components/schemas/fetchedIndexAbTestVariant' target: $ref: '#/components/schemas/fetchedIndexAbTestTarget' type: type: string description: >- A/B test type. Only present for v2 and later tests. Currently always `index-configuration`. example: index-configuration version: type: integer description: A/B test schema version. Only present for v2 and later tests. example: 2 required: - id - variants fetchedIndex: type: object additionalProperties: false properties: createdAt: type: string description: >- Index creation date. An empty string means that the index has no records. example: '2022-09-19T16:36:44.471Z' dataSize: type: integer format: int64 description: Number of bytes of the index in minified format. example: 48450 entries: type: integer description: Number of records contained in the index. example: 100 fileSize: type: integer format: int64 description: Number of bytes of the index binary file. example: 112927 lastBuildTimeS: type: integer description: Last build time. example: 3 name: type: string description: Index name. example: movies numberOfPendingTasks: type: integer default: 0 description: >- Number of pending indexing operations. This value is deprecated and should not be used. pendingTask: type: boolean default: false description: >- A boolean which says whether the index has pending tasks. This value is deprecated and should not be used. updatedAt: $ref: '#/components/schemas/updatedAt' abTest: $ref: '#/components/schemas/fetchedIndexAbTest' primary: type: string description: >- Only present if the index is a replica. Contains the name of the related primary index. example: T02 replicas: type: array items: type: string description: >- Only present if the index is a primary index with replicas. Contains the names of all linked replicas. example: - T02_push - T2replica sourceABTest: type: string description: >- Name of the index that owns the A/B test configuration. Only present when this index participates in an A/B test configured on another index. example: movies_dev_a virtual: type: boolean description: >- Only present if the index is a [virtual replica](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-an-index-alphabetically/#virtual-replicas). x-categories: - Ranking required: - name - createdAt - updatedAt - entries - dataSize - fileSize - lastBuildTimeS - pendingTask - numberOfPendingTasks listIndicesResponse: type: object additionalProperties: false properties: items: type: array description: All indices in your Algolia application. items: $ref: '#/components/schemas/fetchedIndex' nbPages: type: integer description: Number of pages. example: 100 required: - items apiKeyOperation: type: string enum: - add - delete - update securedApiKeyRestrictions: type: object additionalProperties: false properties: filters: type: string description: > Filters that apply to every search made with the secured API key. Extra filters added at search time will be combined with `AND`. For example, if you set `group:admin` as fixed filter on your generated API key, and add `groups:visitors` to the search query, the complete set of filters will be `group:admin AND groups:visitors`. restrictIndices: type: array items: type: string description: > Index names or patterns that this API key can access. By default, an API key can access all indices in the same application. You can use leading and trailing wildcard characters (`*`): - `dev_*` matches all indices starting with "dev_" - `*_dev` matches all indices ending with "_dev" - `*_products_*` matches all indices containing "_products_". restrictSources: type: string description: > IP network that are allowed to use this key. You can only add a single source, but you can provide a range of IP addresses. Use this to protect against API key leaking and reuse. example: 192.168.1.0/24 searchParams: $ref: '#/components/schemas/searchParamsObject' userToken: type: string description: > Pseudonymous user identifier to restrict usage of this API key to specific users. By default, rate limits are set based on IP addresses. This can be an issue if many users search from the same IP address. To avoid this, add a user token to each generated API key. validUntil: type: integer format: int64 description: >- Timestamp when the secured API key expires, measured in seconds since the Unix epoch. replaceAllObjectsResponse: type: object additionalProperties: false properties: batchResponses: type: array description: The response of the `batch` request(s). items: $ref: '#/components/schemas/batchResponse' copyOperationResponse: description: >- The response of the `operationIndex` request for the `copy` operation. $ref: '#/components/schemas/updatedAtResponse' moveOperationResponse: description: >- The response of the `operationIndex` request for the `move` operation. $ref: '#/components/schemas/updatedAtResponse' required: - copyOperationResponse - batchResponses - moveOperationResponse RunID: type: string description: Universally unique identifier (UUID) of a task run. example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f EventID: type: string description: Universally unique identifier (UUID) of an event. example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f EventStatus: oneOf: - type: string enum: - created - started - retried - failed - succeeded - critical - type: 'null' EventType: type: string enum: - fetch - record - log - transform PublishedAt: type: string description: Date and time when the resource was published, in RFC 3339 format. Event: type: object description: An event describe a step of the task execution flow. additionalProperties: false properties: batchSize: type: integer description: The extracted record batch size. example: 10 minimum: 0 multipleOf: 1 eventID: $ref: '#/components/schemas/EventID' publishedAt: $ref: '#/components/schemas/PublishedAt' runID: $ref: '#/components/schemas/RunID' status: $ref: '#/components/schemas/EventStatus' type: $ref: '#/components/schemas/EventType' data: oneOf: - type: object additionalProperties: true - type: 'null' required: - eventID - runID - status - type - batchSize - publishedAt CreatedAt: type: string description: Date and time when the resource was created, in RFC 3339 format. WatchResponse: type: object additionalProperties: false properties: runID: $ref: '#/components/schemas/RunID' createdAt: $ref: '#/components/schemas/CreatedAt' data: type: array description: > This field is always null when used with the Push endpoint. When used for a source discover or source validate run, it will include the sampled data of the source. items: type: object eventID: $ref: '#/components/schemas/EventID' events: description: >- in case of error, observability events will be added to the response. type: array items: $ref: '#/components/schemas/Event' message: description: >- a message describing the outcome of the operation that has been ran (push, discover or validate) run. type: string required: - runID replaceAllObjectsWithTransformationResponse: type: object additionalProperties: false properties: copyOperationResponse: description: >- The response of the `operationIndex` request for the `copy` operation. $ref: '#/components/schemas/updatedAtResponse' moveOperationResponse: description: >- The response of the `operationIndex` request for the `move` operation. $ref: '#/components/schemas/updatedAtResponse' watchResponses: type: array description: The response of the `push` request(s). items: $ref: '#/components/schemas/WatchResponse' required: - copyOperationResponse - watchResponses - moveOperationResponse builtInOperationType: type: string enum: - Increment - Decrement - Add - Remove - AddUnique - IncrementFrom - IncrementSet description: How to change the attribute. builtInOperationValue: oneOf: - type: string description: >- A string to append or remove for the `Add`, `Remove`, and `AddUnique` operations. - type: integer description: A number to add, remove, or append, depending on the operation. builtInOperation: type: object description: Update to perform on the attribute. additionalProperties: false properties: _operation: $ref: '#/components/schemas/builtInOperationType' value: $ref: '#/components/schemas/builtInOperationValue' required: - _operation - value parameters: PathInPath: name: path in: path description: Path of the endpoint, for example `1/newFeature`. required: true schema: type: string example: /keys Parameters: name: parameters in: query description: Query parameters to apply to the current query. schema: type: object additionalProperties: true IndexName: name: indexName in: path description: Name of the index on which to perform the operation. required: true schema: type: string example: ALGOLIA_INDEX_NAME ObjectID: name: objectID in: path description: Unique record identifier. required: true schema: $ref: '#/components/schemas/objectID' getVersion: name: getVersion description: >- When set to 2, the endpoint will not include `synonyms` in the response. This parameter is here for backward compatibility. in: query schema: type: integer default: 1 ForwardToReplicas: in: query name: forwardToReplicas required: false description: Whether changes are applied to replica indices. schema: type: boolean parameters_ObjectID: name: objectID in: path description: Unique identifier of a synonym object. required: true schema: type: string example: synonymID ReplaceExistingSynonyms: in: query name: replaceExistingSynonyms schema: type: boolean description: >- Whether to replace all synonyms in the index with the ones sent with this request. KeyString: in: path name: key required: true schema: type: string example: ALGOLIA_API_KEY description: API key. ObjectIDRule: in: path name: objectID description: Unique identifier of a rule object. required: true schema: $ref: '#/components/schemas/ruleID' ClearExistingRules: in: query name: clearExistingRules required: false schema: type: boolean description: Whether existing rules should be deleted before adding this batch. DictionaryName: in: path name: dictionaryName description: Dictionary type in which to search. required: true schema: $ref: '#/components/schemas/dictionaryType' Page: in: query name: page description: | Requested page of the API response. If `null`, the API response is not paginated. required: false schema: oneOf: - type: integer minimum: 0 - type: 'null' default: null HitsPerPage: in: query name: hitsPerPage description: Number of hits per page. required: false schema: type: integer default: 100 UserIDInHeader: name: X-Algolia-User-ID description: Unique identifier of the user who makes the search request. in: header required: true schema: $ref: '#/components/schemas/userID' UserIDInPath: name: userID description: Unique identifier of the user who makes the search request. in: path required: true schema: $ref: '#/components/schemas/userID' responses: BadRequest: description: Bad request or request arguments. content: application/json: schema: $ref: '#/components/schemas/ErrorBase' FeatureNotEnabled: description: This feature is not enabled on your Algolia account. content: application/json: schema: $ref: '#/components/schemas/ErrorBase' MethodNotAllowed: description: Method not allowed with this API key. content: application/json: schema: $ref: '#/components/schemas/ErrorBase' IndexNotFound: description: Index not found. content: application/json: schema: $ref: '#/components/schemas/ErrorBase' DeletedAt: description: OK content: application/json: schema: title: deletedAtResponse description: Response, taskID, and deletion timestamp. additionalProperties: false type: object required: - taskID - deletedAt properties: deletedAt: $ref: '#/components/schemas/deletedAt' taskID: $ref: '#/components/schemas/taskID' UpdatedAtWithObjectId: description: OK content: application/json: schema: title: updatedAtWithObjectIdResponse description: >- Response, taskID, unique object identifier, and an update timestamp. additionalProperties: false type: object properties: objectID: $ref: '#/components/schemas/objectID' taskID: $ref: '#/components/schemas/taskID' updatedAt: $ref: '#/components/schemas/updatedAt' UpdatedAt: description: OK content: application/json: schema: $ref: '#/components/schemas/updatedAtResponse' CreatedAt: description: OK content: application/json: schema: title: createdAtResponse description: Response and creation timestamp. additionalProperties: false type: object required: - createdAt properties: createdAt: $ref: '#/components/schemas/createdAt' IndexInSameApp: description: Indices are in the same application. Use operationIndex instead. content: application/json: schema: $ref: '#/components/schemas/ErrorBase' IndexAlreadyExists: description: Destination index already exists. content: application/json: schema: $ref: '#/components/schemas/ErrorBase' x-tagGroups: - name: Search and indexing tags: - Indices - Records - Search - name: Relevance tags: - Rules - Synonyms - Dictionaries - name: Others tags: - Api Keys - Clusters - Vaults - Advanced - name: Models tags: - _model_index_settings