Download the PHP package daun/statamic-loupe without Composer
On this page you can find all versions of the php package daun/statamic-loupe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package statamic-loupe
Statamic Loupe Search Driver
This addon provides a Loupe search driver for Statamic sites.
Loupe
...is a local SQLite search engine that is easy to set up and requires no additional infrastructure.
- Only requires PHP and SQLite, nothing else
- Tolerates typos and supports stemming
- Supports
-negated
queries and"phrase search"
- Supports filtering and ordering on geo distance
- Sorts by relevance
This addon
- Manages search indexes behind the scenes
- Provides highlights and snippets for contextual search results
Installation
Add the new driver to statamic/search.php
.
Now set your indexes to use the new driver.
Configuration
While Loupe will work just fine with the default settings, there are a few knobs you can turn to fine-tune the indexing and ranking of results. The values below are the default values. Most of these map directly to Loupe's configuration items.
Search highlights
Enable term highlighting to wrap occurrences of search words in <mark>
tags. You'll need to
explicitly define the attributes to apply highlighting in.
You can now display the configured fields from the search_highlights
namespace:
You can also configure the exact tags to use for highlighting terms:
Search snippets
Snippets are condensed highlights collecting only the actual matches and the text immediately surrounding them. This allows quick skimming of search results for relevancy and context.
Lorem ipsum dolor sit amet, consetetur ... no sea takimata sanctus est lorem est ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur ... dolore te feugait nulla facilisi lorem ipsum dolor sit amet, consectetuer ...
To enable snippets, define the attributes you want to generate them for, as well as the number of words to include around each match.
Then use the search_snippets
namespace to display the formatted fields: