Typesense Search
Overview
EXPERIMENTAL AND INCOMPLETE
Available from ResourceSpace 11.0 (or in trunk/branches for developers).
This plugin is under development and is missing some functions such as resource filtering and permissions. It should only be used where you are comfortable with all users seeing all resources in results, until these additional restraints have been added to Typesense.
The Typesense Search plugin integrates ResourceSpace with a local Typesense server to provide significantly faster keyword searching on large datasets.
When compatible searches are detected, the plugin routes them to Typesense automatically. Any unsupported searches fall back transparently to the standard ResourceSpace/MySQL search engine. If the Typesense server is unreachable or misconfigured, the standard search is used instead, again transparently.
Supported Search Types
- Standard keyword searches
- Resource type filtering
- Archive state filtering
Unsupported Search Types
The following search types currently fall back automatically to the standard ResourceSpace/MySQL search engine:
- Searches beginning with !
- Field searches using :
- Node searches using @@
- Smart search
- Editable-only searches
- Disk usage requests
Requirements
- Ubuntu 22.04 or newer recommended
- ResourceSpace
- PHP cURL extension
- Typesense Server 0.25 or newer recommended
Installing Typesense on Ubuntu
Install Required Packages
sudo apt updatesudo apt install curl gnupg -y
Download the Typesense Package
curl -fsSL https://dl.typesense.org/releases/typesense-0.25.2/typesense-server-0.25.2-amd64.deb -o typesense-server.deb
Install Typesense
sudo dpkg -i typesense-server.deb
Enable and Start the Service
sudo systemctl enable typesense-serversudo systemctl start typesense-server
Verify the Service Is Running
curl http://127.0.0.1:8108/health
Expected response:
{"ok":true}
Plugin Installation
Ensure the Correct Branch Is Installed
Ensure you are using the correct ResourceSpace branch containing the typesense_search plugin.
Enable the Plugin
Enable the plugin from the ResourceSpace Plugin Manager.
Configure the Plugin
Open the plugin setup page and configure the connection settings.
- Host: 127.0.0.1
- Port: 8108
- Protocol: http
- API key: YOUR_SECURE_API_KEY
- Collection: resources (or your custom name)
- Timeout seconds: 2
Verify PHP cURL Support
php -m | grep curl
If cURL is missing:
sudo apt install php-curlsudo systemctl restart apache2
Initial Indexing
The plugin includes a command line reindexing script:
plugins/typesense_search/scripts/reindex.php
Run the script from the ResourceSpace root directory:
php plugins/typesense_search/scripts/reindex.php
Optional Arguments
php plugins/typesense_search/scripts/reindex.php [batch_size] [start_after_ref]
Examples:
php plugins/typesense_search/scripts/reindex.php 500
php plugins/typesense_search/scripts/reindex.php 500 100000
Indexing Output
The reindex script reports:
- Indexed resources
- Failed resources
- Batch timing
- Indexing rate
- Total indexed content size
- Memory usage
Example output:
Starting Typesense reindex | Batch size: 500 | Starting after ref: 0[2026-05-12 15:10:42]Indexed this batch: 500| Failed this batch: 0| Total indexed: 500| Last ref: 500| Batch content: 1,284,221 chars| Total content: 1,284,221 chars| Batch time: 4.21s| Rate: 118.77 resources/sec| Memory: 64MB
Testing Search
After indexing completes:
- Log into ResourceSpace.
- Run a normal keyword search.
- Verify that results appear as expected.
- Optimally, enable debug logging (below) and verify that keyword searches are using Typesense by looking for the Typesense lines in the log.
No user interface changes are required; searches continue to operate normally.
Debugging
ResourceSpace debug logging can help troubleshoot indexing or search issues.
Verify Typesense Health
curl http://127.0.0.1:8108/health
Verify Collections
curl -H "X-TYPESENSE-API-KEY: YOUR_SECURE_API_KEY" \http://127.0.0.1:8108/collections
Verify Indexed Documents
curl -H "X-TYPESENSE-API-KEY: YOUR_SECURE_API_KEY" \"http://127.0.0.1:8108/collections/resources/documents/search?q=test&query_by=title,text"
Metadata Updates
The plugin automatically reindexes resources whenever metadata changes.
Node updates also trigger reindexing for affected resources.
Notes
The current focus of the plugin is accelerating standard keyword searches on large datasets.
Planned future enhancements may include:
- Native node searching
- Native field search support
- Faceting and filtering (search filters and field permissions)
- Real-time background indexing