{"id":21389448,"url":"https://github.com/daun/statamic-loupe","last_synced_at":"2026-04-02T12:05:43.530Z","repository":{"id":263908654,"uuid":"891767239","full_name":"daun/statamic-loupe","owner":"daun","description":"Local SQLite search driver for Statamic","archived":false,"fork":false,"pushed_at":"2026-03-24T20:01:57.000Z","size":191,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-26T01:23:17.894Z","etag":null,"topics":["loupe","search","sqlite","statamic"],"latest_commit_sha":null,"homepage":"https://statamic.com/addons/daun/loupe","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-20T23:16:46.000Z","updated_at":"2026-03-24T20:02:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd4804b8-d928-444a-bf9a-2d7b1a4ce298","html_url":"https://github.com/daun/statamic-loupe","commit_stats":null,"previous_names":["daun/statamic-loupe"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/daun/statamic-loupe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-loupe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-loupe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-loupe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-loupe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daun","download_url":"https://codeload.github.com/daun/statamic-loupe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-loupe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31305973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["loupe","search","sqlite","statamic"],"created_at":"2024-11-22T12:26:32.386Z","updated_at":"2026-04-02T12:05:43.523Z","avatar_url":"https://github.com/daun.png","language":"PHP","readme":"# Statamic Loupe Search Driver\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/daun/statamic-loupe.svg)](https://packagist.org/packages/daun/statamic-loupe) [![Test Status](https://img.shields.io/github/actions/workflow/status/daun/statamic-loupe/ci.yml?label=tests)](https://github.com/daun/statamic-loupe/actions/workflows/ci.yml) [![License](https://img.shields.io/github/license/daun/statamic-loupe.svg)](https://github.com/daun/statamic-loupe/blob/master/LICENSE) \u003c!-- [![Code Coverage](https://img.shields.io/codecov/c/github/daun/statamic-loupe)](https://app.codecov.io/gh/daun/statamic-loupe) --\u003e\n\n**This addon provides a [Loupe](https://github.com/loupe-php/loupe) search driver for Statamic sites.**\n\n## Loupe\n\n...is a local SQLite search engine that is easy to set up and requires no additional infrastructure.\n\n- Only requires PHP and SQLite, nothing else\n- Tolerates typos and supports stemming\n- Supports `-negated` queries and `\"phrase search\"`\n- Supports filtering and ordering on geo distance\n- Sorts by relevance\n\n## This addon\n\n- Manages search indexes behind the scenes\n- Provides highlights and snippets for contextual search results\n\n## Requirements\n\n- SQLite PDO 3.35 or higher\n\n## Installation\n\n```sh\ncomposer require daun/statamic-loupe\n```\n\nAdd the new driver to `statamic/search.php`.\n\n```diff\n'drivers' =\u003e [\n    'local' =\u003e ['path' =\u003e storage_path('statamic/search')],\n+   'loupe' =\u003e [],\n],\n```\n\nNow set your indexes to use the new driver.\n\n```diff\n'indexes' =\u003e [\n    'default' =\u003e [\n-       'driver' =\u003e 'local',\n+       'driver' =\u003e 'loupe',\n        'searchables' =\u003e 'content',\n    ],\n],\n```\n\n## Configuration\n\nWhile Loupe will work just fine with the default settings, there are a few knobs\nyou can turn to fine-tune the indexing and ranking of results.\nThe values below are the default values. Most of these map directly to [Loupe's\nconfiguration items](https://github.com/loupe-php/loupe/blob/main/docs/configuration.md).\n\n```php\n'drivers' =\u003e [\n    'loupe' =\u003e [\n        // Storage directory of Loupe's index database\n        'path' =\u003e storage_path('statamic/loupe'),\n\n        // Maximum number of words allowed in a search\n        // Higher values allow more complex queries but may impact performance\n        'max_query_tokens' =\u003e 10,\n\n        // Minimum word length to allow searching by prefix\n        'min_token_length_for_prefix_search' =\u003e 2,\n\n        // Languages to consider for detecting stemming language\n        // Not required for stemming, but speeds things up if they are known\n        'stemming_languages' =\u003e [],\n\n        // Whether typo tolerance is enabled\n        'typo_tolerance_enabled' =\u003e true,\n\n        // Size of the alphabet used for typo tolerance\n        'typo_tolerance_alphabet_size' =\u003e 4,\n\n        // Maximum length of terms to index for typo tolerance\n        'typo_tolerance_index_length' =\u003e 14,\n\n        // Whether typo tolerance is enabled in prefix search\n        'typo_tolerance_for_prefix_search' =\u003e false,\n\n        // Minimum ranking score of results to return (between `0.0` and `1.0`)\n        'ranking_score_threshold' =\u003e 0,\n    ],\n],\n```\n\n## Search highlights\n\nEnable term highlighting to wrap occurrences of search words in `\u003cmark\u003e` tags. You'll need to\nexplicitly define the attributes to apply highlighting in.\n\n```diff\n'indexes' =\u003e [\n    'default' =\u003e [\n        'driver' =\u003e 'loupe',\n        'searchables' =\u003e 'content',\n+       'highlight_attributes' =\u003e ['title', 'summary'],\n    ],\n],\n```\n\nYou can now display the configured fields from the `search_highlights` namespace:\n\n```antlers\n{{ search:results }}\n  \u003ch2\u003e{{ search_highlights:title }}\u003c/h2\u003e\n  \u003cp\u003e{{ search_highlights:summary }}\u003c/p\u003e\n{{ /search:results }}\n```\n\nYou can also configure the exact tags to use for highlighting terms:\n\n```diff\n'indexes' =\u003e [\n    'default' =\u003e [\n        'driver' =\u003e 'loupe',\n        'searchables' =\u003e 'content',\n        'highlight_attributes' =\u003e ['title', 'summary'],\n+       'highlight_tags' =\u003e ['\u003cspan class=\"highlight\"\u003e', '\u003c/span\u003e'],\n    ],\n],\n```\n\n## Search snippets\n\nSnippets are condensed highlights collecting only the actual matches and the text immediately\nsurrounding them. This allows quick skimming of search results for relevancy and context.\n\n\u003e \u003cmark\u003eLorem ipsum\u003c/mark\u003e dolor sit amet, consetetur ... no sea takimata sanctus est \u003cmark\u003elorem\u003c/mark\u003e est \u003cmark\u003eipsum\u003c/mark\u003e dolor sit amet. \u003cmark\u003eLorem ipsum\u003c/mark\u003e dolor sit amet, consetetur ... dolore te feugait nulla facilisi \u003cmark\u003elorem ipsum\u003c/mark\u003e dolor sit amet, consectetuer ...\n\nTo enable snippets, define the attributes you want to generate them for, as well\nas the number of words to include around each match.\n\n```diff\n'indexes' =\u003e [\n    'default' =\u003e [\n        'driver' =\u003e 'loupe',\n        'searchables' =\u003e 'content',\n+       'snippet_attributes' =\u003e ['title' =\u003e 5, 'summary' =\u003e 10],\n    ],\n],\n```\n\nThen use the `search_snippets` namespace to display the formatted fields:\n\n```antlers\n{{ search:results }}\n  \u003ch2\u003e{{ search_snippets:title }}\u003c/h2\u003e\n  \u003cp\u003e{{ search_snippets:summary }}\u003c/p\u003e\n{{ /search:results }}\n```\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaun%2Fstatamic-loupe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaun%2Fstatamic-loupe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaun%2Fstatamic-loupe/lists"}