PHPackages                             mediawiki/couchdb-query - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mediawiki/couchdb-query

ActiveMediawiki-extension[Utility &amp; Helpers](/categories/utility)

mediawiki/couchdb-query
=======================

MediaWiki extension for performing CouchDB queries (map/reduce views, CouchDB-Lucene and CouchDB Nouveau full-text search) from within wiki pages.

029PHP

Since Jun 18Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/toniher/CouchDB_Query)[ Packagist](https://packagist.org/packages/mediawiki/couchdb-query)[ RSS](/packages/mediawiki-couchdb-query/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Extension for performing CouchDB queries within a MediaWiki instance.

Requirements
------------

[](#requirements)

- MediaWiki 1.35 or later
- CouchDB instance (optionally with CouchDB-Lucene or CouchDB Nouveau for full-text search)

Installation
------------

[](#installation)

1. Clone or download this extension into your MediaWiki `extensions/` directory:

    ```
    git clone  extensions/CouchDB_Query

    ```
2. Add the following to the **bottom** of your `LocalSettings.php`:

    ```
    wfLoadExtension( 'CouchDB_Query' );
    ```
3. Configure the CouchDB connection in `LocalSettings.php` after the `wfLoadExtension` line:

    ```
    $wgCouchDB_Query['params']['db']['host']     = 'localhost';
    $wgCouchDB_Query['params']['db']['port']     = 5984;
    $wgCouchDB_Query['params']['db']['protocol'] = 'http';
    $wgCouchDB_Query['params']['db']['username'] = 'myuser';
    $wgCouchDB_Query['params']['db']['password'] = 'mypassword';
    $wgCouchDB_Query['params']['db']['db']       = 'mydb';
    ```
4. Define the CouchDB view/Lucene query paths your wiki will use:

    ```
    $wgCouchDB_Query['queries']['mydb']['myview'] = '/mydb/_design/mydesign/_view/myview';
    ```

Usage
-----

[](#usage)

Once installed, two parser functions are available in wiki pages:

### `{{#CouchDB_Query_table:}}`

[](#couchdb_query_table)

Renders a dynamic table populated from a CouchDB view.

```
{{#CouchDB_Query_table: index=myview | db=mydb | limit=25 | fields=title,date }}

```

ParameterDescription`index`CouchDB view/index name`db`CouchDB database identifier`limit`Maximum rows to return (default: 25)`fields`Comma-separated list of fields to display`query`Query string filter`type`Query type (`index` or `text` for Lucene)`header`Column header label (default: `Page name`)`class`CSS class for the table (default: `wikitable sortable jquery-tablesorter`)`prefix`Page name prefix filter`full`Set to `1` to include full document data### `{{#CouchDB_Query_field:}}`

[](#couchdb_query_field)

Renders an input field wired to a CouchDB query table.

```
{{#CouchDB_Query_field: tag=input | type=text | query=myview | id=myfield }}

```

ParameterDescription`tag`HTML tag to render (`input`, `select`, etc.)`type`Input type attribute`query`Query name this field targets`values`Predefined values (for select fields)`id`Element ID`class`CSS class`default`Default valueAPI Modules
-----------

[](#api-modules)

The extension exposes three API modules:

ModuleActionDescription`couchdb-query``api.php?action=couchdb-query`Query a CouchDB view/index`couchdb-lucene-query``api.php?action=couchdb-lucene-query`Full-text search via CouchDB-Lucene`couchdb-nouveau-query``api.php?action=couchdb-nouveau-query`Full-text search via CouchDB Nouveau (3.4+)`couchdb-document``api.php?action=couchdb-document`Retrieve a single CouchDB document### Upgrading: CouchDB Nouveau support

[](#upgrading-couchdb-nouveau-support)

CouchDB Nouveau (the replacement for CouchDB-Lucene shipped from CouchDB 3.4 onwards) is now supported alongside the existing Lucene endpoint. No config-schema changes are needed; point `queries[$db][$index]` at the Nouveau path instead of the Lucene `_fti` path:

```
// Lucene (legacy)
$wgCouchDB_Query['queries']['mydb']['text'] = '/_fti/local/mydb/_design/luceneindex/by_text';

// Nouveau (CouchDB 3.4+)
$wgCouchDB_Query['queries']['mydb']['text'] = '/mydb/_design/mydesign/_nouveau/by_text';
```

Then hit `action=couchdb-nouveau-query` instead of `action=couchdb-lucene-query`. The response shape (`status`, `count`, `results[*].{id,score,pagename,fields}`) is normalised to match the Lucene module, so consumers do not need to change.

Notes:

- Nouveau does not support `skip`; pagination is bookmark-based. The current JS Next/Prev controls still use offset arithmetic and have not yet been adapted for Nouveau bookmarks.
- Supported request params: `q`, `limit`, `sort`, `include_docs`, `full`.

### TODO

[](#todo)

- Refactor common functions
- Simplify parameters
- Document how this works
- Migrate Javascript function to use PouchDB

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance61

Regular maintenance activity

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5218ca0754245ef120fb4ebc1c520616cb8339e5e4f81301e4906893859d5404?d=identicon)[toniher](/maintainers/toniher)

---

Top Contributors

[![toniher](https://avatars.githubusercontent.com/u/535539?v=4)](https://github.com/toniher "toniher (182 commits)")

### Embed Badge

![Health badge](/badges/mediawiki-couchdb-query/health.svg)

```
[![Health](https://phpackages.com/badges/mediawiki-couchdb-query/health.svg)](https://phpackages.com/packages/mediawiki-couchdb-query)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3376.6k](/packages/starcitizentools-citizen-skin)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

19251.4k3](/packages/civicrm-civicrm-drupal-8)[altis/core

Core module for Altis

19228.0k4](/packages/altis-core)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5721.7k4](/packages/pfefferle-wordpress-activitypub)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
