Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Scout Tntsearch Driver

Laravel Scout Tntsearch Driver Laravel Package

teamtnt/laravel-scout-tntsearch-driver

Full-text search for Laravel models via Scout and TNTSearch, supporting Laravel 5.3 through 13. Installs with Composer, registers Scout and TNTSearch service providers, sets SCOUT_DRIVER=tntsearch, and publishes the scout config.

View on GitHub
Deep Wiki
Context7

TNTSearch Driver for Laravel Scout brings fast, local full-text search to your Eloquent models without requiring an external search service. Supporting Laravel 5.3 through 13, it integrates seamlessly with Scout, letting you index and query models using the lightweight, file-based TNTSearch engine.

  • Simple Composer install with service provider registration
  • Works with all Laravel versions from 5.3 to 13
  • Configurable index directory and search options via config/scout.php
  • Activate instantly with SCOUT_DRIVER=tntsearch
  • No external server or database required—pure PHP search
Frequently asked questions about Laravel Scout Tntsearch Driver
What is teamtnt/laravel-scout-tntsearch-driver used for?
It is a Laravel Scout driver powered by TNTSearch that adds full-text search to Eloquent models through the standard Scout API, such as Model::search. It keeps search behind Scout's stable interface, so search usage stays application-facing and can be replaced later with another Scout driver. It suits classic full-text search in monoliths, internal tools, admin dashboards, and single-VPS deployments.
How do I install and configure the TNTSearch driver in Laravel?
Install it with composer require teamtnt/laravel-scout-tntsearch-driver, register Scout's service provider and TNTSearchScoutServiceProvider, set SCOUT_DRIVER=tntsearch, and publish config/scout.php. Add the Searchable trait and toSearchableArray to each model, then run an import command for that model. On Laravel 11 and later, register the providers in bootstrap/providers.php; on earlier versions, use config/app.php.
Which Laravel versions does laravel-scout-tntsearch-driver support?
The package supports Laravel 5.3 through 13.0. For Laravel 11 and newer, register the Scout and TNTSearch providers in bootstrap/providers.php; for earlier versions, register them in config/app.php. Check the installed package release notes when upgrading major Laravel versions because driver and framework coupling can change.
Should I run scout:import or tntsearch:import for TNTSearch?
Laravel Scout's scout:import preserves relations in toSearchableArray, while tntsearch:import is faster but drops relation support. That difference matters if you index related data such as author names or category labels, because the faster path silently limits what can be indexed. Choose the import path deliberately and document it as a team convention.
Can I use TNTSearch with Laravel Scout on multiple servers or containers?
TNTSearch writes index files to storage_path, so it is disk-based and effectively single-writer and node-local. It works well for monoliths, single-VPS deployments, and single-container setups, but horizontally scaled fleets need a shared volume and still risk concurrent writer contention. In containerized environments, use a persistent volume and a reindex-on-boot guard so deploys or scale events do not silently empty search.
How do I keep the TNTSearch index in sync with my database?
The index is a derived artifact outside the database transaction boundary, so deletes, soft deletes, bulk DB::table updates, and failed jobs can leave stale or phantom results. Mitigate with model events plus queued searchable calls, scheduled full reindexes, and a reconciliation check such as scout:status plus a nightly count comparison. Route indexing through queues and accept eventual consistency in the UI rather than reindexing synchronously in the request path.
Is TNTSearch suitable for faceted search, geo search, or vector search?
It is strong for classic full-text search, including tokenized matching, fuzzy options, boolean search, and as-you-type search per model. It is weak or absent for facets and aggregations, geospatial search, semantic or vector search, distributed sharding, and managed relevance analytics. Scope the search feature set before committing, because those missing capabilities decide whether this is a short integration or a dead end.
How do I filter or constrain TNTSearch results by tenant or authorization?
The constrain method accepts Eloquent constraint builders, so tenant and authorization filtering can stay in query scopes instead of being reimplemented in a search DSL. Search matching is fast locally, but correctness depends on the database round trip for those constraints. Apply constraints and ordering after the search call, as shown in the README, and encode that ordering convention in code review.
How do I test a Laravel app using the TNTSearch Scout driver?
Because results come from an index file rather than direct database rows, tests should build or import a fresh index for the models under test and use a test-specific index path. Avoid relying on records written in the same transaction without indexing, and assert through the Scout search API rather than assuming immediate consistency. Keep index files out of version control and clean them between test runs.
What are alternatives to TNTSearch for Laravel Scout, and what about maintenance?
Alternatives include Algolia, Meilisearch, and Elasticsearch through their Laravel Scout drivers, which are better fits for faceted, distributed, or managed search. Because Scout provides a stable interface, migration cost is mainly configuration plus reindexing rather than an application rewrite. TNTSearch is a low-cost choice for monoliths and single-VPS deployments, but treat package upgrades and Laravel version coupling as an explicit maintenance task.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections