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

# Search

> Search results page with product grid, filtering, sorting, and multi-type results

The Main Search template displays search results at `/search`, showing products, articles, and pages matching the search query with filtering, sorting, and pagination options. Optimized search experience with filters and sorting helps customers quickly find what they're looking for, reducing friction in the product discovery process. Use this template to create a powerful search experience that handles diverse result types and helps convert search intent into purchases.

***

## Template Settings

<Tabs>
  <Tab title="Search">
    <AccordionGroup>
      <Accordion title="Enable Filters" icon="filter">
        Display filter options for search results.

        * **Type:** Checkbox
        * **Default:** Enabled

        **When Enabled:**

        * Product filters appear (price, type, vendor, etc.)
        * Customers can narrow results
        * Filter UI matches collection filtering
        * Works only for product results

        **When Disabled:**

        * No filtering available
        * Simpler, streamlined search
        * Faster implementation

        <Note>
          Filters only apply to product results. Articles and pages don't have filterable attributes and won't show filters.
        </Note>
      </Accordion>

      <Accordion title="Enable Sorting" icon="arrow-down-short-wide">
        Display sorting dropdown for search results.

        * **Type:** Checkbox
        * **Default:** Enabled

        **Sorting Options:**

        * Relevance (default) - Best match first
        * Best Selling
        * Alphabetically: A-Z
        * Alphabetically: Z-A
        * Price: Low to High
        * Price: High to Low
        * Date: New to Old
        * Date: Old to New

        <Tip>
          "Relevance" sorting uses Shopify's search algorithm to show best matches first. This is typically the most useful default for search.
        </Tip>
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Product Grid">
    <AccordionGroup>
      <Accordion title="Products Per Page" icon="grid-2">
        Control how many products display before pagination.

        * **Range:** 8-28 products
        * **Step:** 4 (8, 12, 16, 20, 24, 28)
        * **Default:** 16

        **Recommendations:**

        * **8-12:** Small result sets, faster loading
        * **16:** Balanced (default, good for most stores)
        * **20-28:** Large catalogs, reduce pagination

        <Note>
          This only affects product results. Articles and pages display separately and don't count toward this limit.
        </Note>
      </Accordion>

      <Accordion title="Pagination Style" icon="ellipsis">
        Choose pagination behavior:

        * **Default** (default) - Traditional page numbers (1, 2, 3...)
        * **Load More** - Progressive loading with button

        <Tip>
          "Load More" provides seamless browsing. Traditional pagination is better for SEO and allows jumping to specific result pages.
        </Tip>
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Cards">
    <AccordionGroup>
      <Accordion title="Color Scheme for Article Cards" icon="newspaper">
        Independent color scheme for article/blog result cards.

        * Select from available theme color schemes
        * **Default:** scheme-1
        * Affects article card backgrounds and text

        <Tip>
          Use different scheme for articles vs products to visually separate content types in mixed results.
        </Tip>
      </Accordion>

      <Accordion title="Color Scheme for Page Cards" icon="file">
        Independent color scheme for page result cards.

        * Select from available theme color schemes
        * **Default:** scheme-1
        * Affects page card backgrounds and text
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Layout">
    <AccordionGroup>
      <Accordion title="Section Width" icon="left-right">
        * **Page** (default) - Contained within page margins
        * **Fluid** - Extends to container edges
      </Accordion>

      <Accordion title="Color Scheme" icon="palette">
        Main section background color.

        * Select from available theme color schemes
        * **Default:** scheme-1
        * Separate from card-specific schemes
      </Accordion>

      <Accordion title="Spacing" icon="arrows-up-down">
        * **Top Spacing**: 0 (default), 1, 2, 4, or 6
        * **Bottom Spacing**: 0, 1, 2 (default), 4, or 6

        <Note>
          Top spacing is 0 by default assuming search banner section appears above.
        </Note>
      </Accordion>

      <Accordion title="Borders" icon="border-top-left">
        * **None** (default)
        * **Top Border**
        * **Bottom Border**
        * **Both Borders**
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>

***

## Search Result Types

Shopify search returns multiple content types:

