| 开发者 | jonhenshaw |
|---|---|
| 更新时间 | 2026年8月13日 20:54 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
LIKE '%term%' scan of the posts table. It cannot rank, it cannot tolerate a typo, and it gets slower as a site grows.
Coywolf Search replaces that with a proper search engine, built out of two small database tables of its own:
k1 and b exposed so you can tune term saturation and how much long posts are penalised.get_search_form().GET /wp-json/coywolf-search/v1/search?q=… returns the same ranked results as a search page, with a highlighted snippet for each, so you can build a custom search experience against the same engine./?s= and get_search_form() keep working, your search template renders the results, and pagination behaves normally — the plugin changes which posts come back, not how they look. If the index is empty, or anything at all goes wrong, WordPress runs its own search instead. Search never breaks the page.
Privacy and safety
/wp-content/plugins/coywolf-search/, or install it through Plugins → Add New.No. The plugin answers the query behind /?s=, so your theme's existing search form and search results template keep working unchanged.
The index tables are dropped and WordPress goes back to its own search immediately. Your settings are kept, so reactivating and rebuilding restores exactly what you had. Nothing you wrote is ever stored only in the index — it is entirely derived from your posts.
No. Only published, non-password-protected posts of the types you selected are indexed, and every search re-checks the post's current status before returning it. A post you unpublish disappears from results straight away, even if the background reindex hasn't run yet.
No. There are no outbound HTTP requests, no analytics, and no remotely-loaded files. Everything runs on your own server.
No. Saving a post only flags it; the reindex happens in a background job a minute later, so the editor never waits for it.
Normally no. The index builds itself when you activate the plugin, and rebuilds itself whenever you change a setting that affects what gets stored — which post types, taxonomies, or fields are indexed, the minimum token length, stopwords, or stemming. Ranking settings like weights, k1, b, fuzzy, and prefix matching apply immediately and need no rebuild at all.
The Rebuild index button on Settings → Search is there for the cases where you want to force it: a site with WP-Cron disabled, or content changed outside WordPress.
Nothing breaks. A rebuild clears the index and refills it, and while it is empty WordPress answers searches with its own built-in search — so visitors always get results, they just get better ones once the rebuild finishes. On a large site a rebuild runs in background batches over a few minutes.
It is built not to. Nothing loads on a page with no search box at all. On a page that has one, the only thing that loads up front is a small deferred script — the search library and the list of titles are fetched the first time somebody actually interacts with a search field, so visitors who never search never download them.
It attaches to any search form on the page, whether it came from the search block, get_search_form(), or hand-written markup, and it does it without altering your theme's markup. If your form is unusual enough that it is missed, the coywolf_search_should_enqueue filter lets you force it on.
The search form behaves exactly as it always did: it submits, and the server answers with the same ranked results. The suggestions are an enhancement on top, never a requirement.
Yes. GET /wp-json/coywolf-search/v1/search?q=your+search returns ranked results as JSON — title, permalink, date, post type, and a snippet with the matched words wrapped in <mark>. It accepts page and per_page, is read-only, and only ever returns content that is already public. It is rate-limited per visitor to keep it from being used to hammer your database.
Not in this version. The index stores which terms are in a document, not where they sit, so "exact phrase" is treated as the individual words. Quotation marks are ignored rather than silently returning wrong results.
Partly. Words are split on whitespace and punctuation, so languages that don't separate words that way — Chinese, Japanese, Thai — won't tokenize usefully. Stemming is English-only, and can be turned off.
Yes — both the automatic rebuilds and the background reindexing of edits rely on WP-Cron. With it disabled, use the Rebuild index button on Settings → Search. That screen also shows how many posts are waiting to be reindexed, so you can tell at a glance whether anything is falling behind.
coywolf-search/v1/search, returning ranked results with highlighted snippets.coywolf_search_reindex_delay.