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

# Time-Based Partitioning

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/4/fusion-server/concepts/indexing/collections/time-based-partitioning

[mintlify link]: https://doc.lucidworks.com/docs/4/fusion-server/concepts/indexing/collections/time-based-partitioning

[old doc.lw link]: https://doc.lucidworks.com/fusion-server/4.2/165

A Fusion collection can be configured to map to multiple Solr collections, known as partitions in this context, where each partition contains data from a specific time range. An example is time-based partitioning for logs:

<img src="https://mintcdn.com/lucidworks/pcVooZE8fTjtTbXE/assets/images/common/time_based_partitioning.png?fit=max&auto=format&n=pcVooZE8fTjtTbXE&q=85&s=6bb0c3092acd2c165f7e2fa6b39c3df3" alt="time based partitioning" width="2626" height="1288" data-path="assets/images/common/time_based_partitioning.png" />

Once a collection is configured for time-base partitioning, Fusion automatically ages out old partitions and creates new ones, using the configured partition sizes, expiration intervals, and so on. No manual maintenance is needed.

This feature is not enabled by default. Enable it for each collection using the
[Collection Features API](/docs/4/fusion-server/reference/api/collection-features-api).

<Note>
  Fusion cannot retroactively partition data that has already been indexed. It can only perform time-based partitioning on incoming data.
</Note>

<LwTemplate />

## Learn more

<Accordion title="Enable Time-based Partitioning">
  A Fusion collection can be configured to map to multiple Solr collections, known as partitions in this context, where each partition contains data from a specific time range. An example is time-based partitioning for logs:

  <img src="https://mintcdn.com/lucidworks/pcVooZE8fTjtTbXE/assets/images/common/time_based_partitioning.png?fit=max&auto=format&n=pcVooZE8fTjtTbXE&q=85&s=6bb0c3092acd2c165f7e2fa6b39c3df3" alt="time_based_partitioning" width="2626" height="1288" data-path="assets/images/common/time_based_partitioning.png" />

  * In the UI, you can only enable time-based partitioning for *new* collections.
  * In the API, you can only enable time-based partitioning for *existing* collections.

  ## Enablement using the Fusion UI

  1. Open the Collections Manager:
       <img src="https://mintcdn.com/lucidworks/qCaM85k6rX7hs1DP/assets/images/4.0/workspace-collections-manager.png?fit=max&auto=format&n=qCaM85k6rX7hs1DP&q=85&s=4d456b3ef55af6586668e7c1fa6cde79" alt="Collections Manager" width="842" height="910" data-path="assets/images/4.0/workspace-collections-manager.png" />
  2. Click **New**.\
     <Note>   In the UI, you can only enable time-based partitioning for *new* collections. To enable it for an existing collection, [use the API](#enablement-using-the-api).</Note>
  3. Click **Advanced**.
       <img src="https://mintcdn.com/lucidworks/5yWZ-KtZuBe4Y_Fg/assets/images/4.0/collections-manager-advanced.png?fit=max&auto=format&n=5yWZ-KtZuBe4Y_Fg&q=85&s=769cfa4d95ff864ea4c7178656c0b68d" alt="Advanced" width="2459" height="1314" data-path="assets/images/4.0/collections-manager-advanced.png" />
  4. Scroll down to "Time Series Partitioning".
  5. Click **Enable**.\\
       <img src="https://mintcdn.com/lucidworks/5yWZ-KtZuBe4Y_Fg/assets/images/4.0/collections-manager-timeseries-config.png?fit=max&auto=format&n=5yWZ-KtZuBe4Y_Fg&q=85&s=6a0cb950551accb10eb00fbebe661cf5" alt="Enable Time Series Partitioning" width="2461" height="1324" data-path="assets/images/4.0/collections-manager-timeseries-config.png" />
     When you enable this option, Fusion displays the time series partitioning configuration options.
  6. Save the collection.

  ## Enablement using the API

  Use the Collection Features API] to enable time-based partitioning for an existing collection.

  **Enable time-based partitioning using the default configuration:**

  ```bash wrap theme={"dark"}
  curl -X PUT -H 'Content-type: application/json' -d '{"enabled": true}' http://localhost:8764/api/collections/COLLECTION_NAME/features/partitionByTime
  ```

  No response is returned.

  Submit an empty request to the same endpoint to verify that time-based partitioning is enabled:

  ```bash wrap theme={"dark"}
  curl -X GET http://localhost:8764/api/collections/COLLECTION_NAME/features/partitionByTime
  ```

  Response:

  ```json theme={"dark"}
  {
    "name" : "partitionByTime",
    "collectionId" : "COLLECTION_NAME",
    "params" : { },
    "enabled" : true
  }
  ```
</Accordion>
