Downloads » Resources » AjaxSearch

AjaxSearch

  • Currently 4.675/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Votes: 40

AjaxSearch 1.8.1

AjaxSearch - version 1.8.1b

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

Works with MODx Version(s): 0.9.6
Submitted: Oct 13th 2008 | License: GPL - GNU Public | Downloads: 524

Resource Image 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.

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.

Note: This code runs with the mootools librairy, provided with MODx.
  • This code is based off of the FlexSearchForm snippet created by jaredc.
  • The javascript code is based off of the example by Steve Smith of orderedlist.com.
  • The search highlighting plugin is modified from Susan Ottwell's (http://www.sottwell.com) original 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!

Previous Releases

AjaxSearch 1.8.0


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

Works with MODx Version(s): 0.9.6
Submitted: Jul 24th 2008 | License: GPL - GNU Public | Downloads: 1018

AjaxSearch 1.7.1

AjaxSearch - version 1.7.1

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`

Works with MODx Version(s): 0.9.6
Submitted: Mar 7th 2008 | License: GPL - GNU Public | Downloads: 1796

AjaxSearch 1.7.0.2

AjaxSearch - version 1.7.0.2

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_name>.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

Works with MODx Version(s): 0.9.6
Submitted: Jan 9th 2008 | License: GPL - GNU Public | Downloads: 1340

AjaxSearch 1.6

Switch to MooTools, Templating support, Language Support, Numerous bugfixes.

Works with MODx Version(s): 0.9.5, 0.9.2.2, 0.9.2.1, 0.9.2, 0.9.1
Submitted: Apr 28th 2007 | License: GPL - GNU Public | Downloads: 2483

AjaxSearch 1.0

Initial Release

Works with MODx Version(s): 0.9.2.1, 0.9.2, 0.9.1
Submitted: Jun 23rd 2006 | License: GPL - GNU Public | Downloads: 3856


Extras

No results found.


( back to top )