Loading...
 
Skip to main content

Search Details

Click the Search icon Search button. on the Admin Panel to display the Search Administration screen. Use this screen to configure how users will search your Tiki.

Search modes

The search can be configured by the administrator as a (a) full text search or as a (b) simple search. If you enable full-text search, your results will be ordered according to their relevance to the search terms. In a similar way, a user knows it is a full text search because each result has a relevance indicator.

The Full-text Search is based on the MySQL full-text search (http://www.mysql.com/doc/en/Fulltext_Search.html) functionality. Therefore, the fulltext feature performs best with MySQL. It may not work properly with other databases. The performance of the database search is also dependent on your database release. Refer to your database documentation to find ways to improve performance.

  • The fulltext indexation and the database search indexation is updated by the database itself in real time.
  • If you do not activate the fullsearch feature, it will do an "OR" between the searched words.
  • If you use the fullsearch feature, it will do a database full search. For each type of objects (wiki, article... ) the max number (set in admin->general) will be searched. After all the results will be sorted on the relevance. Be careful that you can see a results in an object type that is not so relevant that an object in another type you do not see in the page.
Image

If you are using the database search and if you do not have either category permissions or object permissions, you can check one of the boxes shown above to speed up the search

Some restrictions apply:

  • It works only on single-byte characters.
  • Only on words with at least 4 characters. Or 3 characters if mysql has been set with ft_min_word_len=3 in my.cnf.
    • Warning! After changing my.cnf you must rebuild all full-text indexes. One way to do this is to dump your database to a file, create a new database, and import the dumped file. See userpagedaaave for an example. — UserPageterris
  • Words should be part of the mysql search stopword list (https://dev.mysql.com/doc/refman/5.7/en/fulltext-stopwords.html)


The search is performed in case-insensitive fashion.

The query is split into words: a word is a sequence of alphanumeric characters and "_" characters. Some words are eliminated — those from a stop list and those too short. The stop list is hard-coded in the MySQL code.

The results are sorted with highest relevance first. Relevance is computed based on the number of words in the object, the number of unique words in that object, the total number of words in the collection, and the number of objects that contain a particular word. This way, a word that is present in many documents will have lower weight (and may even have a zero weight), because it has lower semantic value in this particular collection

It is also possible to perform a boolean mode search:

  • + : A leading plus sign indicates that this word must be present in every object returned.
  • - : A leading minus sign indicates that this word must not be present in any row returned.
  • By default (when neither plus nor minus is specified) the word is optional, but the object that contain it will be rated higher.
  • < > : These two operators are used to change a word's contribution to the relevance value that is assigned to a row.
  • ( ) : Parentheses are used to group words into subexpressions.
  • ~ : A leading tilde acts as a negation operator, causing the word's contribution to the object relevance to be negative. It's useful for marking noise words. An object that contains such a word will be rated lower than others, but will not be excluded altogether, as it would be with the - operator.
  • * : An asterisk is the truncation operator. Unlike the other operators, it should be appended to the word, not prepended.
  • " : The phrase, that is enclosed in double quotes ", matches only objects that contain this phrase literally, as it was typed.

If the administrator has not activated the "full-text" feature, the search is done in a very simple way.
Each query is split into words (a word is recognized as delimited by space). An object will be returned only if it contains each string word.
Example: If the query is "full text", only the object that contains "full" and that contains "text" will be returned.
Be careful that it is not "contains the word" but contains the string; it means that an object with "fulltext" will be returned, as an object with "faithfully textual" or "carefull texture".
Be also careful that an object has some hidden text like the links. So, an object that contains "http://fulltext/|Mysite" is selected.
The search is performed in case-insensitive fashion. It means that if you look for "tiki", you will find objects than contain the word "Tiki" and not "tiki".

Advantages:

  • quick
  • pick up everything that is indexed (see the section describing the search space)

Disadvantages:

  • The search is very noisy: a lot of objects are returned
  • There is no relevance and the objects are not sorted. It means that an object with 2 occurrences of the searched word will be returned as an object with only 1 occurrence.
  • the word is exactly searched, it means "cliche" will not find "cliché"


In this simple search mode, the tiki indexation is updated by tiki. Each access to Tikiwiki runs an indexation of a random object.
It is possible not to refresh the indexation at each access to the site by setting the search refresh rate in admin->search to 0 . In this case, if you want to use the tiki search, the indexation must be handled outside in a cron for instance. See an example of recomplete reindexation in doc/devtools/batch_refresh_indexes_tikisearch.php . This script must be moved to the tiki root to work.

See Search Admin to see the description of Search settings.

Word highlighting from referrals

In v1.9 there is an experimental feature that automatically highlights search words when one follows a link from a search engine. Fore more information, please see Referrer Search Highlighting.

Try it out

Related pages