| 开发者 | samuelsilvapt |
|---|---|
| 更新时间 | 2026年9月5日 06:26 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 |
| 版权网址: | 版权信息 |
Yes - three of them. wp-search.ai/demos runs the real plugin on a clothing store, a bookstore and an electronics store, each with its own catalogue. Type any query - your own words, an exact product name, or a SKU - and the page shows traditional search results and AI Search results side by side, each result labeled by tier. You can also drag the similarity threshold and watch the AI results change live. Nothing there is staged.
Edit any page, template or header in the block editor, click the + button and search for "AI Search". Pick AI Search Box for a search field with a dropdown, or AI Search Button for a search icon that opens a full-screen overlay - the button works well in a site header. There is nothing to configure to get started, though you can turn thumbnails, prices and the result count on or off in the block sidebar.
Barely. Every keystroke runs a keyword and SKU search, which uses no embeddings at all. Only when the shopper stops typing does the plugin make a single AI request. So a ten-character search costs one embedding, not ten - and repeated searches are served from a five-minute cache, costing nothing.
No. They are entirely optional. If you place no block, your storefront is untouched, no extra scripts load, and the plugin works exactly as it did before - improving the results page shoppers reach after pressing Enter.
Yes. They read your theme's own colour palette, typography and corner radius settings rather than shipping a fixed design, so they look native on light and dark themes alike. If you use a block theme, you can also adjust spacing and alignment from the block editor as usual.
No. Results your search already finds are kept and shown first: exact SKU/title matches, then every traditional keyword match (ranked by relevance instead of date). AI results are only added below them — extra products the keyword search missed. If a shopper searches for something that literally exists on your site, they will still find it, in the same or a better position.
On top of the per-post embedding, AI Search now generates one embedding per taxonomy term — every category, tag, and WooCommerce attribute term. At search time, each post's score gets an additive boost from its best-matching term. The practical effect: shoppers searching "trainers" surface products tagged "Sneakers" even when no product description contains the word "trainers". You can manage this on the new Term Embeddings tab (opt out of specific taxonomies, bulk-generate embeddings for existing terms) and tune the boost strength via the slider on Search Configuration. Cost note: each unique taxonomy term consumes one embedding from your quota. A typical WooCommerce store has 50–500 unique terms, so the one-time cost is small — and because terms are shared across all your products, you embed each one only once. If you have an unusually large taxonomy (e.g., thousands of free-text tags), you can disable that specific taxonomy on the new tab.
Yes. As of v1.25.0, AI Search exposes the following filters for developers:
* ai_search_embedding_content — Modify the text sent to the AI provider when generating embeddings. Useful for injecting taxonomy names, stripping boilerplate, or normalizing terminology.
* ai_search_should_generate_embedding — Return false to skip embedding generation for specific posts. Useful for excluding drafts in certain categories or low-content posts.
* ai_search_query_before_embedding — Rewrite the user's search query before it's embedded. Useful for synonym expansion, spell correction, or locale-specific normalization.
* ai_search_similarity_threshold — Override the similarity threshold per-query or per-post-type. Useful for stricter matching on products vs. looser on blog content.
* ai_search_results — Re-rank or filter the final search results. Useful for boosting in-stock products, hiding restricted content, or injecting pinned results.
* ai_search_term_embedding_content — (v1.26.0) Customize the text fed to the AI provider when embedding a taxonomy term. Useful for injecting parent-term names, synonym hints, or stripping boilerplate from term descriptions.
* ai_search_exact_matches — (v1.27.0) Add or remove post IDs pinned to the top of results as exact lexical matches (SKU / title) before AI ranking. Useful for EAN/GTIN, supplier references, or brand codes.
Plus the existing ai_search_searchable_post_types filter. Code examples are included in the inline PHPDoc above each filter in the plugin source.
Yes — WooCommerce is the primary use case. The plugin indexes product titles, short and long descriptions, SKUs, categories, tags, and product attributes. When you activate the plugin on a store with WooCommerce, the setup wizard automatically prioritizes products and pre-selects the most useful product fields.
Yes — and as of v1.27.0 an exact or prefix SKU match is always returned first, regardless of the AI similarity score. Random-looking codes like B08M5XDKFG carry no meaning for an embedding model, so before the semantic step the plugin checks the query against product SKUs (including variation SKUs, which resolve to their parent product) and against exact product titles. Matches are pinned to the top with a green "Exact Match" badge for editors. Partial SKUs work when the query is a single token of 4+ characters (WOO-HOOD finds WOO-HOODIE, WOO-HOODIE-LOGO, …). SKUs remain part of the embedding too, so mixed queries ("black shoes SKU-2024") still work.
Yes. Attributes like size, color, material, and any custom attributes you configure are indexed as part of the product's searchable content. Shoppers can search by attribute values ("large cotton") and the plugin will match products with those attributes.
The plugin indexes the parent product (including its attributes and description). Individual variation-level descriptions aren't separately indexed, but since attributes like size and color are included in the parent's embedding, searches for variation-specific terms still surface the right product.
Nothing if you use our free AI Search Service (up to 10,000 embeddings per site). If you want unlimited indexing, you can use your own OpenAI API key.
The plugin logs the error and falls back to WordPress default search automatically, so shoppers never hit a broken search page.
Embeddings are automatically generated when you publish a post, page, or custom post type. You can also regenerate them manually from the post editor or bulk generate them from the settings page.
No. Embeddings are generated in the background when content is published, not during searches. Search results are fast because they use pre-computed embeddings stored in your database.
The free AI Search Service provides 10,000 embeddings per site. For unlimited usage, you can use your own OpenAI API key.
Yes! AI Search works with any public custom post type. You can select which post types to make searchable in the setup wizard or settings page.
Yes! You can configure custom post meta fields to be included in the search index. This is perfect for ACF fields, custom taxonomies, and other metadata.
The similarity threshold (0.1-1.0, displayed as 10%-100%) determines how closely search results must match the query. Higher values (70%-80%) give more precise results; lower values (30%-50%) return broader matches. The default is 30%, which is a good starting point for most stores — adjust down if shoppers see too few results, adjust up if results feel loosely related.
AI Search has a smart 4-tier fallback system that ensures users always get results, falling back to WordPress default search if needed.
Go to AI Search > General Settings and switch between the free AI Search Service or your own OpenAI API key.
Yes. Search queries are processed through the embedding API but are not stored externally. All search results and embeddings are stored in your WordPress database.
uninstall.php: removing the plugin now cleans up its settings and the log table. Post and term embeddings are intentionally left in place so an accidental uninstall does not cost you your whole index.ai_search_term_match_threshold to tune (per taxonomy) how close a term must be to the query before it pulls in its products.WP_Query with its own s parameter (blocks, widgets, AJAX search handlers) was processed with the wrong - usually empty - terms: no exact-match pinning, no AI results, and a wasted embedding request for an empty string. The terms now come from the query being filtered.ai-search-lexical-match CSS class.ai_search_hybrid_enabled / ai_search_hybrid_balance options are simply ignored. One less thing to tune.ai-search-exact-match CSS class.ai_search_exact_matches lets you add (EAN, supplier reference) or remove pinned exact matches.AI_Search::generate_embedding() now returns true or a WP_Error.exclude_from_search are skipped when no post type is specified.post_type=any; the plugin used that literal string in its SQL, so only searches scoped to a post type (e.g. the WooCommerce product search form) got semantic results — the generic site search always fell back to WordPress default matching. any is now expanded to all searchable public post types.ai_search_term_embedding_content lets you customize the text fed to the AI provider when embedding a term (parallel to ai_search_embedding_content for posts).ai_search_embedding_content, ai_search_should_generate_embedding, ai_search_query_before_embedding, ai_search_similarity_threshold, and ai_search_results. See the new "Developer Hooks" FAQ for details.=== 0 comparison was bypassing the guard)components/ folder for reusable admin UI elementsadmin.php?page=ai-search for better WordPress integration/wp-json/ai-search/v1/settings exposing plugin configuration for debugging (no sensitive data)text-embedding-3-small (default, recommended) and text-embedding-3-large when using your own OpenAI API keytext-embedding-3-small instead of the older text-embedding-ada-002ai-search-similarity-{percentage} CSS classes to all search results for custom styling/clients/quota endpoint using Bearer token authenticationai-search-result class for AI-powered resultsai-search-similarity-{0-100} class with exact similarity percentageai-search-match class when result meets configured thresholdai-search-fallback class for non-AI fallback resultsai_search_searchable_post_types filter to customize which post types are searchable