[WordPress] 外掛分享: Gigaom Sphinx

首頁外掛目錄 › Gigaom Sphinx
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
全新外掛
安裝啟用
尚無評分
4153 天前
最後更新
問題解決
WordPress 3.7+ v0.1 上架:2014-11-03

內容簡介

Sphinx 是一個極速的內容索引。這個外掛程式可以讓你輕鬆地將 WordPress 的文章放入 Sphinx,然後使用 標準的 WP Query 查詢它們。透過這種方法,可以改善 WordPress 核心及插件中的查詢效能,而不需要實現新的 API 或重新撰寫查詢。

你可以在 search.gigaom.com 上看到它的使用。每個搜尋結果都是 WordPress 的一篇文章,Sphinx 會處理以找到符合的結果。側邊欄中的篩選器使用每篇文章所基於的分類法(Taxonomy)資料,由 Scriblio 提供支援。

加速哪些查詢

這個外掛程式可以加速大多數 WP 查詢,包括搜尋、標籤/分類、作者以及日期等。完整的支援查詢變數列表如下:

author
author_name
authors
category__and
category__in
category__not_in
exclude
feed
fields
ignore_sticky_posts
include
no_found_rows
numberposts
numberposts
offset
order
orderby
output
paged
post__in
post__not_in
post_parent
post_status
post_type
posts_per_page
s
suppress_filters
tag
tag__and
tag__in
tag__not_in
tag_id
tag_slug__and
tag_slug__in
tax_query
wijax

可到 程式碼 中查看這些內容。

不支援的內容

這個外掛程式唯一不支援的查詢類別是針對元數據(metadata)的查詢。這些查詢被忽略,WP Query 會像往常一樣處理它們。

go-sphinx 會自動偵測其他外掛是否在 WP Query 之外修改了 SQL,如果是,它就不會進行處理,這允許查詢像往常一樣對 MySQL 數據庫執行,但不享有 Sphinx 的效能優勢。

在 WordPress.org 的外掛程序庫中

最終版本將會放在此處: https://wordpress.org/plugins/go-sphinx/

Fork me!

這個外掛程式的 Github 連結為: https://github.com/gigaOM/go-sphinx

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Gigaom Sphinx」→ 直接安裝(推薦)

原文外掛簡介

Sphinx is a blazing fast index of content. This plugin makes it easy get WordPress posts into Sphinx, then query them using standard WP Query. This approach improves the performance of queries in core WordPress and even in plugins without having to implement a new API or rewrite the queries.
See it in use at search.gigaom.com. Each search result is a post in WordPress, Sphinx does the work to find the matching results. The filters in the sidebar are powered by Scriblio based on taxonomy data on each post.
What it accellerates
The plugin accellerates most WP Queries, including search, tag/taxonomy, author, and date, among others. The full list of supported query vars is:

author
author_name
authors
category__and
category__in
category__not_in
exclude
feed
fields
ignore_sticky_posts
include
no_found_rows
numberposts
numberposts
offset
order
orderby
output
paged
post__in
post__not_in
post_parent
post_status
post_type
posts_per_page
s
suppress_filters
tag
tag__and
tag__in
tag__not_in
tag_id
tag_slug__and
tag_slug__in
tax_query
wijax

See those in the code.
What it doesn’t
One of the only class of queries not supported are queries against metadata. Those are ignored by this plugin and WP Query handles those as usual.
go-sphinx automatically detects if other plugins have modified the SQL outside WP Query and steps out of the way if so. That allows the query to execute against the MySQL database as usual, but without the performance benefits of Sphinx.
In the WordPress.org plugin repo
Eventually: https://wordpress.org/plugins/go-sphinx/
Fork me!
This plugin is on Github: https://github.com/gigaOM/go-sphinx

延伸相關外掛

文章
Filter
Mastodon