class FullTextSearch (View source)

Base class to manage active search indexes.

Properties

protected static $all_indexes
protected static $indexes_by_subclass

Methods

public static 
get_indexes(string $class = null, bool $rebuild = false)

Get all the instantiable search indexes (so all the user created indexes, but not the connector or library level abstract indexes). Can optionally be filtered to only return indexes that are subclasses of some class

public static 
force_index_list()

Sometimes, like when in tests, you want to restrain the actual indexes to a subset

Details

static get_indexes(string $class = null, bool $rebuild = false)

Get all the instantiable search indexes (so all the user created indexes, but not the connector or library level abstract indexes). Can optionally be filtered to only return indexes that are subclasses of some class

Parameters

string $class
  • Class name to filter indexes by, so that all returned indexes are subclasses of provided class
bool $rebuild
  • If true, don't use cached values

static force_index_list()

Sometimes, like when in tests, you want to restrain the actual indexes to a subset

Call with one argument - an array of class names, index instances or classname => indexinstance pairs (can be mixed). Alternatively call with multiple arguments, each of which is a class name or index instance

From then on, fulltext search system will only see those indexes passed in this most recent call.

Passing in no arguments resets back to automatic index list

Alternatively you can use FullTextSearch.indexes to configure a list of indexes via config.