Download the PHP package jbouzekri/sculpin-search-bundle without Composer
On this page you can find all versions of the php package jbouzekri/sculpin-search-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sculpin-search-bundle
SculpinSearchBundle
This bundle provides a search engine using indextank service for your static site.
You can use the service Indexden.
You can see a working demo on the right column of my personal french blog.
Installation
Using composer, add the dependancy to your composer.json :
And run the composer update command (indextank must be declared in your composer.json because the current stable version does not include the composer file moreover it is not yet on packagist so the repositories part is required)
Enable the bundle. If you have already have an app/SculpinKernel.php, add this bundle to it otherwise create the file with the following content :
Then you need to configure the indextank service in sculpin_kernel.yml :
If you use indexden, you can use the private url to fill this parameters : http://:[email protected]
Usage
On each post you want to index, add the indexed: true data in the markdown part of the file.
You can now regenerate your site.
You can now add a form HTML markup to your site :
This bundle provides a simple indextank client library in js you can use. Add the Resources/public/js/indextank_client.js to your project. You can now use the following code to update your list of posts when performing a search :
How it works
An event listener is bind to the afterRun event. It indexes in indextank all documents marked with the indexed flag.
When indexing, it clears the index and bulk add the selected sources so it can take some times to generate the site when you index a lot of document.
Because of that, I added a generate command which wrap the original sculpin generate one in order to add an option no-index. When runing this command, you can work on your static site and the content will not be indexed each time you change something in a file. (However do not forget to launch the generate command without this parameter at the end to update your index in the search service).
Configuration Reference
License
MIT