Linux 软件免费装

Coywolf Search

开发者 jonhenshaw
更新时间 2026年8月13日 20:54
PHP版本: 8.0 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

search autocomplete typeahead relevance bm25

下载

1.4.3 1.4.2 1.4.4

详情介绍:

WordPress searches posts with a 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: It replaces search without replacing your theme. /?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

安装:

  1. Upload the plugin to /wp-content/plugins/coywolf-search/, or install it through Plugins → Add New.
  2. Activate it.
That's it. The index starts building in the background as soon as the plugin is active, and search switches over to it as soon as the first build finishes. Visit Settings → Search to choose what gets indexed and tune ranking — changes that affect what is stored queue their own rebuild.

屏幕截图:

  • The Search settings screen. Tune field weights, BM25 parameters, fuzzy and prefix matching, tokenization (minimum token length, stopwords, stemming), and typeahead behavior.

常见问题:

Do I have to change my theme?

No. The plugin answers the query behind /?s=, so your theme's existing search form and search results template keep working unchanged.

What happens when I deactivate it?

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.

Are drafts or private posts ever exposed?

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.

Does it call out to any external service?

No. There are no outbound HTTP requests, no analytics, and no remotely-loaded files. Everything runs on your own server.

Does it slow down publishing?

No. Saving a post only flags it; the reindex happens in a background job a minute later, so the editor never waits for it.

Do I ever have to rebuild the index by hand?

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.

What happens to search while the index is rebuilding?

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.

Does the typeahead slow my pages down?

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.

Does the typeahead work with my theme's search form?

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.

What if a visitor has JavaScript turned off?

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.

Is there an API I can query?

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.

Does it support phrase searches in quotes?

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.

Does it work with languages that don't use spaces?

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.

My host has WP-Cron disabled. Will the index go stale?

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.

更新日志:

1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.0 1.2.1 1.2.0 1.1.0 1.0.0