Coding with SPIP 3.0
SPIP3.0 Technical Documentation

> > > > rechercher_liste_des_champs

rechercher_liste_des_champs

This pipeline specifies the fields to be considered when a search is performed on a given table.

It manipulates a 2-dimensional associative array composed like this:

  • the first key is the name of a SPIP object (article, rubrique...).
  • the other key is the name of a field (titre, texte...) to take into account for the search.
  • the value is the weighting coefficient: the higher this value is, the more points are attributed to a result found in the corresponding field.

Example

  1. function prefixPlugin_rechercher_liste_des_champs($tables){
  2. // add a field 'town' to the articles
  3. $tables['article']['town'] = 3;
  4. // hide a field from the search process
  5. unset($tables['rubrique']['descriptif']);
  6. return $tables;
  7. }

Download