Replies: 2 comments
-
Search is still a work in progress. The implementation is not hard really, extract data (content, title, description, ...) from page when it’s rendered into a data store of choice that is optimised for search. Different database solutions are outlined here: https://github.com/joomlatools/joomlatools-pages/projects/2#card-37435563 I am leaning towards TNTSearch, https://github.com/teamtnt/tntsearch which can run using sqlite which makes it very lean. ApproachIn case you want to give this as go. The approach is similar to how the static caching works only you write the data to a db instead of the filesystem and you extra only that data you need. With search you would extract the data you need and insert it in the datastore of choice. The code for the staticcache can be found here: https://github.com/joomlatools/joomlatools-pages/blob/master/code/event/subscriber/staticcache.php The onAfterDispatcherCache and onAfterDispatcherPurge events are perfect for this, the cache event is only called when a page is cached, or when the cache is updated, (if the page remains the same it’s not called), purge is called when the page is removed from cache. You can either grab the page content by re-rendering the page, just getting the html, or you run a little regex over the html to filter out a specific html element. Description, title and other metadata you can fetch from the page. Thats it, and your good to go 🙂 |
Beta Was this translation helpful? Give feedback.
-
@JoeJoomla Little update on this. I have made quite a bit of improvements in Pages v0.23 to make it possible to implement search. Most specifically, the improvements to the entity routing and jsonapi discoverability. I have chosen to use Meilisearch instead of TNTSearch as I previously mentioned. Meilisearch is installed in Joomlatools Server which we use to run all our sites. Here is how this works: 1. Create a
|
Beta Was this translation helpful? Give feedback.
-
Joomlers have taken search for granted since the CMS a database driven and search is baked in. When creating a Pages site what consideration should be given for search functionality if the site is not using a database?
Beta Was this translation helpful? Give feedback.
All reactions