Fast Search

Fast Search (FS) is a search alternative for traditional SQL search (SELECT * FROM table WHERE body LIKE '%keywords%'). FS offers much faster search result, up to 20x faster (or more, on large database).

To use this function please follow the steps:

1. Determine an identifier, eg. 'product'.

2. Get word list. Word list is an array listing all uniquely used words in an article.

$wl = filter_word ($input_text);

3. Then use update_wordmatch() function to enter the word list to database.

$fs = update_wordmatch ($article_id, $identifier, $word_list)

$article_id is the unique ID of the article, it can be page ID, news ID, or any ID. It must be integer.

$identifier = the identifier, eg 'product'

$word_list = the word list result from filter_word () function.

4. Be aware that, both filter_word & update_wordmatch functions only available in ACP (or by including includes/admin_func.php).

5. After that, you can use fast_search to search:

$foo = function fast_search ($query, $identifier, $mode = 'or')

$query = the query, eg. "My Book".

$identifier = the pre-defined identifier.

$mode = either 'AND' or 'OR'.

EG:

$foo = function fast_search ('My Book', 'product')

It will return array of $article_id relating with the search result.

Example 1

(coming soon)


: @ 07:00am
Last Updated: @ 07:00am

There is no comment. Why not be the first?

More Comments/Post Your Own

Advertisement

Online Users

There are 112 users online.

Connect

Connect with us on Facebook

Newsletter

Subscribe to our newsletter for the latest updates and exciting promotions!