Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

search-autocomplete搜索自动完成

Agent Skill

search-autocomplete 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

461

周安装

19

GitHub Stars

19

下载量

150
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:search-autocomplete(搜索自动完成)
来源仓库:https://github.com/finsilabs/awesome-ecommerce-skills
仓库路径:skills/search-autocomplete
安装命令:
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill search-autocomplete
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill search-autocomplete

简介

search-autocomplete 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词快速定位候选结果时使用。

  • 它可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网或文件读写。
  • 适用于电商搜索优化与自动补全功能研究。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装。

SKILL.md

Search Autocomplete

Overview

Implement a typeahead search experience that surfaces product suggestions, categories, and content as shoppers type. Combines client-side debouncing with server-side fuzzy matching, applies merchandising rules (boosts, pins, synonyms), and renders a structured dropdown that drives measurable conversion lift.

When to Use This Skill

  • When shoppers are failing to find products through browse navigation alone
  • When site search click-through rates are below 30% of searches
  • When adding a search-as-you-type experience to an existing search endpoint
  • When integrating a third-party search service (Algolia, Elasticsearch, Typesense)
  • When implementing merchandising rules to boost promoted products in results
  • When supporting multi-language storefronts requiring synonym and phonetic matching

Core Instructions

Step 1: Determine the merchant's platform and choose the right approach

PlatformRecommended ApproachWhy
ShopifyInstall Search & Discovery app (free, by Shopify) for synonym/boost configuration + Searchie or Boost Commerce app for full autocomplete dropdownSearch & Discovery improves the built-in Shopify search with synonyms and product boosts; Boost Commerce ($19/mo) adds a fully styled autocomplete dropdown with category results and merchandising rules
WooCommerceInstall FiboSearch – AJAX Search for WooCommerce (free/paid) or SearchWP + SearchWP Live Search extensionFiboSearch adds an instant AJAX autocomplete dropdown to the WooCommerce search bar with product images, prices, and category results — no custom code needed
BigCommerceEnable Search Suggestions in Storefront → Search settings + install Klevu Smart Search or Searchspring for advanced autocompleteBigCommerce's native search has basic autocomplete; Klevu ($449+/mo) and Searchspring add AI-powered autocomplete, synonym management, and merchandising rules
Custom / HeadlessBuild with Algolia InstantSearch.js (recommended) or self-hosted Typesense; implement debounced input, AbortController for race conditions, and ARIA combobox patternAlgolia offers the best developer experience with a generous free tier (10K searches/month); Typesense is the self-hosted alternative

Step 2: Configure search autocomplete on your platform


Shopify

Search & Discovery app (required baseline — free):

  1. Install Search & Discovery from the Shopify App Store
  2. Go to Apps → Search & Discovery → Synonyms and add business synonyms:

- Bidirectional: "sneakers" ↔ "trainers" ↔ "shoes" - One-way: "tv" → "television", "flat screen"

  1. Under Boosts, pin high-priority products or collections to appear first for specific queries
  2. Under Filter settings, configure which attributes appear as filters alongside search results
  3. The app improves Shopify's native predictive search API used by all OS2.0 theme search bars

Boost Commerce app (full autocomplete dropdown):

  1. Install Boost Commerce – Product Filter & Search from the Shopify App Store
  2. In the app dashboard, configure the Instant Search popup:

- Enable product image + price in suggestions - Add category/collection suggestions - Configure the number of product results (recommend 5–8)

  1. Set up Merchandising rules in the app: boost new arrivals, pin best sellers, exclude out-of-stock from suggestions
  2. Customize the popup's appearance to match your theme colors in the Design settings

WooCommerce

FiboSearch (recommended — free tier available):

  1. Install FiboSearch – AJAX Search for WooCommerce from WordPress.org
  2. Go to FiboSearch → Settings → General
  3. Configure what appears in suggestions:

