AjaxSearch
Tags: Search, plugin, snippet, ajax, chunk, highlighting
Submitted: Jun 8, 2009
Released: Jun 16, 2009
Downloads: 155
License: GPLv3
AjaxSearch 1.8.3-final
Works with the following Version(s): 0.9.6.1 | 0.9.6.2 | 0.9.6.3 | Evolution-1.0.0
Updates
AjaxSearch - version 1.8.3
See ajaxSearch_version_183.txt and ajaxSearch_readme.txt in the zip file
Wiki documentation : http://wiki.modxcms.com/index.php/AjaxSearch
Bugs & features tracker : http://svn.modxcms.com/jira/browse/AJAXSEARCH
Demo site : http://www.modx.wangba.fr
Includes the version 1.4.0 of the plugin searchHighlight
and the version 1.4.0 of the plugin advSearchHighlight
--- NEW OPTIONS AND NEW FEATURES ---
==== Adding the number of the result - AJAXSEARCH-34
+as.resultNumber+ placeholder available to display the number of the search result
Use this placeholder inside your result.tpl.html or ajaxResult.tpl.html template
==== Mootools (1.11 or 1.2.1) or Jquery js library
&jscript 'jquery' | 'mootools1.2' | 'mootools'
Set this to jquery if you would like to include the jquery library
set this to mootools1.2 to include the mootools 1.2.1 library (limited to JS functions used by AS)
by default: mootools. This default include the mootools library provided by MODx
e.g: &jscript=`jquery` or &jscript=`mootools1.2`
==== Capturing failed search criteria and search logs
&asLog - ajaxSearch log level : comment : purge
level:
0 : disallow the ajaxSearch log (default)
1 : failed search requests are logged
2 : all ajaxSearch requests are logged
comment:
0 : user comment not allowed (default)
1 : user comment allowed
purge: number of logs allowed before to do an automatic purge of the table
0 : no purge allowed (= illimited number of logs)
default: 200
&asLog=`x` is equivalent to &asLog=`x:0:200`
&asLog=`x:y` is equivalent to &asLog=`x:y:200`
&asLog=`1:1:500` means that 500 failed search requests possibly commented
by the end user could be stored in the ajaxSearch_log table
&tplComment : chunk to style comment form
by default: @FILE:".AS_SPATH.'templates/comment.tpl.html'
The user searches are stored in the database table $modx_table_prefix."ajaxsearch_log". These data are not for the end user only for the site administrator.
The table could be drop without any impacts on the AjaxSearch behaviour. Simply, if the asLog parameter is set and the table inexisting, the table is rebuilt.
==== SearchString metacharacter available with &filter parameter
The metacharacter '#' is replaced by the search string provided by the web user when used with the filter parameter. The advSearch parameter is also taken into account.
e.g: &filter=`pagetitle,#,8` with searchString=`school child` and advSearch='oneword' is equivalent to &filter=`pagetitle,school,8|pagetitle,child,8`
'oneword','allwords','nowords' generate as many clause as searchterms.
'exactphrase' generate only one clause with the exactphrase as criterion.
Multiple clauses have an "OR" relationship. I.e. a document will be excluded if it meets the criterion of any one clause (clause-1 OR clause-2 OR clause-3, etc.).
(see http://ditto.modxcms.com/tutorials/basic_filtering.html)
==== Limit the amount of keywords that will be queried by a search
&maxWords int
Maximum number of words for searching - Default: 5
==== php_mbstring extension
&mbstring 0 | 1
1 - mbstring extension available (default)
0 - don't use php_mbstring extension
The php_mbstring is supposed to be loaded.
If html charset page is "UTF-8", php_mbstring extension should be loaded for language which need a multi-byte representation.
If the extension is not available for the PHP server, some charset like ISO-8859-1 (latin1) could be used.
With UTF-8, a message "Php_mbstring extension is required" when &mbstring=`1` and the extension not loaded.
In this case load the extension or set the mbstring parameter to 0 if you couldn't load the extension
==== Always display paging
&showPagingAlways 1 | 0 (optional)
always display paging. Even if you get only one page.
Set this to `1` if you would like to always show paging.
Two use cases: You are using non-ajax search or when you are using ajax search but you have set up showMoreResults to `1` and you have defined moreResultsPage, then it may happen that ajax search result have only one page and pagination isn't showed
by default : 0
==== searchString available as placeholder
Use to get the search string used for the search.
For instance use "Search results for " as pagetitle for
your landing page.
==== searchHighlight and advSearchHighlight plugins 1.4
Removed useless urldecode calls;
Added check for magic quotes - if set, remove slashes
Highlights terms searched for when target is a HTML entity
-- ISSUES CORRECTED --
AJAXSEARCH-6 : Sort with order and ranking parameters. Results with a wrong order
AJAXSEARCH-12 : Take into account of the &advSearch parameter when the &minChars is checked
AJAXSEARCH-13 : Wrong Highlighting of search terms
AJAXSEARCH-15 : use $modx->getFullTableName('')
AJAXSEARCH-17 : Livesearch - start of the search only when the minimum character is reached
AJAXSEARCH-18 : function stripHtml incorrectly works
AJAXSEARCH-19 : Parse error if the user enters two or more spaces between words in the query
AJAXSEARCH-21 : search for something like "ecuador span"
AJAXSEARCH-22 : you get a TV value with tvPHX, only if the search has found your term in the TV
AJAXSEARCH-24 : AjaxSearch stops searching through TV content after a certain number of characters
AJAXSEARCH-25 : Security issue with AS_offset
AJAXSEARCH-26 : If the offset exceeds the number of documents retrieved, modx crashes
AJAXSEARCH-27 : AjaxSearch and Document Group permissions
AJAXSEARCH-29 : When using french UTF8 or english UTF8, I get a blank line at the top of the search
AJAXSEARCH-30 : htmlspecialchars() expects at most 3 parameters, 4 given
AJAXSEARCH-31 : parse error with AjaxSearch 1.8.2 when the search has no results and filter parameter used
AJAXSEARCH-32 : pages not to validate as XHTML
AJAXSEARCH-33 : preg_match fails with Segmentation Fault on capturing subpattern
Download
- ajaxsearch183.rev5114.zip (155 downloads)
Description
This snippet creates a search box and the results form. The search results are loaded right in the page for the user. If the user does not have javascript, the snippet will use the default searching of the FlexSearchForm snippet. A search term highlighting plugin has been included as well.
The search could be limited to a subset of documents with the use of parents or documents parameters.
You could use AjaxSearch with your own custom tables.
If the user does not have javascript enabled they can still search your site. In this case the search results are returned in a new page.
You can also include search term highlighting that is carried through to the linked page.
It could works in two modes:
ajaxSearch mode :
- Search results displayed in current page through AJAX request
- Multiple search options including live search and non-AJAX option
- Available link to view all results in a new page when only a subset is retuned
- Customize the number of results returned
- Uses the MooTools or jQuery js library for AJAX and visual effects
non-ajaxSearch mode :
- Search results displayed in a new page
- customize the paginating of results
- works without JS enabled as FlexSearchForm
- designed to load only the required non-ajaxSearch code
Instructions
Follow these steps to install this snippet:
- Copy the contents of the file snippet.ajaxSearch.php into a new snippet named AjaxSearch
- Create a directory named ajaxSearch under the assets/snippets folder.
- Open the ajaxSearch.js file and set the loading & close image path to an image you want to display while the search is working.
- Copy the files from the zip to the ajaxSearch folder.
- Add the snippet call like the following: !AjaxSearch? &AS_showResults=`0` &AS_landing=`17` &showMoreResults=`1` &moreResultsPage=`17`!
- Use the styles to customize the look of your output.
- If you are using the display more results link setup a new page with the snippet call to display your results.
- Test and see the search working with AJAX
Sub-Packages
Previous Releases
1.8.2-b
Tags: Search, plugin, snippet, ajax, chunk, highlighting
Submitted:
Released:
Downloads: 266
License: GNU General Public License (GPL)
AjaxSearch 1.8.2-b
Works with the following Version(s): 0.9.6.1 | 0.9.6.2 | 0.9.6.3
Updates
AjaxSearch - version 1.8.2b
See ajaxSearch_version_182.txt and ajaxSearch_readme.txt in the zip file
Wiki documentation : http://wiki.modxcms.com/index.php/AjaxSearch
Bugs & features tracker : http://svn.modxcms.com/jira/browse/AJAXSEARCH
Demo site : http://www.modx.wangba.fr
Includes the version 1.4.0 of the plugin searchHighlight
and the version 1.4.0 of the plugin advSearchHighlight
--- NEW OPTIONS AND NEW FEATURES ---
==== Mootools (1.11 or 1.2.1) or Jquery js library
&jscript 'jquery' | 'mootools1.2' | 'mootools'
Set this to jquery if you would like to include the jquery library
set this to mootools1.2 to include the mootools 1.2.1 library (limited to JS functions used by AS)
by default: mootools. This default include the mootools library provided by MODx
e.g: &jscript=`jquery` or &jscript=`mootools1.2`
==== Capturing failed search criteria and search logs
&asLog - ajaxSearch log level : comment : purge
level:
0 : disallow the ajaxSearch log (default)
1 : failed search requests are logged
2 : all ajaxSearch requests are logged
comment:
0 : user comment not allowed (default)
1 : user comment allowed
purge: number of logs allowed before to do an automatic purge of the table
0 : no purge allowed (= illimited number of logs)
default: 200
&asLog=`x` is equivalent to &asLog=`x:0:200`
&asLog=`x:y` is equivalent to &asLog=`x:y:200`
&asLog=`1:1:500` means that 500 failed search requests possibly commented
by the end user could be stored in the ajaxSearch_log table
&tplComment : chunk to style comment form
by default: @FILE:".AS_SPATH.'templates/comment.tpl.html'
The user searches are stored in the database table $modx_table_prefix."ajaxsearch_log". These data are not for the end user only for the site administrator.
Informations stored per each search are the following:
- id : internal id of the search request
- searchstring : the search terms used for the search
- nb_results : number of results found
- results : document ids found
- as_call : ajaxSearch snippet call used
- as_select : select statement used (could be reused thru phpmyadmin)
- date : date and hour of the request
- ip : user IP
The table could be drop without any impacts on the AjaxSearch behaviour. Simply, if the asLog parameter is set and the table inexisting, the table is rebuilt.
==== SearchString metacharacter available with &filter parameter The metacharacter '#' is replaced by the search string provided by the web user when used with the filter parameter. The advSearch parameter is also taken into account.
e.g: &filter=`pagetitle,#,8` with searchString=`school child` and advSearch='oneword' is equivalent to &filter=`pagetitle,school,8|pagetitle,child,8`
'oneword','allwords','nowords' generate as many clause as searchterms.
'exactphrase' generate only one clause with the exactphrase as criterion.
Multiple clauses have an "OR" relationship. I.e. a document will be excluded if it meets the criterion of any one clause (clause-1 OR clause-2 OR clause-3, etc.).
(see http://ditto.modxcms.com/tutorials/basic_filtering.html)
==== Limit the amount of keywords that will be queried by a search
&maxWords int
Maximum number of words for searching - Default: 5 ==== php_mbstring extension
&mbstring 0 | 1
1 - mbstring extension available (default)
0 - don't use php_mbstring extension
The php_mbstring is supposed to be loaded.
If html charset page is "UTF-8", php_mbstring extension should be loaded for language which need a multi-byte representation.
If the extension is not available for the PHP server, some charset like ISO-8859-1 (latin1) could be used.
With UTF-8, a message "Php_mbstring extension is required" when &mbstring=`1` and the extension not loaded.
In this case load the extension or set the mbstring parameter to 0 if you couldn't load the extension ==== Always display paging
&showPagingAlways 1 | 0 (optional)
always display paging. Even if you get only one page.
Set this to `1` if you would like to always show paging.
Two use cases: You are using non-ajax search or when you are using ajax search but you have set up showMoreResults to `1` and you have defined moreResultsPage, then it may happen that ajax search result have only one page and pagination isn't showed
by default : 0 ==== searchString available as placeholder
Use to get the search string used for the search.
For instance use "Search results for " as pagetitle for
your landing page. ==== searchHighlight and advSearchHighlight plugins 1.4
Removed useless urldecode calls;
Added check for magic quotes - if set, remove slashes
Highlights terms searched for when target is a HTML entity
-- ISSUES CORRECTED --
AJAXSEARCH-6 : Sort with order and ranking parameters. Results with a wrong order
http://svn.modxcms.com/jira/browse/AJAXSEARCH-6 AJAXSEARCH-12 : Take into account of the &advSearch parameter when the &minChars is checked
http://svn.modxcms.com/jira/browse/AJAXSEARCH-12 AJAXSEARCH-13 : Wrong Highlighting of search terms
http://svn.modxcms.com/jira/browse/AJAXSEARCH-13 AJAXSEARCH-15 : use $modx->getFullTableName('')
http://svn.modxcms.com/jira/browse/AJAXSEARCH-15
AJAXSEARCH-17 : Livesearch - start of the search only when the minimum character is reached
http://svn.modxcms.com/jira/browse/AJAXSEARCH-17
AJAXSEARCH-18 : function stripHtml incorrectly works
http://svn.modxcms.com/jira/browse/AJAXSEARCH-18
AJAXSEARCH-19 : Parse error if the user enters two or more spaces between words in the query
http://svn.modxcms.com/jira/browse/AJAXSEARCH-19 AJAXSEARCH-21 : search for something like "ecuador span"
http://svn.modxcms.com/jira/browse/AJAXSEARCH-21 AJAXSEARCH-22 : you get a TV value with tvPHX, only if the search has found your term in the TV
http://svn.modxcms.com/jira/browse/AJAXSEARCH-22 AJAXSEARCH-24 : AjaxSearch stops searching through TV content after a certain number of characters
http://svn.modxcms.com/jira/browse/AJAXSEARCH-24 AJAXSEARCH-25 : Security issue with AS_offset
http://svn.modxcms.com/jira/browse/AJAXSEARCH-25
AJAXSEARCH-26 : If the offset exceeds the number of documents retrieved, modx crashes
http://svn.modxcms.com/jira/browse/AJAXSEARCH-26 AJAXSEARCH-27 : AjaxSearch and Document Group permissions
http://svn.modxcms.com/jira/browse/AJAXSEARCH-27 AJAXSEARCH-29 : When using french UTF8 or english UTF8, I get a blank line at the top of the search
http://svn.modxcms.com/jira/browse/AJAXSEARCH-29 AJAXSEARCH-30 : htmlspecialchars() expects at most 3 parameters, 4 given
http://svn.modxcms.com/jira/browse/AJAXSEARCH-30 AJAXSEARCH-31 : parse error with AjaxSearch 1.8.2 when the search has no results and filter parameter used
http://svn.modxcms.com/jira/browse/AJAXSEARCH-31 AJAXSEARCH-32 : pages not to validate as XHTML
http://svn.modxcms.com/jira/browse/AJAXSEARCH-32
Download
- ajaxsearch182b_rev4908.zip (266 downloads)
Description
This snippet creates a search box and the results form. The search results are loaded right in the page for the user. If the user does not have javascript, the snippet will use the default searching of the FlexSearchForm snippet. A search term highlighting plugin has been included as well.
The search could be limited to a subset of documents with the use of parents or documents parameters.
You could use AjaxSearch with your own custom tables.
If the user does not have javascript enabled they can still search your site. In this case the search results are returned in a new page.
You can also include search term highlighting that is carried through to the linked page.
It could works in two modes:
ajaxSearch mode :
- Search results displayed in current page through AJAX request
- Multiple search options including live search and non-AJAX option
- Available link to view all results in a new page when only a subset is retuned
- Customize the number of results returned
- Uses the MooTools or jQuery js library for AJAX and visual effects
non-ajaxSearch mode :
- Search results displayed in a new page
- customize the paginating of results
- works without JS enabled as FlexSearchForm
- designed to load only the required non-ajaxSearch code
Instructions
Follow these steps to install this snippet:
- Copy the contents of the file snippet.ajaxSearch.php into a new snippet named AjaxSearch
- Create a directory named ajaxSearch under the assets/snippets folder.
- Open the ajaxSearch.js file and set the loading & close image path to an image you want to display while the search is working.
- Copy the files from the zip to the ajaxSearch folder.
- Add the snippet call like the following: !AjaxSearch? &AS_showResults=`0` &AS_landing=`17` &showMoreResults=`1` &moreResultsPage=`17`!
- Use the styles to customize the look of your output.
- If you are using the display more results link setup a new page with the snippet call to display your results.
- Test and see the search working with AJAX
1.8.1
Votes: 62
Tags: Search, plugin, snippet, ajax, chunk, highlighting
Submitted: Oct 13, 2008
Released: Jun 16, 2009
Downloads: 1308
License: GPL - GNU Public
Package Website
AjaxSearch 1.8.1
Works with the following Version(s): 0.9.6
AjaxSearch allows your site visitors to search your site without leaving the page they are on. The results are returned via an ajax request and loaded into the results box below the search form.
Download
- repo-2222.zip (1308 downloads)
Description
This snippet creates a search box and the results form. The search results are loaded right in the page for the user. If the user does not have javascript, the snippet will use the default searching of the FlexSearchForm snippet. A search term highlighting plugin has been included as well.
The search could be limited to a subset of documents with the use of parents or documents parameters.
You could use AjaxSearch with your own custom tables.
If the user does not have javascript enabled they can still search your site. In this case the search results are returned in a new page.
You can also include search term highlighting that is carried through to the linked page.
It could works in two modes:
ajaxSearch mode :
- Search results displayed in current page through AJAX request
- Multiple search options including live search and non-AJAX option
- Available link to view all results in a new page when only a subset is retuned
- Customize the number of results returned
- Uses the MooTools or jQuery js library for AJAX and visual effects
non-ajaxSearch mode :
- Search results displayed in a new page
- customize the paginating of results
- works without JS enabled as FlexSearchForm
- designed to load only the required non-ajaxSearch code
Instructions
Follow these steps to install this snippet:
- Copy the contents of the file snippet.ajaxSearch.php into a new snippet named AjaxSearch
- Create a directory named ajaxSearch under the assets/snippets folder.
- Open the ajaxSearch.js file and set the loading & close image path to an image you want to display while the search is working.
- Copy the files from the zip to the ajaxSearch folder.
- Add the snippet call like the following: !AjaxSearch? &AS_showResults=`0` &AS_landing=`17` &showMoreResults=`1` &moreResultsPage=`17`!
- Use the styles to customize the look of your output.
- If you are using the display more results link setup a new page with the snippet call to display your results.
- Test and see the search working with AJAX!
See ajaxSearch_version_181.txt and ajaxSearch_readme.txt in the zip file
Wiki documentation : http://wiki.modxcms.com/index.php/AjaxSearch
Bugs & features tracker : http://svn.modxcms.com/jira/browse/AJAXSEARCH
Demo site : http://www.modx.wangba.fr
Includes the version 1.3.0 of the plugin searchHighlight from Sottwell
and the version 1.3.0 of the plugin advSearchHighlight
Version 1.8.1b correct this issue
--- NEW OPTIONS AND NEW FEATURES ---
whereSearch: Extend the search to Jot, maxigallery and your custom tables.
Define in which fields of which tables you want do the search.
Search images in Maxigallery effective
withTvs: Select the Tvs where to do the search
subSearch: Use radio buttons to select sub domains where the search applies
filter: SearchString metacharacter available with &filter parameter
searchWordList: Choose the right word list depending the context
debug: log some informations for debugging in firebug or in a file
Warning:
whereSearch Table separator "," has been replaced by "|"
&whereSearch=`content,tv,jot` becomes &whereSearch=`content|tv|jot`
Documentation:
A documentation folder is provided with the snippet.
It contains, some config files and templates files as examples.
These files are used by some demos on the demo site www.modx.wangba.fr
-- CHANGE REQUESTS IMPLEMENTED --
- AjaxSearch MySQL Query completely re-designed
The SQL Query is now build to find in joined tables only the requested fields that match with the search terms.
The list of id of concatened field is also available.
- Internal description of tables improved
For a search in your own table, you should first describe them.
The version 1.8.1 comes with some changes regarding the description of the main and joined tables.
-- ISSUES CORRECTED --
ADDON-8 : Call to undefined function mb_strlen()
http://svn.modxcms.com/jira/browse/ADDON-8
ADDON-9 : $this->setDatabaseCharset(); - Missing parenthesis
http://svn.modxcms.com/jira/browse/ADDON-9
ADDON-10 : order and ranking don't work together
http://svn.modxcms.com/jira/browse/ADDON-10
ADDON-11 : Error if is present a blank in the beginning of search text
http://svn.modxcms.com/jira/browse/ADDON-11
ADDON-12 : A call to the mb_strrpos php function with an empty text
http://svn.modxcms.com/jira/browse/ADDON-12
ADDON-14 : "ajaxSearch" used as title in the snippet's heading
http://svn.modxcms.com/jira/browse/ADDON-14
ADDON-18 : this code (filter:alpha (opacity=0);-moz-opacity:0.) is not valid CSS.
http://svn.modxcms.com/jira/browse/ADDON-18
ADDON-20 : TV placeholders not working with non-ajax searches
http://svn.modxcms.com/jira/browse/ADDON-20
ADDON-21 : W3C XHTML Strict Validation - layout.tpl.html
http://svn.modxcms.com/jira/browse/ADDON-21
ADDON-22 : Fix for Japanese language
http://svn.modxcms.com/jira/browse/ADDON-22
AJAXSEARCH-5 : Some extracts are cut in middle of sentence without reasons
http://svn.modxcms.com/jira/browse/AJAXSEARCH-5
AJAXSEARCH-7 : JS Cross Site scripting - security issue
http://svn.modxcms.com/jira/browse/AJAXSEARCH-7
AJAXSEARCH-8 : pageLinkSeparator not visible
http://svn.modxcms.com/jira/browse/AJAXSEARCH-8
1.8.0
Votes: 58
Tags: Search, plugin, snippet, ajax, chunk, highlighting
Submitted: Jul 24, 2008
Released: Jun 16, 2009
Downloads: 1186
License: GPL - GNU Public
Package Website
AjaxSearch 1.8.0
Works with the following Version(s): 0.9.6
AjaxSearch allows your site visitors to search your site without leaving the page they are on. The results are returned via an ajax request and loaded into the results box below the search form.
Download
- repo-2131.zip (1186 downloads)
Description
This snippet creates a search box and the results form. The search results are loaded right in the page for the user. If the user does not have javascript, the snippet will use the default searching of the FlexSearchForm snippet. A search term highlighting plugin has been included as well.
The search could be limited to a subset of documents with the use of parents or documents parameters.
You could use AjaxSearch with your own custom tables.
If the user does not have javascript enabled they can still search your site. In this case the search results are returned in a new page.
You can also include search term highlighting that is carried through to the linked page.
It could works in two modes:
ajaxSearch mode :
- Search results displayed in current page through AJAX request
- Multiple search options including live search and non-AJAX option
- Available link to view all results in a new page when only a subset is retuned
- Customize the number of results returned
- Uses the MooTools or jQuery js library for AJAX and visual effects
non-ajaxSearch mode :
- Search results displayed in a new page
- customize the paginating of results
- works without JS enabled as FlexSearchForm
- designed to load only the required non-ajaxSearch code
Instructions
Follow these steps to install this snippet:
- Copy the contents of the file snippet.ajaxSearch.php into a new snippet named AjaxSearch
- Create a directory named ajaxSearch under the assets/snippets folder.
- Open the ajaxSearch.js file and set the loading & close image path to an image you want to display while the search is working.
- Copy the files from the zip to the ajaxSearch folder.
- Add the snippet call like the following: !AjaxSearch? &AS_showResults=`0` &AS_landing=`17` &showMoreResults=`1` &moreResultsPage=`17`!
- Use the styles to customize the look of your output.
- If you are using the display more results link setup a new page with the snippet call to display your results.
- Test and see the search working with AJAX!
AjaxSearch - version 1.8.0
See ajaxSearch_version_180.txt in the zip file
the wiki documentation http://wiki.modxcms.com/index.php/AjaxSearch
Demo site : http://www.modx.wangba.fr
Includes the version 1.3.0 of the plugin Highligth from Sottwell
--- NEW OPTIONS ---
whereSearch: Extend the search to Jot, maxigallery and your custom tables
extract: Define the maximum number of extracts that will be displayed
per document and define which fields will be used to set up extracts
extractEllipsis: Define your ellipsis in extract
extractSeparator: Define how separate extracts
order: Define in which order are sorted the displayed search results
rank: Define the ranking of search results
formatDate: Define the format of displayed dates
hideLink: Search in content of type reference
filter: Exclude unwanted documents of the search
tvPhx: Set placeHolders for TV (template variables)
breadcrumbs: Display the path of documents found
searchWordList: Choose your search term from a predefined search word list
clearDefault: Clearing default text
stripInput: Define your own stripInput user function to use
stripOutput: Define your own stripOutput user function to use
Warning:
searchStyle is now deprecated.
The relevance mode definitively dropped out
stripHtml, stripSnip, stripSnippets are now deprecated
Use your own stripInput and stripOutput user functions.
Documentation:
A documentation folder is provided with the snippet
It contains, some config files and templates files as examples
These files are used by the demo on the demo site www.modx.wangba.fr
You could find also a tutorial to to define search in your own tables
-- CHANGE REQUESTS IMPLEMENTED --
- Extend the search to others tables
Until now AjaxSearch was limited to do the search into the documents ("site_content" table)
and partially into TVs linked to the document ("tmplvar_contentvalues" table).
With the 1.8 version you could now define where to do the search (in which tables)
- Improvement of the extract algorithm
Extracts are now merged if needed to avoid to have an extract per search term.
You can define the number of sub-extracts you want also.
- Extended place holder templating and template parameters
- Use of &advSearch parameter available from the front-end by the end user
- Configuration file and $__ global parameters
- Highligthing plugins
the Highlighting plugin takes now into account of &advSearch parameter.
An advanced Highlighting plugin is provided. You could enclose as many areas as you want.
-- ISSUES CORRECTED --
Search in TVs
And is there any way to return a defined TV as part of the search result?
If you are searching for text in more than one TVs, it can't find the correct entries.
TV1="hi"
TV2="huhu"
search for "hi huhu", you get "nothing found".
http://modxcms.com/forums/index.php/topic,5357.msg143876.html#msg143876
Quoted searchstring
The use of a quote in the search terms makes an error
http://modxcms.com/forums/index.php/topic,5357.msg156763.html#msg156763
urlDecode and htmlentities
The use of a quote in the search terms disable the search terms highlithing
http://modxcms.com/forums/index.php/topic,5357.msg154038.html#msg154038
tag not filtered in strip MODx tags function
http://modxcms.com/forums/index.php/topic,5357.msg136667.html#msg136667
Search doesn't take into account of parameters : parents, documents, hidden, searchable
When a search is done with several search terms with the mode &advSearch = 'oneword',
the search doesn't take into account of parameters : parents, documents, hidden, searchable, published.
AjaxSearch validated in Strict 1.0 (except for the opacity parameter)
http://modxcms.com/forums/index.php/topic,26288.0.html
Doc parsing will result in error when search term contains slashes
Please add / quoting in preg_quote call on line 68. Otherwise doc parsing will result
in ModX error when search term contains slashes.
http://modxcms.com/forums/index.php/topic,1237.msg159062.html#msg159062
Highlighting plugin
Error when highlighting a search term which contains '/'
When attempting to highlight a search term which contains '/' the plugin fails due missing quoting of '/'.
This results in ModX error.
http://svn.modxcms.com/jira/browse/ADDON-2
1.7.1
Votes: 56
Tags: Search, plugin, snippet, ajax, chunk, highlighting
Submitted: Mar 7, 2008
Released: Jun 16, 2009
Downloads: 2040
License: GPL - GNU Public
Package Website
AjaxSearch 1.7.1
Works with the following Version(s): 0.9.6
AjaxSearch allows your site visitors to search your site without leaving the page they are on. The results are returned via an ajax request and loaded into the results box below the search form.
Download
- repo-1907.zip (2040 downloads)
Description
This snippet creates a search box and the results form. The search results are loaded right in the page for the user. If the user does not have javascript, the snippet will use the default searching of the FlexSearchForm snippet. A search term highlighting plugin has been included as well.
The search could be limited to a subset of documents with the use of parents or documents parameters.
You could use AjaxSearch with your own custom tables.
If the user does not have javascript enabled they can still search your site. In this case the search results are returned in a new page.
You can also include search term highlighting that is carried through to the linked page.
It could works in two modes:
ajaxSearch mode :
- Search results displayed in current page through AJAX request
- Multiple search options including live search and non-AJAX option
- Available link to view all results in a new page when only a subset is retuned
- Customize the number of results returned
- Uses the MooTools or jQuery js library for AJAX and visual effects
non-ajaxSearch mode :
- Search results displayed in a new page
- customize the paginating of results
- works without JS enabled as FlexSearchForm
- designed to load only the required non-ajaxSearch code
Instructions
Follow these steps to install this snippet:
- Copy the contents of the file snippet.ajaxSearch.php into a new snippet named AjaxSearch
- Create a directory named ajaxSearch under the assets/snippets folder.
- Open the ajaxSearch.js file and set the loading & close image path to an image you want to display while the search is working.
- Copy the files from the zip to the ajaxSearch folder.
- Add the snippet call like the following: !AjaxSearch? &AS_showResults=`0` &AS_landing=`17` &showMoreResults=`1` &moreResultsPage=`17`!
- Use the styles to customize the look of your output.
- If you are using the display more results link setup a new page with the snippet call to display your results.
- Test and see the search working with AJAX!
See ajaxSearch_version_1.7.1.txt in the zip file
the wiki documentation http://wiki.modxcms.com/index.php/AjaxSearch
Demo site : http://www.modx.wangba.fr
Includes the version 1.2.1 of the plugin Highligth from Sottwell
--- NEW OPTIONS ---
CAUTION: &useAllWords is now deprecated and replace by &advSearch = "allwords"
&advSearch 'exactphrase' | 'allwords' | 'nowords' | 'oneword'
Advanced search:
- exactphrase : provides the documents which contain the exact phrase
- allwords : provides the documents which contain all the words
- nowords : provides the documents which do not contain the words
- oneword : provides the document which contain at least one word default
&hideMenu 0 | 1 | 2
Search in hidden documents from menu
- 0 : search only in documents visible from menu
- 1 : search only in documents hidden from menu
- 2 : search in hidden or visible documents from menu default
-- CHANGE REQUESTS IMPLEMENTED --
- search in hidden documents from menu
http://modxcms.com/forums/index.php/topic,5357.msg144232.html#msg144232
Documents flaged with hidden should only be shown in the result list, if the user wants to.
- advanced search
The following search are now allowed:
* exactphrase : the exact phrase is used as searchstring
* allwords : search the documents which contains all the search terms
* oneword : search the documents which contains at least one word
* nowords : search the documents which do not contain the words
-- ISSUES CORRECTED --
http://modxcms.com/forums/index.php/topic,5357.msg139525.html#msg139525
Extract with a % percent character freeze the display of the results output
Unuseless usage of the decodeURIComponent function in js/ajaxSearch.js (line 162)
Correction of search with searchStyle = "relevance"
Do a full text search in pagetitle, description and content fields. Use LIKE for others fields
FULLTEXT indexes exists only for `pagetitle`,`description`,`content`
1.7.0.2
Votes: 57
Tags: Search, plugin, snippet, ajax, chunk, highlighting
Submitted: Jan 9, 2008
Released: Jun 16, 2009
Downloads: 1468
License: GPL - GNU Public
Package Website
AjaxSearch 1.7.0.2
Works with the following Version(s): 0.9.6
AjaxSearch allows your site visitors to search your site without leaving the page they are on. The results are returned via an ajax request and loaded into the results box below the search form.
Download
- repo-1801.zip (1468 downloads)
Description
This snippet creates a search box and the results form. The search results are loaded right in the page for the user. If the user does not have javascript, the snippet will use the default searching of the FlexSearchForm snippet. A search term highlighting plugin has been included as well.
The search could be limited to a subset of documents with the use of parents or documents parameters.
You could use AjaxSearch with your own custom tables.
If the user does not have javascript enabled they can still search your site. In this case the search results are returned in a new page.
You can also include search term highlighting that is carried through to the linked page.
It could works in two modes:
ajaxSearch mode :
- Search results displayed in current page through AJAX request
- Multiple search options including live search and non-AJAX option
- Available link to view all results in a new page when only a subset is retuned
- Customize the number of results returned
- Uses the MooTools or jQuery js library for AJAX and visual effects
non-ajaxSearch mode :
- Search results displayed in a new page
- customize the paginating of results
- works without JS enabled as FlexSearchForm
- designed to load only the required non-ajaxSearch code
Instructions
Follow these steps to install this snippet:
- Copy the contents of the file snippet.ajaxSearch.php into a new snippet named AjaxSearch
- Create a directory named ajaxSearch under the assets/snippets folder.
- Open the ajaxSearch.js file and set the loading & close image path to an image you want to display while the search is working.
- Copy the files from the zip to the ajaxSearch folder.
- Add the snippet call like the following: !AjaxSearch? &AS_showResults=`0` &AS_landing=`17` &showMoreResults=`1` &moreResultsPage=`17`!
- Use the styles to customize the look of your output.
- If you are using the display more results link setup a new page with the snippet call to display your results.
- Test and see the search working with AJAX!
See ajaxSearch_version_17.txt in the zip file
and the wiki documentation http://wiki.modxcms.com/index.php/AjaxSearch
Includes the version 1.2.0.2 of the plugin Highligth from Sottwell
Important installation note : the snippet folder has been renamed ajaxSearch. The 1.6 name was AjaxSearch. So you need to create a new directory.
--- NEW OPTIONS ---
&parents comma-separated list of integers MODx document IDs (optional)
A list of parent-documents whose descendants you want searched to &depth
depth when searching. All parent-documents by default
&depth int (optional)
Number of levels deep to go.
Any number greater than or equal to 1. All levels by default
&documents comma-separated list of integers MODx document IDs (optional)
A list of documents where to search
&extractLength int (optional)
Length of extract around the search words found
between 50 and 800 characters. 200 by default
&opacity float value between 0. and 1. (optional)
Opacity of the ajaxSearch_output div where are returned the ajax results.
DÈfault is 1. Float value between 0. (transparent) and 1. (opaque)
&useAllWords 1 | 0 (optional)
If you want only documents which contain ALL words in the search string, set to true
Otherwise, the search will return all pages with ONE or more of the search words. Default 0 (False))
&config config_name | "default" (optional)
Load a custom configuration
config_name - Other configs installed in the configs folder or in any folder within the MODx base path via @FILE
Configuration files are named in the form: .config.php
-- CHANGE REQUESTS IMPLEMENTED --
- Searching for words containing characters like "Â,‰,ˆ,?,ƒ,÷".
- Take into account of non utf8 database (latin1, latin2, ..)
- Management of the opacity with IE (+FF, Opera)
- Add a selection of documents where to search
- Add a config file for default parameters
- Strip html tags in title, long title and description output results
-- ISSUES CORRECTED --
http://modxcms.com/forums/index.php/topic,20128.msg125501.html#msg125501
With an utf8 database connection charset, the php_mbstring extension is required
http://modxcms.com/forums/index.php/topic,5357.msg128813.html#msg128813
$database_connection_charset variable undefined
http://modxcms.com/forums/index.php/topic,19755.msg130245.html#msg130245
Javascript variables initialisation appears twice in the html code source
http://modxcms.com/forums/index.php/topic,21047.msg131003.html#msg131003
The strip html tags works only for the first page found
- Security patch :
http://modxcms.com/forums/index.php/topic,5357.msg131495.html#msg131495
- memory fault when ListIDs='' and depth hight
http://modxcms.com/forums/index.php/topic,5357.msg125737.html#msg125737
http://modxcms.com/forums/index.php/topic,5357.msg126745.html#msg126745
http://modxcms.com/forums/index.php/topic,21047.msg131559.html#msg131559
- The searchword highlighted is not in the middle of the extract
1.6
Votes: 59
Tags: Search, plugin, snippet, ajax, chunk, highlighting
Submitted: Apr 28, 2007
Released: Jun 16, 2009
Downloads: 2659
License: GPL - GNU Public
Package Website
AjaxSearch 1.6
Works with the following Version(s): 0.9.1 | 0.9.2 | 0.9.2.1 | 0.9.2.2 | 0.9.5
AjaxSearch allows your site visitors to search your site without leaving the page they are on. The results are returned via an ajax request and loaded into the results box below the search form.
Download
- repo-1458.zip (2659 downloads)
Description
This snippet creates a search box and the results form. The search results are loaded right in the page for the user. If the user does not have javascript, the snippet will use the default searching of the FlexSearchForm snippet. A search term highlighting plugin has been included as well.
The search could be limited to a subset of documents with the use of parents or documents parameters.
You could use AjaxSearch with your own custom tables.
If the user does not have javascript enabled they can still search your site. In this case the search results are returned in a new page.
You can also include search term highlighting that is carried through to the linked page.
It could works in two modes:
ajaxSearch mode :
- Search results displayed in current page through AJAX request
- Multiple search options including live search and non-AJAX option
- Available link to view all results in a new page when only a subset is retuned
- Customize the number of results returned
- Uses the MooTools or jQuery js library for AJAX and visual effects
non-ajaxSearch mode :
- Search results displayed in a new page
- customize the paginating of results
- works without JS enabled as FlexSearchForm
- designed to load only the required non-ajaxSearch code
Instructions
Follow these steps to install this snippet:
- Copy the contents of the file snippet-ajaxSearch-tpl.php into a new snippet named AjaxSearch
- Create a directory named AjaxSearch under the assets/snippets folder.
- Open the AjaxSearch.js file and set the loading & close image path to an image you want to display while the search is working.
- Copy the files from the zip to the AjaxSearch folder.
- Add the snippet call like the following: !AjaxSearch? &AS_showResults=`0` &AS_landing=`17` &showMoreResults=`1` &moreResultsPage=`17`!
- Use the styles to customize the look of your output.
- If you are using the display more results link setup a new page with the snippet call to display your results.
- Test and see the search working with AJAX!
1.0
Votes: 58
Tags: Search, plugin, snippet, ajax, chunk, highlighting
Submitted: Jun 23, 2006
Released: Jun 16, 2009
Downloads: 4014
License: GPL - GNU Public
Package Website
AjaxSearch 1.0
Works with the following Version(s): 0.9.1 | 0.9.2 | 0.9.2.1
AjaxSearch allows your site visitors to search your site without leaving the page they are on. The results are returned via an ajax request and loaded into the results box below the search form.
Download
- repo-492.zip (4014 downloads)
Description
This snippet creates a search box and the results form. The search results are loaded right in the page for the user. If the user does not have javascript, the snippet will use the default searching of the FlexSearchForm snippet. A search term highlighting plugin has been included as well.
The search could be limited to a subset of documents with the use of parents or documents parameters.
You could use AjaxSearch with your own custom tables.
If the user does not have javascript enabled they can still search your site. In this case the search results are returned in a new page.
You can also include search term highlighting that is carried through to the linked page.
It could works in two modes:
ajaxSearch mode :
- Search results displayed in current page through AJAX request
- Multiple search options including live search and non-AJAX option
- Available link to view all results in a new page when only a subset is retuned
- Customize the number of results returned
- Uses the MooTools or jQuery js library for AJAX and visual effects
non-ajaxSearch mode :
- Search results displayed in a new page
- customize the paginating of results
- works without JS enabled as FlexSearchForm
- designed to load only the required non-ajaxSearch code
Instructions
Follow these steps to install this snippet:
- Copy the index-ajax.php to the root-level of your MODx installation.
- Copy the contents of the file snippet-ajaxSearch-tpl.php into a new snippet named AjaxSearch
- Create a directory named AjaxSearch under the assets/snippets folder.
- Open the AjaxSearch.js file and set the loading & close image path to an image you want to display while the search is working.
- Copy the following files and the loading/closing images as appropriate into the AjaxSearch folder. AjaxSearch.js, AjaxSearch.php, AjaxSearch.inc.php
- Add the snippet call like the following: !AjaxSearch? &AS_showResults=`0` &AS_landing=`17` &showMoreResults=`1` &moreResultsPage=`17`!
- Use the styles to customize the look of your output.
- If you are using the display more results link setup a new page with the snippet call to display your results.
- Test and see the search working with AJAX!

Please login to comment.