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

# Keep pinned items together with pin blocks

> Use pin blocks so that pinned items shift up to close gaps left by unavailable pinned items.

export const serviceLimits = {
  application: {
    applicationSize: "100 GB (or 1 GB for the Free plan)",
    indexSize: "100 GB (or 1 GB for the Free 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 (Free)",
    customNormalizations: "10",
    pendingRequests: "5,000",
    recordSize: "10 KB to 100 KB—based on your plan (10 KB maximum for the Free plan)",
    searchRequestBodySize: "50 MB per request",
    sortCriterionLength: "First 50 bytes (50 characters for ASCII text)",
    synonymsPerIndex: "10,000 (or 1,000 for the Free 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"
  },
  aiAssist: {
    combinedTokensPerAppPerDay: "25 million"
  }
};

export const Records = () => <Tooltip tip="A record is a searchable object in an Algolia index. Each record consists of named attributes." cta="Algolia records" href="/doc/guides/sending-and-managing-data/prepare-your-data#algolia-records">
    records
  </Tooltip>;

export const organicResultsDefinition = "These are the search results ranked by relevance and your configuration without compositions.";

export const OrganicResults = () => <Tooltip tip={organicResultsDefinition} cta="Smart Groups" href="/doc/guides/managing-results/compositions/smart-groups">
    organic results
  </Tooltip>;

export const Index = () => <Tooltip tip="An Algolia index is a searchable dataset that consists of records and configuration settings. These settings define how the records are searched and ranked.">
    index
  </Tooltip>;

export const Application = () => <Tooltip tip="An Algolia application is a self-contained environment with its own indices, configuration, and API keys. Applications don't share data or settings with each other.">
    application
  </Tooltip>;

export const AlgoliaSearch = () => <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" width="20" height="20" className="inline" fill="none" role="presentation" ariaLabel="Algolia Search">
    <circle cx="40" cy="32" r="28" fill="#5468FF"></circle>
    <rect x="30" y="22" width="20" height="20" rx="10" fill="#fff"></rect>
    <path d="M43 63.5 54.5 60l6 17h-12L43 63.5Z" fill="#36395A"></path>
  </svg>;

A pinned item can become unavailable if an active filter excludes it—for example, because it's out of stock—or you remove it from the <Index />.
When that happens, Algolia fills its position with the next organic result, leaving gaps in your curation.

A *pin block* groups contiguous pinned items so they behave as a unit.
If one item in the block becomes unavailable, the remaining pinned items shift up.
Algolia fills positions with <OrganicResults /> only after all available pinned items in the block have been placed.

## Pin block boundaries

A pin block is a set of adjacent pinned positions with no unpinned position between them.
An unpinned position splits the pins into separate blocks.

For example, pins at positions 1, 2, 3, 6, 7, and 8 form two pin blocks: one covering positions 1 to 3 and one covering positions 6 to 8.

* If you unpin an item inside a block, the remaining items stay together and the block's start position doesn't change.
* If you add a pin between two pins in a block, it joins that block.
* A rule can contain several pin blocks.

## Enable pin blocks

To enable pin blocks for a rule, turn on **Shift pins to close gaps** in the Visual Editor.

<Steps>
  <Step title="Open the Visual Editor">
    1. Go to the [Algolia dashboard](https://dashboard.algolia.com/explorer/browse) and select your Algolia <Application />.
    2. On the left sidebar, select <AlgoliaSearch /> **Search**.
    3. Select your Algolia <Index />.
    4. Select [**Rules**](https://dashboard.algolia.com/rules) from the left sidebar.
    5. Select **Create your first Rule** or **New rule**.
    6. Click **Visual Editor**.
  </Step>

  <Step title="Turn on pin blocks">
    Under **Consequences**, click **Pin items**, then turn on **Shift pins to close gaps**.
  </Step>

  <Step title="Pin your items">
    Pin items at adjacent positions to create a pin block.
    The Visual Editor labels each block so you can see which items stay together.
  </Step>

  <Step title="Publish the rule">
    Click **Apply**, then **Review and Publish** your rule.
  </Step>
</Steps>

## Default pin block behavior

**Shift pins to close gaps** is on for new rules and off for rules that already exist.
It stays off on existing rules to avoid changing live curation, so turn it on manually where you want it.

For existing rules created with the API that contain groups of pinned items,
the Visual Editor shows the setting as on.

## Filter matching requirements

**Shift pins to close gaps** depends on **Must match active filters**.
If you turn off that setting, the Visual Editor turns off pin blocks and disables the setting.

For more information, see [Promote results matching active filters](/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/promote-hits#promote-results-matching-active-filters).

## Pin block limits

Pin blocks don't change the limit on pinned items: by default, you can pin up to {serviceLimits.filtersFacetsRules.promotedItemsPerRule} <Records /> per rule.
A single pin block can hold up to that limit, and there's no separate limit on the number of blocks per rule.

## See also

* [Promote results with rules](/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/promote-hits)
* [`promote`](/doc/rest-api/search/save-rule#body-consequence-promote)