- Products: name, SKU, tags (enable all for best results) - Categories: enable to show category suggestions - Pages/Posts: enable if you have blog content

  1. Set Fuzzy Search to On — this handles typos like "adids" → "Adidas"
  2. Under Appearance, configure the dropdown layout: product image + name + price vs. compact text-only
  3. FiboSearch replaces the default WooCommerce search widget — it works with the standard search input, Elementor search widgets, and most theme search bars

SearchWP + Live Search extension:

  1. Install SearchWP (paid, from $99/yr) for advanced indexing control
  2. Install the SearchWP Live Search extension for real-time autocomplete
  3. In the SearchWP admin, configure which product fields are indexed with what weight (name > SKU > description)
  4. Enable custom fields and product attributes in the index for spec-based searching

BigCommerce

  1. Go to Storefront → Search in your BigCommerce control panel
  2. Under Search Suggestions, enable Products, Categories, and Brands as suggestion types
  3. Set the number of suggestions to show (5–8 for products)
  4. Configure Search as you type to start after 2 characters

Klevu Smart Search (advanced autocomplete):

  1. Install from the BigCommerce App Marketplace
  2. In the Klevu dashboard, configure synonym groups and boosting rules
  3. Klevu's autocomplete dropdown automatically shows product images, prices, categories, and trending searches
  4. Add custom banners to the search dropdown for specific queries (e.g., show a "Summer Sale" banner when someone searches "dress")

Custom / Headless

Debounced input hook with AbortController (prevents race conditions):

// useSearchAutocomplete.js
import { useState, useEffect, useRef, useCallback } from 'react';

function debounce(fn, delay) {
  let timer;
  return (...args) => { clearTimeout(timer); timer = setTimeout(() => fn(...args), delay); };
}

export function useSearchAutocomplete(minChars = 2) {
  const [query, setQuery] = useState('');
  const [results, setResults] = useState({ products: [], categories: [], suggestions: [] });
  const [loading, setLoading] = useState(false);
  const abortRef = useRef(null);

  const fetchSuggestions = useCallback(
    debounce(async (q) => {
      if (q.length < minChars) { setResults({ products: [], categories: [], suggestions: [] }); return; }
      if (abortRef.current) abortRef.current.abort();
      abortRef.current = new AbortController();
      setLoading(true);
      try {
        const res = await fetch(`/api/search/autocomplete?q=${encodeURIComponent(q)}&limit=5`,
          { signal: abortRef.current.signal });
        setResults(await res.json());
      } catch (err) { if (err.name !== 'AbortError') console.error(err); }
      finally { setLoading(false); }
    }, 250),
    [minChars]
  );

  useEffect(() => { fetchSuggestions(query); }, [query, fetchSuggestions]);
  return { query, setQuery, results, loading };
}

Accessible combobox dropdown (ARIA combobox + listbox pattern):

// SearchAutocomplete.jsx
import DOMPurify from 'dompurify'; // sanitize server-provided highlight HTML