<AccordionGroup>
  <Accordion title="Products" icon="tag">
    **Searchable Fields:**

    * Product title
    * Product description
    * Product type
    * Vendor
    * Tags
    * SKU
    * Barcode
    * Variant titles

    **Display:**

    * Product grid (standard product cards)
    * Filtering and sorting available
    * Add to cart functionality
    * Quick view (theme-dependent)
  </Accordion>

  <Accordion title="Articles (Blog Posts)" icon="newspaper">
    **Searchable Fields:**

    * Article title
    * Author name
    * Article content/body
    * Article excerpt
    * Tags

    **Display:**

    * Article cards with image, title, excerpt
    * Date published
    * Author (theme-dependent)
    * Read more link to full article
    * Uses article card color scheme

    <Tip>
      If you publish helpful blog content (guides, FAQs), they'll appear in search, providing value beyond just product listings.
    </Tip>
  </Accordion>

  <Accordion title="Pages" icon="file">
    **Searchable Fields:**

    * Page title
    * Page content/body

    **Display:**

    * Page cards with title and excerpt
    * Link to full page
    * Uses page card color scheme

    **Common Pages in Results:**

    * About Us
    * FAQ
    * Shipping & Returns
    * Size Guide
    * Contact
  </Accordion>
</AccordionGroup>

***

## Search Behavior

<AccordionGroup>
  <Accordion title="Search Algorithm" icon="brain">
    **Shopify Search Ranking:**

    Shopify ranks results by relevance based on:

    1. Exact title matches (highest priority)
    2. Title partial matches
    3. Product type matches
    4. Tag matches
    5. Description matches
    6. Variant title matches
    7. SKU/barcode matches

    **Weighting:**

    * Published products rank higher than drafts
    * Available products rank higher than sold out
    * Featured products may rank higher
  </Accordion>

  <Accordion title="Search Syntax" icon="code">
    **Special Search Operators:**

    **Exact Phrase:**

    * Use quotes: `"blue sneakers"`
    * Matches exact phrase only

    **Multiple Words (AND):**

    * Default: `blue shoes`
    * Finds results with both words

    **Partial Words:**

    * Auto-suggests: `sne` finds "sneakers"
    * Minimum 3 characters for suggestions

    **Product Type:**

    * Search by type: `product_type:shoes`
    * Filters to specific product type
  </Accordion>

  <Accordion title="Empty Search" icon="magnifying-glass-minus">
    **When Search Query is Empty:**

    * Some themes show all products
    * Others show "Enter search term" message
    * May display popular products
    * Or redirect to homepage

    <Note>
      Empty search behavior depends on theme implementation. Most Sahara variations show helpful message.
    </Note>
  </Accordion>

  <Accordion title="No Results Found" icon="zero">
    **When No Matches:**

    * "No results for \[query]" message displays
    * Suggestions for alternative searches
    * Featured products or collections (theme-dependent)
    * Link to all products
    * Search tips or popular categories

    **Best Practices:**

    * Suggest related products
    * Offer to browse all products
    * Link to popular collections
    * Provide search tips
    * Check for typos ("Did you mean...?")
  </Accordion>
</AccordionGroup>

***

## Best practices

<CardGroup cols={2}>
  <Card title="Improve search accuracy" icon="bullseye">
    Optimize product data with descriptive titles, common search terms in descriptions, relevant tags (color, material, style), accurate product type, variant titles, synonyms, and proper SKU naming. Example: Use "Men's Blue Canvas Low-Top Sneakers" instead of "Classic Sneaker".
  </Card>

  <Card title="Filtering strategy" icon="sliders">
    Enable filters for large catalogs (50+ products), multiple product categories, price range variety, and different product types. Disable filters for small catalogs (\< 30 products), homogeneous products, simple search needs, or mobile-first audience. Filters configured in Shopify Admin Search & Discovery apply to search results.
  </Card>

  <Card title="Mixed result types" icon="layer-group">
    Handle products + articles + pages with visual differentiation using different color schemes (scheme-1 for products, scheme-2 for articles, scheme-3 for pages). Group by type or interleave based on relevance, show type labels, use different card styles. Color-coding helps users quickly scan.
  </Card>

  <Card title="Search performance" icon="gauge-high">
    Lower products\_per\_page (12-16) for faster initial load, enable "Load More" pagination, optimize product images, limit active filters (3-5 max), use Shopify's built-in search. For large catalogs (1000+ products), consider search apps with autocomplete, typo correction, and search history.
  </Card>

  <Card title="Mobile search UX" icon="mobile">
    Use filters in drawer (not sidebar) on mobile, large tappable filter/sort buttons, reduced products per page (12), prominent quick filters (price, availability), easy search refinement access, and back to top button for long results. Mobile searchers have specific intent.
  </Card>
