You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UPGRADING.md
+37-2Lines changed: 37 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,13 +172,48 @@ return new class extends Migration {
172
172
173
173
These columns are automatically populated after each crawl and shown in `site-search:list`.
174
174
175
+
#### 6. `SqliteDriver` replaced by `DatabaseDriver`
176
+
177
+
**Likelihood of impact:** 🔴 **HIGH** - Affects all users using the default driver
178
+
179
+
The `SqliteDriver` has been replaced by `DatabaseDriver`, which uses your application's database for full-text search. It supports SQLite, MySQL, and PostgreSQL.
180
+
181
+
If you were using the default `SqliteDriver`, update your config:
2.**Deep linking**. Search results now include anchor links to specific sections. Use `$hit->urlWithAnchor()` to get URLs like `https://example.com/page#section-id`. Requires re-indexing.
The database driver is the default driver. It stores search documents in your application's database and uses the database's native full-text search capabilities. SQLite (FTS5), MySQL (FULLTEXT), and PostgreSQL (tsvector) are all supported.
7
+
8
+
## How it works
9
+
10
+
The database driver stores all indexed documents in a single `site_search_documents` table. Each document is associated with an `index_name`, which allows multiple search indexes to coexist in the same table.
11
+
12
+
Full-text search infrastructure (virtual tables, indexes, triggers) is created automatically at runtime based on which database you are using. The migration itself is database-agnostic.
13
+
14
+
### Database-specific behavior
15
+
16
+
**SQLite** uses FTS5 virtual tables with porter stemming and unicode support. BM25 ranking weights matches in headings higher than body content. Highlighted snippets are generated natively by FTS5.
17
+
18
+
**MySQL** uses FULLTEXT indexes with boolean mode search. Highlighting is done in PHP after the query.
19
+
20
+
**PostgreSQL** uses tsvector columns with GIN indexes and weighted vectors. `ts_rank()` is used for ranking and `ts_headline()` for highlighting.
21
+
22
+
### Search features
23
+
24
+
All three databases provide:
25
+
26
+
- Full-text search with stemming (e.g. "running" matches "run")
- Highlighted snippets with matching terms wrapped in `<em>` tags
30
+
- Deep linking with anchor links to specific sections (see [Retrieving results](/docs/laravel-site-search/v1/basic-usage/retrieving-results#deep-linking-to-sections))
31
+
32
+
## Using a different database connection
33
+
34
+
By default, the database driver uses your application's default database connection. You can use a different connection by setting a `database.connection` value in the `extra` attribute of the `site_search_configs` table:
35
+
36
+
```json
37
+
{"database": {"connection": "mysql"}}
38
+
```
39
+
40
+
This lets you store search data in a separate database from your application data.
41
+
42
+
## Differences from the Meilisearch driver
43
+
44
+
- No external service required, uses your existing database
45
+
- No support for synonyms or custom ranking rules
46
+
- Indexing is synchronous (no background processing)
Copy file name to clipboardExpand all lines: docs/basic-usage/high-level-overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ weight: 1
5
5
6
6
This package will crawl your entire site and will put the content in a search index. This way, the entire content of your site is searchable. Think of it as a private Google search index.
7
7
8
-
The package supports two search drivers: SQLite (default) and Meilisearch. The search and indexing API is the same regardless of which driver you use.
8
+
The package supports two search drivers: Database (default, supporting SQLite, MySQL, and PostgreSQL) and Meilisearch. The search and indexing API is the same regardless of which driver you use.
9
9
10
10
The configuration for each site that needs to be crawled is saved in the `site_search_configs` table. You can manually create a row in that table or run this artisan command: [`site-search:create-index`](https://spatie.be/docs/laravel-site-search/v1/basic-usage/indexing-your-first-site).
* This job is responsible for crawling your site. To customize this job,
@@ -135,6 +135,6 @@ return [
135
135
136
136
## Search driver
137
137
138
-
The default driver is SQLite, which uses SQLite FTS5 for full-text search. It requires no external services. The SQLite databases will be stored in `storage/site-search` by default. See [Using the SQLite driver](/docs/laravel-site-search/v1/advanced-usage/using-the-sqlite-driver) for more configuration options.
138
+
The default driver is the database driver, which uses your application's database for full-text search. It supports SQLite (FTS5), MySQL (FULLTEXT), and PostgreSQL (tsvector) with no external services required. See [Using the database driver](/docs/laravel-site-search/v1/advanced-usage/using-the-database-driver) for more configuration options.
139
139
140
140
If you need advanced features like synonyms and custom ranking rules, you can [use the Meilisearch driver](/docs/laravel-site-search/v1/advanced-usage/using-the-meilisearch-driver) instead.
Copy file name to clipboardExpand all lines: docs/introduction.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This package can crawl and index one or more sites. You can think of it as a pri
7
7
8
8
Two search drivers are available:
9
9
10
-
-SQLite (default): uses SQLite FTS5 for full-text search with no external dependencies. A great choice for most use cases.
10
+
-Database (default): uses your application's database for full-text search. Supports SQLite (FTS5), MySQL (FULLTEXT), and PostgreSQL (tsvector). No external dependencies required.
11
11
- Meilisearch: blazing fast search speeds, supports [synonyms](/docs/laravel-site-search/v1/advanced-usage/using-the-meilisearch-driver#customizing-index-settings) and other advanced Meilisearch features. Requires a running Meilisearch instance.
12
12
13
13
When crawling your site, multiple concurrent connections are used to speed up the crawling process.
Copy file name to clipboardExpand all lines: docs/requirements.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,5 +5,5 @@ weight: 3
5
5
6
6
Laravel Site Search requires PHP 8.4+ and Laravel 12+.
7
7
8
-
The default SQLite driver has no additional dependencies. When using the Meilisearch driver, a running Meilisearch instance is also required.
8
+
The default database driver supports SQLite, MySQL, and PostgreSQL with no additional dependencies. When using the Meilisearch driver, a running Meilisearch instance is also required.
0 commit comments