Word Count Search

Word Count Search 2.11.0

No permission to download


Well-known member
Xon submitted a new resource:

https://github.com/Xon/XenForo2-WordCountSearch - Word-count range searches

Adds the ability to-do word-count range searches, sort by word count in search.
Forum listings can be sorted and filter by word-count.

Note; supports MySQL or ElasticSearch (1.x -5.x)

Works with the following Content Types:
  • Posts.
Post-Install Instructions

Rebuild search index for posts. Rebuild search index for threads if threadmarks are installed


I recommend using...

Read more about this resource...
Hi @Xon after installing, trying to rebuild cache I receive this error

InvalidArgumentException: Attempted to convert NULL to integer [word_count] in src/XF/Mvc/Entity/Entity.php at line 685
[*]XF\Mvc\Entity\Entity->_castValueToType() insrc/XF/Mvc/Entity/Entity.php at line 572
[*]XF\Mvc\Entity\Entity->set() in src/XF/Mvc/Entity/Entity.php at line 502
[*]XF\Mvc\Entity\Entity->__set() insrc/addons/SV/WordCountSearch/XF/Search/Data/Thread.php at line 37
[*]SV\WordCountSearch\XF\Search\Data\Thread->getMetaData() insrc/XF/Search/Data/Thread.php at line 43
[*]XF\Search\Data\Thread->getIndexData() in src/XF/Search/Data/Post.phpat line 40
[*]XF\Search\Data\Post->getIndexData() in src/XF/Search/Search.php at line 37
[*]XF\Search\Search->index() in src/XF/Search/Search.php at line 59
[*]XF\Search\Search->indexEntities() in src/XF/Search/Search.php at line 85
[*]XF\Search\Search->indexRange() in src/XF/Job/SearchRebuild.php at line57
[*]XF\Job\SearchRebuild->run() in src/XF/Job/Manager.php at line 241
[*]XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line187
[*]XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 103
[*]XF\Job\Manager->runByIds() in src/XF/Admin/Controller/Tools.php at line 120
[*]XF\Admin\Controller\Tools->actionRunJob() insrc/XF/Mvc/Dispatcher.php at line 249
[*]XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line88
[*]XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line41
[*]XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1863
[*]XF\App->run() in src/XF.php at line 328
[*]XF::runApp() in admin.php at line 13

I'm using ES RC3 with Elasticsearch 6.x
The word-count on threads isn't fully working yet (it depends on Threadmarks which haven't been fully ported to XF2 yet), but I'll bugfix that
Got 2.0.3 with no problems, but every time I try to update, presently to 2.1.4, I get this

XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'word_count' in 'where clause' in src/XF/Db/AbstractStatement.php at line 212

    XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
    XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 39
    XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54
    XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 79
    XF\Db\AbstractAdapter->query() in src/addons/SV/WordCountSearch/Setup.php at line 52
    SV\WordCountSearch\Setup->upgrade2010000Step2() in src/XF/AddOn/StepRunnerUpgradeTrait.php at line 122
    SV\WordCountSearch\Setup->upgradeStepRunner() in src/XF/AddOn/StepRunnerUpgradeTrait.php at line 71
    SV\WordCountSearch\Setup->upgrade() in src/XF/Admin/Controller/AddOn.php at line 449
    XF\Admin\Controller\AddOn->actionUpgrade() in src/XF/Mvc/Dispatcher.php at line 249
    XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
    XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
    XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
    XF\App->run() in src/XF.php at line 328
    XF::runApp() in admin.php at line 13

There is no uninstall option in the settings, but every time I disable it, wipe out the files from src, then ftp the new up, it still just says:

Upgrade from 2.0.3

And when I do, same happens. I've even repaired the database after erasing all 2.0.3 files.

Thank you for creating it though.
I don’t see any screenshots, where is this displayed? Just on the search page? Can this be limited to Search first post only?

What Is like to do is Display pre-defines Search Criteria (ie Buttons for “less than 500 words” “less than 2500 words” “less than 5000 words”) that considers first post only, and displays these predefines search shortcuts or thread filtering only for specific nodes. If you’re willing I’d be interested in funding development to incorporate these festures.
Top Bottom