</CardGroup>

***

## Use Cases

<CardGroup cols={2}>
  <Card title="Product-Focused Store" icon="shopping-bag">
    Filters enabled, sorting by relevance, products prominently displayed
  </Card>

  <Card title="Content-Rich Store" icon="book">
    Mixed results (products + helpful articles), different card colors, articles featured
  </Card>

  <Card title="Simple Catalog" icon="list">
    No filters, default sorting, minimal options, 12 products per page
  </Card>

  <Card title="Large Inventory" icon="warehouse">
    Full filtering, 24 products per page, load more pagination, sidebar filters
  </Card>
</CardGroup>

***

## Related Templates

<CardGroup cols={2}>
  <Card title="Main Search Banner" icon="rectangle">
    Search results page header banner
  </Card>

  <Card title="Predictive Search" icon="wand-magic-sparkles">
    Live search suggestions in header search bar
  </Card>

  <Card title="Collection Page" icon="grid-2">
    Similar product grid for collection pages
  </Card>

  <Card title="Search Settings" icon="gear">
    Shopify search configuration in admin
  </Card>
</CardGroup>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="No Results for Expected Terms" icon="magnifying-glass-minus">
    **Check:**

    * Products are published (not draft)
    * Search terms appear in title/description/tags
    * Products not excluded from search
    * No typos in product data
    * Adequate product information filled in

    **Test:**

    * Search by exact product title (should appear)
    * Search by product type (should filter properly)
    * Check in Shopify Admin if product is searchable
  </Accordion>

  <Accordion title="Filters Not Showing" icon="filter-circle-xmark">
    **Verify:**

    * "Enable Filters" checkbox is on
    * Filters configured in **Admin → Search & Discovery**
    * Search results include products (filters don't apply to articles/pages)
    * Theme filter settings enabled
  </Accordion>

  <Accordion title="Wrong Result Order" icon="shuffle">
    **Reasons:**

    * Sorting set to something other than "Relevance"
    * Customer changed sort order (dropdown)
    * Product availability affecting order (sold out lower)

    **Fix:**

    * Reset to "Relevance" sorting
    * Verify published/available status
    * Check featured product settings
  </Accordion>

  <Accordion title="Mixed Result Types Confusing" icon="layer-group">
    **Solutions:**

    * Use different color schemes for products vs articles vs pages
    * Add "Type" label to cards ("Product", "Article")
    * Organize results by type (group all products together)
    * Consider hiding articles/pages from search (theme-dependent)
  </Accordion>

  <Accordion title="Search Too Slow" icon="hourglass">
    **Optimize:**

    * Reduce products per page (16 or less)
    * Use "Load More" pagination
    * Compress product images
    * Limit filter complexity
    * Consider search app for very large catalogs (1000+ products)
    * Enable lazy loading for images
  </Accordion>
</AccordionGroup>

***

## Quick Summary

* **Purpose:** Display search results with products, articles, and pages
* **URL:** `/search?q=[query]`
* **Features:** Filtering, sorting, pagination, multi-type results
* **Products Per Page:** 8-28 (step of 4, default: 16)
* **Pagination:** Traditional or Load More
* **Card Schemes:** Separate color schemes for products, articles, pages
* **Filters:** Product filters only (not for articles/pages)
* **Sorting:** Relevance, best selling, price, alphabetical, date

<Note>
  Search results are automatically generated by Shopify's search engine. Improve search accuracy by optimizing product titles, descriptions, tags, and types in **Shopify Admin → Products**.
</Note>
