Kunena - Smart Search Indexing
Problem
Joomla Smart Search does not successfully create a complete, unique index of Kunena forum messages.
The Kunena Finder plugin reports the expected total number of items during indexing, but the resulting Smart Search Content Map does not contain all Kunena forum posts.
Attempts to work around the issue by modifying Kunena's Finder pagination resulted in duplicate records rather than solving the underlying problem.
What Has Been Established
1. Joomla CLI Smart Search Works
The Joomla CLI indexer can be executed successfully from the server using:
/usr/local/php-8.4/bin/php '/data/sites/web/ged3ptb-hostingcom/sites/gplr.net/web/cli/joomla.php' finder:index
A complete CLI run reported:
Finder Indexer ========================== Starting Indexer Setting up Smart Search plugins Setup 12549 items in 0.094 seconds. * Processed batch 1 ... * Processed batch 42 Total Processing Time: 24.526 seconds. Peak memory usage: 29,360,128 bytes Exit code: 0
2. Batch Size Affects the Observed Behaviour
The Smart Search batch size was initially reduced in an attempt to avoid the indexing problem.
Increasing the batch size to 300 caused the indexer to successfully process 300 items, demonstrating that the CLI indexer could proceed beyond the previous apparent limit.
However, subsequent experiments showed that simply increasing the batch size does not solve the underlying issue.
3. Community Builder Integration Causes a Separate Failure
With Kunena – Community Builder Integration enabled, the CLI indexer produced:
PHP Warning: Attempt to read property "id" on null in /libraries/CBLib/CBLib/Cms/Joomla/Joomla3/CmsUser.php
Disabling the Community Builder integration removed this error.
4. Kunena Discuss Causes Another Separate Failure
After disabling Community Builder integration, the indexer exposed another specific error originating from:
Kunenadiscuss.php line 165
Disabling Content – Kunena Discuss allowed the Finder indexer to continue running.
Both of these appear to be separate plugin compatibility problems rather than the underlying Kunena Finder batching problem.
Kunena Finder Plugin Investigation
The installed Kunena Finder plugin is:
plugins/finder/kunena/src/Extension/Kunena.php
The relevant original implementation uses Joomla Finder's normal offset-based batching:
$offset = (int) $aState['offset']; $limit = (int) ($iState->batchSize - $iState->batchOffset); $items = $this->getItems($offset, $limit);
and:
$sql->select('id') ->from('#__kunena_messages') ->setLimit($limit, $offset);
The plugin's getContentCount() performs:
SELECT COUNT(*) FROM #__kunena_messages
Therefore there is no hard-coded 600-message limit in the Kunena Finder plugin.
Pagination Experiments
Offset Modification
Changing the pagination/state handling allowed additional batches to execute but resulted in duplicate Finder records.
The index reached more than 5,000 records, but inspection showed that records were being duplicated rather than representing 5,000 unique Kunena messages.
This modification was reverted.
ID Cursor Modification
A subsequent attempt changed the query to use:
WHERE id > $offset ORDER BY id ASC
and tracked the last processed message ID.
After clearing the index, this version stopped at exactly 300 items — the configured batch size.
This modification was also reverted.
Current State
The Kunena Finder plugin has been restored to its original state.
The following remain disabled:
- Kunena – Community Builder Integration
- Content – Kunena Discuss
The Joomla CLI Finder indexer itself works correctly and completes without a PHP error.
The unresolved problem is specifically:
Joomla 6.1.3 + Kunena 7.0.8 Smart Search/Finder does not produce a complete unique index of approximately 12,019 Kunena messages.
Upstream Investigation
Joomla issue #48111 documents a Smart Search batching problem in Joomla 6.1.x where indexing can stop after the first configured batch. The issue was reproduced with Joomla 6.1.2 and batch sizes including 50, 100 and 300.
Joomla's issue discussion subsequently identified Finder plugins as a likely source of such failures.
Joomla's documentation also recommends using the CLI indexer for large sites and confirms that the configured batch size controls how many content items are processed per batch.
Kunena 7.0.8 is the installed stable version. No confirmed upstream Kunena release fixing this specific Kunena Finder indexing problem has currently been identified.
Kunena's source repository:
https://github.com/Kunena/Kunena-Forum
Useful Reproduction Environment
Joomla 6.1.3 Kunena 7.0.8 PHP 8.4 ~12,019 Kunena messages Smart Search – Kunena Forum enabled Community Builder integration disabled Kunena Discuss disabled CLI Finder indexer Batch size: 300
Current Conclusion
The problem should be treated as an upstream Joomla/Kunena Smart Search/Finder compatibility or state-management bug, rather than a server configuration problem.
The server-side CLI workaround is functional, but it does not resolve the incorrect/incomplete Kunena Finder indexing.