studiomitte / typesense-search
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 0
Open Issues: 0
Type:typo3-cms-extension
Requires
- php-http/curl-client: ^2
- php-http/httplug: ^2
- symfony/http-client: ^6 || ^7
- typesense/typesense-php: v5.0.0-RC1 || ^4
- typo3/cms-core: ^12
- vipnytt/sitemapparser: 1.3
This package is auto-updated.
Last update: 2024-11-15 09:07:05 UTC
README
This extension provides an integration of typesense search engine into TYPO3 CMS. It is still in an early stage and not yet feature complete.
I am however where interested in feedback and contributions.
Features
- Integration of
InstantSearch
for an awesome search experience - Facets
- Proxy for hiding typesense endpoint
- Custom filtering to use search for different scopes like
- language
- record types
What this extension does not provide
This extension is just in the beginning and is not yet a full alternative to other search extensions like solr.
- No queue, no monitoring of records, only full indexing possible
- No permission handling (records which are limited to user_groups)
- No time checks (starttime, stoptime)
Setup
Installation
Install the extension by using composer req studiomitte/typesense-search
. You then get also the dashboard at
http://yourproject.ddev.site:8109/
with login API key ddev
.
For testing, I suggest using ddev get kevinquillen/ddev-typesense
to get a typesense instance running locally.
For production, you should take a look at https://typesense.org/docs/guide/running-in-production.html#production-best-practices.
Configuration
Copy the settings.yaml from Resources/Private/Examples/settings.yaml
to your site configuration and adjust it to your needs.
Especially important is the authentication
part.
Indexing
There are 2 options supported how to index your records.
Sitemap for content
The following CLI call indexes a sitemap. Provide the site identifier as 1st argument and the URL as 2nd one.
# Use the pages sitemap generated by TYPO3 ./bin/typo3 typesense:sitemap main 'https://www.domain.tld.com/sitemap.xml?sitemap=pages&cHash=....'
Custom indexing
Copy the example EXT:typesense_search/Resources/Private/Examples/TypesenseImportCommand.php
to your site package/extension and adopt it your needs.
Don't forget to adopt the constants in the class to your needs!
Plugin & Templating
After indexing you can use the Search plugin to add the typeense instant search to your page.
Geosearch
If using a geosearch, you need to index the coordinates like this
$document['_geoloc'] = [$row['lat'], $row['lng']];
and provide a Google Maps API in the Search/Index.html
template.