Download the PHP package heimrichhannot/contao-search-bundle without Composer
On this page you can find all versions of the php package heimrichhannot/contao-search-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download heimrichhannot/contao-search-bundle
More information about heimrichhannot/contao-search-bundle
Files in heimrichhannot/contao-search-bundle
Package contao-search-bundle
Short Description This bundle contains enhancements for Contao Search.
License LGPL-3.0-or-later
Informations about the package contao-search-bundle
Contao Search Bundle
This bundle contains enhancements for Contao Search. You can enable or disable all functionality to pick up just the features you need.
Features
- pdf search
- set maximum number of search terms
- Page filter for search module
- Related search content element
- log search terms
Usage
Install
- Install composer bundle:
composer require heimrichhannot/contao-search-bundle
- Optional: Install guzze HTTP client:
composer require guzzlehttp/guzzle
(needed for rebuild search index command) - Optional: Install Smalot PdfParser:
"smalot/pdfparser": "^2.3"
(needed for pdf search, minimum supported version is 0.18.2) - Enable/Disable features you want in your project config (see chapter configuration) and clear your cache
- Update your database
Maximum number of search terms
- Be sure
huh_search.disable_max_keyword_filter
is set to false (is false by default) -
Set maximum number of keywords to a value higher than 0 to enable
- If you want to output a user notice if the max keyword count is exceeded, select
mod_search_searchbundle
module template or output$this->maxKeywordsExceededMessage
template variable where you like. - If you need to support a language with special letters like german umlauts, you can pass additional chars to the
huh_search.valid_word_chars
option to get a correct word count. By default, the german umlauts and eszett are preconfigured. Keep in mind, that you override the default value by setting this option (so you need to add them in your config if you want to support them).
Example:
- If you want to customize the message, overwrite the translations keys for
huh_search.module.max_keywords_exceeded_message
(Symfony translations used).%count%
(number of provided keywords) and%max%
(max allowed number of keywords) are provided as placeholder values.
Filter your search results by page
- Enable
huh_search.enable_search_filter
in your config (enabled by default) -
Create or edit your search engine module and setup the search filter section as you like
Related search content element
This element is basically the content hyperlink element (also uses the same templates) but with the twist, that it keeps the search parameters. It's designed for use together with news filter to link to another search module with a different filter config.
- Create a Related search link content element on a page with an search module
- Set another page with a search module as target
Search keyword log
To log search keywords, just set huh_search.enable_search_log
to true. Afterwards you'll find huh_search_log
-files withing your log folder containing a csv-formatted list of datetime and keyword. Maximum 7 days are stored (you can alter this period by customizing the monolog settings for huh_search_log channel).
Pdf search
To enable pdf indexing for contao search, following steps are needed:
-
Set
huh_search.pdf_indexer.enabled
to true - Add
"smalot/pdfparser": "^0.18"
as composer dependency - Rebuild search index
For more configuration options for the pdf indexer see the configuration reference.
Configuration
Complete configuration reference
Acknowledgments
The pdf search integration was sponsored by fanthomas communications.
All versions of contao-search-bundle with dependencies
contao/core-bundle Version ^4.13 || ^5.0
heimrichhannot/contao-utils-bundle Version ^2.134 || ^3.0
symfony/config Version ^5.4 || ^6.0
symfony/console Version ^5.4 || ^6.0
symfony/deprecation-contracts Version ^1.0 || ^2.0 || ^3.0
symfony/event-dispatcher-contracts Version ^1.0 || ^2.0 || ^3.0
symfony/http-kernel Version ^5.4 || ^6.0
symfony/polyfill-php80 Version ^v1.27.0
symfony/translation-contracts Version ^1.0 || ^2.0 || ^3.0