sphinx
pg-sphinx · C connector for querying and updating an external SphinxSearch server from PostgreSQL.
Overview
Usage
Sources:
sphinx 0.3 connects PostgreSQL functions to a Sphinx Search server. It supports search, document replacement and deletion, and snippet generation through Sphinx’s SQL interface; the repository is archived, so use it only for maintaining a compatible legacy deployment.
Core Workflow
Create the extension as a superuser, then set connection values in the extension-owned configuration table.
The optional prefix is prepended to index names, so the example addresses the Sphinx index named test_blog_posts.
Main Objects
sphinx_select(...)returns(id, weight)rows for a search.sphinx_replace(index, id, data)replaces a document; the data array alternates keys and values.sphinx_delete(index, id)removes a document.sphinx_snippet(...)andsphinx_snippet_options(...)generate highlighted excerpts.sphinx_configstoreshost,port,username,password, andprefixvalues and is included in extension dumps.
Version 0.3 grants all privileges on sphinx_config to public during installation. Revoke that grant and delegate only the minimum required access, especially if the table contains credentials. Calls depend synchronously on the external Sphinx service, and document updates are external side effects that do not participate in PostgreSQL transaction rollback.