export function SearchAutocomplete() {
  const { query, setQuery, results, loading } = useSearchAutocomplete();
  const [activeIndex, setActiveIndex] = useState(-1);
  const inputRef = useRef(null);
  const allItems = [...results.categories, ...results.products];
  const isOpen = query.length >= 2 && allItems.length > 0;

  function handleKeyDown(e) {
    if (e.key === 'ArrowDown') { e.preventDefault(); setActiveIndex(i => Math.min(i + 1, allItems.length - 1)); }
    if (e.key === 'ArrowUp') { e.preventDefault(); setActiveIndex(i => Math.max(i - 1, -1)); }
    if (e.key === 'Enter' && activeIndex >= 0) window.location.href = allItems[activeIndex].url;
    if (e.key === 'Escape') { inputRef.current.blur(); setActiveIndex(-1); }
  }

  return (
    <div role="combobox" aria-expanded={isOpen} aria-haspopup="listbox" aria-owns="autocomplete-list">
      <input ref={inputRef} type="search" value={query}
        onChange={e => { setQuery(e.target.value); setActiveIndex(-1); }}
        onKeyDown={handleKeyDown}
        aria-autocomplete="list" aria-controls="autocomplete-list"
        aria-activedescendant={activeIndex >= 0 ? `item-${activeIndex}` : undefined}
        placeholder="Search products..." />
      {loading && <span aria-live="polite" className="sr-only">Loading suggestions</span>}
      {isOpen && (
        <ul id="autocomplete-list" role="listbox" className="autocomplete-dropdown">
          {results.categories.map((cat, i) => (
            <li key={cat.url} id={`item-${i}`} role="option" aria-selected={activeIndex === i}>
              <a href={cat.url}>Category: {cat.name} ({cat.product_count})</a>
            </li>
          ))}
          {results.products.map((product, i) => {
            const idx = i + results.categories.length;
            const highlighted = DOMPurify.sanitize(product._highlightResult?.name?.value ?? product.name);
            return (
              <li key={product.objectID} id={`item-${idx}`} role="option" aria-selected={activeIndex === idx}>
                <a href={product.url} className="product-suggestion">
                  <img src={product.image} alt="" width="40" height="40" />
                  <span dangerouslySetInnerHTML={{ __html: highlighted }} />
                  <span>${product.price}</span>
                </a>
              </li>
            );
          })}
          <li><a href={`/search?q=${encodeURIComponent(query)}`}>View all results for "{query}"</a></li>
        </ul>
      )}
    </div>
  );
}

Algolia index configuration (typo tolerance + synonyms + merchandising):

await searchClient.setSettings({
  indexName: 'products',
  indexSettings: {
    searchableAttributes: ['name', 'brand', 'category', 'description'],
    customRanking: ['desc(popularity_score)', 'desc(conversion_rate)'],
    typoTolerance: 'min',
    minWordSizefor1Typo: 5,
    synonyms: [
      { objectID: 'shoes', type: 'synonym', synonyms: ['shoes', 'sneakers', 'footwear', 'trainers'] },
    ],
    optionalFilters: ['is_featured:true<score=2>', 'in_stock:true<score=1>'],
  },
});

Best Practices

  • Debounce at 200–300 ms — balances responsiveness and server load; do not go below 150 ms
  • Cancel in-flight requests — use AbortController to avoid race conditions when the user types quickly
  • Highlight matched terms — wrap matched substrings in <mark> so shoppers see why a result appeared; sanitize server-supplied HTML before rendering
  • Show a "View all results" link — always provide an escape hatch to the full search results page
  • Cache frequent queries — most stores have a small set of high-frequency queries; an LRU cache cuts backend load significantly
  • Track no-results queries — log queries returning zero results; these are direct signals for synonym gaps or catalog holes
  • Set minChars to 2 — single-character queries produce noise and return no conversion value

Common Pitfalls

ProblemSolution
Stale results when user types fastUse AbortController to cancel the previous request before issuing a new one
Dropdown appears behind sticky headerSet z-index explicitly on the dropdown; use a portal if inside an overflow:hidden ancestor
Keyboard navigation focus lost on re-renderTrack activeIndex in component state, not DOM focus; re-apply aria-activedescendant on each render
Fuzzy matching returns irrelevant resultsConfigure minWordSizefor1Typo: 5 in Algolia or prefix_length: 2 in Elasticsearch to require a solid stem before fuzzy kicks in
Merchandising rules not applyingRules trigger when the query matches the condition pattern — use anchoring: 'contains' not is for partial matches

Related Skills

  • @faceted-navigation
  • @product-page-design
  • @accessibility-commerce
  • @storefront-theming

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.43%
按下载量换算55

Claude

31.81%
按下载量换算48

Cursor

17.52%
按下载量换算26

Gemini CLI

10.38%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills