AdvSearch 1.0.0 RC2 is now available from the MODx repository.
You can download it from
here.
The description says "Dynamic content search add-on that supports results highlighting, faceted search and search in custom packages."
beuh ... too good to be true ?
ok so let me give you some details ...
AdvSearch could run possibly with 3
engine modes:
- mysql
- zend
- all
With the mysql engine mode, as ajaxSearch or SimpleSearch (without Solr extension), the search occurs only inside the static content stored in the mysql database.
With the Zend engine, the search runs first, in Lucene indexes and then retrieve from the database the content for highlighting the search terms found.
So unlike AjaxSearch, AdvSearch could searche on dynamic content, not only on database content (with potential unparsed elements like tvs, snippets call and so on).
AdvSearch for search in dynamic content, is based on Zend_search_lucene api. Apache Lucene(TM) is a high-performance, full-featured text search engine library written entirely in Java.
The zend_search_lucene api is the port of Apache Lucene in Php. So no needs of a solr server with AdvSearch, you need only to install the Php Zend library before to run AdvSearch first.
The mode "all" is a mixt of the two modes. First we get the results with the Zend mode, then we do a search with the mysql mode and we merge the results.
So if the zend search is limited to some specific documents (pdf documents or doc resources with lot of MODx tags) we get the better of the two worlds.
The performance with MySql and the search in dynamic content. As I haven’t run heavy tests with the mode "all", I recommend to verify the performances first before any go live.
The developpement of this addon has been possible with the support of
Marama media (Rachel) and a company of New Zealand. Thanks to them.
AdvSearch RC1 is running on
this site.
Otherwise the features of AdvSearch RC2 are the same as ajaxSearch ... excepted that the ajax mode is missing
As much as possible I try to have the same parameter names than SimpleSearch to facilitate migration from one to other. And As the Solr extension of Simple search is also based on Lucene may be it could be possible (not checked) to use the same repository with the two add-ons.
====== Functional features
- Highly customizable
Search form and search results completely customizable through templates and css
Result data available in templates as placeholders
Output of results available as html results or as json structure
- Rich query syntax
- The syntax is the same for mysql or for the zend engine. The same search string analyser is used.
The syntax includes:
- single (?) and multiple character (*) wildcard searches,
- boolean operators: AND, OR
- the NOT operator
- the grouping of terms using parentheses,
- Single Terms and phrases by using quotes
- Clear Default and help button
- the clearing of the default text (Search here ...) is available with the clearDefault parameter
- A customizable help button opens a window to provide an help on the search query syntax. The content of the help is fully customizable too.
- Search in TVs:
- Sql queries have been optimized for search in TVs.
- fields, withFields, withTvs and includeTvs parameters allow to specify where the search occurs and which are the information available as placeholder in the results.
- with showExtract parameter you specify which fields are used to set the extract and how many extracts per result you want
- Faceted search
Filter the results with the Query Hook (a snippet). By declaring the "andCondtions" in the Query Hook you can set up and manage powerfull filters.
Read the specific Query Hook documentation.
- Several instances on the same page
Set as many search inputs & results as you want on the same page.
- Dynamic content search with Zend
(See above). By default Mysql is the default engine mode.
To index the documents and set the Lucene repository I will provide soon a backend module.
Until now I used a manual script.
- Search in custom packages
By using "joined" query hook declaration you can add joined resources to the default modResource
The "main" declaration allow to replace modResource by an another main resource.
- Highlighting of results
What ever the complexity of the search terms used, there are highlighted in the extract results
- Two paging types available
paging type 0 : 1 | 2 | 3 | 4
paging type 1 : Next 6-10/26 Previous
===== Technical pre-requisites
- Revo 2.1 and upper (Php and MySQL versions)
- UTF-8 charset
- php multi-bytes ON
- Jquery 1.5.1 (provided with advSearch)
- Zend library 1.11 (You should manually install this library)
===== add-on
Install via package management:
- 3 snippets: AdvSearchForm, AdvSearchHelp, AdvSearch
- 1 resource: AdvSearchHelp
- 10 chunks
- properties (default and properties). Available only in English. Thanks for the translations.
The code is highly commented and easily understandable by any developper.
it inludes 3 snippets, 5 php classes and 2 minified javascript scripts.
All the $_REQUESTS values are sanitized before to be used for security reasons.
I will install a new git repository at
https://github.com/Coroico in the following days to support the code.
===== Road map
The next steps are:
- ajax mode
- Bridge with Gmaps add-on
- Search in pdf and word documents
- Backend module to index the documents of a site (html, pdf, doc)
- Highlighting plugin
===== Demos and documentation
Demos are available
here
AdvSearch and Query Hook documentation and examples are available
on this page.
Thanks for your feedbacks. Especially on the documentation and quality of the code.