PHPackages                             venveo/craft-documentsearch - 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. venveo/craft-documentsearch

ActiveCraft-plugin

venveo/craft-documentsearch
===========================

Extract the contents of text documents and add to Craft's search index

4.0.2(3y ago)75.4k↓100%3[1 PRs](https://github.com/venveo/craft-documentsearch/pulls)MITPHPPHP ^8.0.2

Since Mar 12Pushed 1y ago3 watchersCompare

[ Source](https://github.com/venveo/craft-documentsearch)[ Packagist](https://packagist.org/packages/venveo/craft-documentsearch)[ RSS](/packages/venveo-craft-documentsearch/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (4)Versions (14)Used By (0)

Document Search plugin for Craft CMS 4
======================================

[](#document-search-plugin-for-craft-cms-4)

Extracts keywords and phrases from PDF documents and adds them to Craft CMS' native search index.

**NOTE:**Please try before you buy and make sure this plugin suits your needs. You may not get the results you're expecting! Certain document types do not necessarily lend themselves well to this process.

**NOTE:**If you're looking for a full-text document search solution, this may not be it. The purpose of this plugin is to boil down large documents to consumable sizes for your database. If the full-text will fit in the search index, it will be inserted; otherwise, we will parse for common n-grams.

How it works
------------

[](#how-it-works)

Document Search exists to augment the exisitng Craft CMS search index. To do this, we want to avoid polluting it with large amount of data, so we will extract only the most important parts. However, if the content of the pdf fits in the search index, it will be stored unmodified.

When a PDF is saved as an asset and the Volume is configured to be searched, the textual content will be extracted by the pdftotext executable. First, this content is sanitized and normalized with "stop words" removed. Stop words are essentially non-useful words such as "and". Stopwords are selected based on the Asset's locale language (with fallback to english.) This content is then processed into the top 30 (30 of each) 1-gram, 2-gram, and 3-grams. In this scenario, 1-grams are going to simply be most commonly occuring words. Two and three grams are going to help prioritize exact phrase matches. For example, processing the Wikipedia page for "cats" yields the following search keywords:

```
cats cat domestic archived original retrieved pmid species feral journal isbn september october animal humans prey animals acid new pdf felis november human veterinary behavior small august press january person diseased ranging hectares housecats range range hundreds hundreds meters meters central central point synonymia et cvm synonymia establish territories territories vary vary considerably considerably size varietates cvm historia animalivm regni animalis oclc erxleben laurentii salvii lying rice rice straw holmiae laurentii tenth reformed energy sleeping synonymis locis differentiis synonymis especially grow et historia time vicinity older daily liberg sandell pads pant heat suggests aredreaming sociability lighted great pomp fires lighted great experience short periods short periods rapid periods rapid eye rapid eye movement eye movement sleep movement sleep accompanied sleep accompanied muscle accompanied muscle twitches muscle twitches suggests twitches suggests aredreaming aredreaming sociability wildcats brief period asleep sociability wildcats solitary midsummer fires lighted metz midsummer fires paris metz midsummer bonfire paris metz midsummer bonfire paris presided midsummer bonfire monarch presided midsummer occasion monarch presided hall occasion monarch variable ranges widely ranges widely dispersed widely dispersed individuals great pomp esplanade

```

Notice the first 30 keywords are things like: cats, cat, species, domestic however they do not have any contextual relation to their adjacent keywords. As we move down the list, you'll notice short phrases that someone might search for to yield a more exact match, such as: "central point", "eye movement", "widely dispersed inviduals", "great pomp esplanade"

These 2 and 3 grams are not simply based on their number of occurrences but are actually derived by a process known as Rapid Automatic Keyword Extraction (RAKE) to infer the importance based on the words in them.

Document Search Usage
---------------------

[](#document-search-usage)

Once installed and configured (see configuration section), PDF assets with text in them (does not work with images, such as scans) will be indexed automatically.

Like other fields in Craft, you may tweak the search query to your liking by targeting the field named `contentKeywords`

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

[](#requirements)

- Craft CMS 3.1.x
- pdftotext executable
- Ample memory

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

[](#installation)

### Plugin

[](#plugin)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require venveo/document-search

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Document Search.

### pdftotext Executable

[](#pdftotext-executable)

To install on Ubuntu or Debian, the precompiled binaries can be procured from aptitude:

`apt-get install poppler-utils`

To install on RedHat or CentOS, the precompiled binaries can be procured from yum:

`yum install poppler-utils`

**Note:**If you're looking for a full-text document search solution, this isn't it. The purpose of this plugin is to boil down large documents to consumable sizes for a PHP-based web server.

Configuring Document Search
---------------------------

[](#configuring-document-search)

Document Search requires a runnable binary of `pdftotext`. The default file location for the binary is set to `/usr/local/bin/pdftotext` but can be changed through config or settings options.

To check if you have pdftotext installed on your server, you can run:

`which pdftotext`

See the installation section for notes on installing pdftotext.

Using Document Search
---------------------

[](#using-document-search)

The search index will populate keywords extracted from assets when they are saved. Keywords for existing assets are not automatically generated, but can be generated using the `./craft resave/assets` command included with Craft.

Brought to you by [Venveo](https://venveo.com)

###  Health Score

38

—

LowBetter than 86% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 79.4% 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

Every ~232 days

Recently: every ~156 days

Total

9

Last Release

710d ago

Major Versions

1.0.3 → 4.0.02022-07-25

PHP version history (2 changes)4.0.0PHP ^8.0.2|^9.0

4.0.1PHP ^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/c06cc90c1a7f274f31233258cedf58df05f581a0c1a79f44b40764a60b96f377?d=identicon)[ransom](/maintainers/ransom)

---

Top Contributors

[![Mosnar](https://avatars.githubusercontent.com/u/3810939?v=4)](https://github.com/Mosnar "Mosnar (50 commits)")[![jrm98](https://avatars.githubusercontent.com/u/2946458?v=4)](https://github.com/jrm98 "jrm98 (9 commits)")[![derak-kilgo](https://avatars.githubusercontent.com/u/1054504?v=4)](https://github.com/derak-kilgo "derak-kilgo (2 commits)")[![mofman](https://avatars.githubusercontent.com/u/3038169?v=4)](https://github.com/mofman "mofman (2 commits)")

---

Tags

cmsCraftcraftcmscraft-plugindocument search

### Embed Badge

![Health badge](/badges/venveo-craft-documentsearch/health.svg)

```
[![Health](https://phpackages.com/badges/venveo-craft-documentsearch/health.svg)](https://phpackages.com/packages/venveo-craft-documentsearch)
```

###  Alternatives

[verbb/image-resizer

Resize assets when they are uploaded.

127266.8k6](/packages/verbb-image-resizer)[pennebaker/craft-architect

CraftCMS plugin to generate content models from JSON/YAML data.

72148.3k5](/packages/pennebaker-craft-architect)[supercool/buttonbox

A collection of utility field types.

8953.2k1](/packages/supercool-buttonbox)

PHPackages © 2026

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