> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Clear objects

> Clear the records of an index without affecting its settings.

export const Legacy = ({title, href}) => {
  return <Note>

    This page documents an earlier version of the API client.
    For the latest version, see <a href={href}>{title}</a>.

    </Note>;
};

export const serviceLimits = {
  application: {
    applicationSize: "100 GB (or 1 GB for the Build plan)",
    indexSize: "100 GB (or 1 GB for the Build plan)",
    indexingOperations: "Depends on your plan and usage.",
    indexingRate: "10,000 indexing operations per Unit (as applicable)",
    indexingRequestBodySize: "1 GB per batch",
    indicesPerApplication: "1,000 (Premium), 50 (Grow), or 10 (Build)",
    customNormalizations: "10",
    pendingRequests: "5,000",
    recordSize: "10 KB to 100 KB—based on your plan (10 KB maximum for the Build plan)",
    searchRequestBodySize: "50 MB per request",
    sortCriterionLength: "First 50 bytes (50 characters for ASCII text)",
    synonymsPerIndex: "10,000 (or 1,000 for the Build plan)",
    throttlingLimit: "100 pending requests",
    virtualReplicasPerIndex: "20"
  },
  filtersFacetsRules: {
    conditionsPerRule: "25",
    filterScore: "65,535",
    maxRatioFacetValuePairs: "0.1",
    numberOfFilters: "1,000",
    promotedItemsPerGroup: "100",
    promotedItemsPerRule: "300",
    ruleConsequenceSize: "100 KiB",
    queryParameterSize: "16 KiB",
    valuesPerFacetPerQuery: "1,000",
    reorderedFacetsPerQuery: "20",
    reorderedFacetValuesPerQuery: "20",
    precomputedFacetOrderingQueries: "100,000"
  },
  searchUI: {
    pagination: "20,000",
    querySuggestions: "100",
    querySize: "512 bytes"
  },
  insightsAnalytics: {
    analyticsApiCalls: "100 API calls per minute per app",
    tagSize: "100 characters",
    tagsProcessedPerIndex: "1,750 unique tag combinations every 5 minutes",
    topSearches: "1,000"
  },
  security: {
    apiKeys: "5,000"
  },
  connectors: {
    authenticationsPerApp: "200",
    sourcesPerApp: "100",
    destinationsPerApp: "500",
    tasksPerSource: "10",
    pushPayloadSize: "5 MB per API call",
    pushWatchDuration: "3 minutes",
    jsonFileSize: "1 GB",
    jsonFileRows: "1,000,000",
    csvFileSize: "1 GB",
    csvFileRows: "1,000,000",
    pushEndpointRate: "2000 calls per minute per IP",
    observabilityRate: "2000 calls per minute per IP",
    runTaskRate: "10 calls per 10 minute per taskID",
    otherEndpointsRate: "200 calls per minute per IP"
  },
  dataTransformation: {
    codeSize: "32 kB",
    runtime: "1 second per transformation",
    memory: "100 kB per request",
    transformationsPerApplication: "5 million per month",
    fetchEnrichmentRequests: "Up to 1 million Fetch requests per Application per month, as part the 5 million transformations per Application per month limit.",
    fetchTimeout: "30 seconds per Record",
    fetchResponseSize: "128 kB"
  },
  collections: {
    collectionsPerIndex: "500 (Premium plan) or 1,000 (Elevate plan)",
    conditionsPerCollection: "50",
    manuallySelectedItemsPerCollection: "10,000",
    objectIdSize: "200 characters"
  },
  smartGroups: {
    groupsPerCuratedQuery: "3",
    recordsPerGroup: "50",
    highestStartPosition: "100",
    compositionsPerApplication: "100",
    compositionRulesPerComposition: "200",
    disjunctiveFacetsPerRequest: "20",
    hitsPerPage: "1000"
  },
  docSearch: {
    applicationSize: "25 GB",
    indexSize: "25 GB",
    recordSize: "100 kB",
    indicesPerApplication: "20",
    queriesPerSecond: "3",
    teamMembers: "10"
  },
  generativeGuides: {
    guidesPerIndex: "1,000",
    sizePerGuide: "100 kB",
    inputTokensPerGeneration: "50,000",
    outputTokensPerGeneration: "2,000"
  },
  agentStudio: {
    conversationsRetained: "100,000",
    completionsPerMinute: "3,000",
    retentionPolicy: "90 days",
    agentsPerApp: "500"
  }
};

<Legacy title="Delete all records from an index" href="/doc/libraries/sdk/methods/search/clear-objects" />

**Required ACL:** `deleteIndex`

This method enables you to **delete an index's contents** (records)
without removing any settings, rules and synonyms.

If you want to **remove the entire index** and not just its records,
**use the [delete method](/doc/libraries/sdk/v1/methods/delete-index) instead**.

Clearing an index has **no impact on its Analytics data** because
[you can't clear an index's analytics data](/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/concepts/indices-analytics).

Clearing an index counts as one operation but **it's rate-limited:**

* If you have more than {serviceLimits.application.throttlingLimit}, your requests will be throttled.
* If you have more than {serviceLimits.application.pendingRequests} pending requests, further requests will be ignored.

## Examples

<CodeGroup>
  ```cs C# theme={"system"}
  index.ClearObjects();

  // Asynchronous
  await index.ClearObjectsAsync();
  ```

  ```go Go theme={"system"}
  res, err := index.ClearObjects()
  ```

  ```java Java theme={"system"}
  index.clearObjects();

  // Asynchronous
  index.clearObjectsAsync();
  ```

  ```js JavaScript theme={"system"}
  index.clearObjects().then(() => {
    // done
  });
  ```

  ```kotlin Kotlin theme={"system"}
  index.clearObjects()
  ```

  ```php PHP theme={"system"}
  $index->clearObjects();
  ```

  ```python Python theme={"system"}
  index.clear_objects()
  ```

  ```ruby Ruby theme={"system"}
  index.clear_objects
  ```

  ```scala Scala theme={"system"}
  client.execute { clear index "INDEX_NAME" }
  ```

  ```swift Swift theme={"system"}
  index.clearObjects { result in
    if case .success(let response) = result {
      print("Response: \(response)")
    }
  }
  ```
</CodeGroup>

## Parameters

<ParamField body="requestOptions" type="object">
  A mapping of request options to send along with the request.
</ParamField>

## Response

<ResponseField name="taskID" type="integer">
  This is the taskID which is used with the [`waitTask`](/doc/libraries/sdk/v1/methods/wait-task) method.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  Date at which the job to clear the index has been created.
</ResponseField>

### Response as JSON

This section shows the JSON response returned by the API.
Each API client wraps this response in language-specific objects, so the structure may vary.
To view the response, use the `getLogs` method.
Don't rely on the order of properties—JSON objects don't preserve key order.

```jsonc JSON icon=braces theme={"system"}
{
  "updatedAt": "2017-12-18T21:22:40.761Z",
  "taskID": 19541511530
}
```
