This index allows a fulltext search over all applications (or of
cause also a single app).
Whenever an applications stores an entry it calls:
boolean egw_index::save($app,$id,$owner,array $fields,array $cat_id=null)
which calls, as the application do when is deletes an entry (!),
boolean egw_index::delete($app,$id)
and then splits all fields into keywords and add these to the index by
boolean private egw_index::add($app,$id,$keyword).
Applications can then use the index to search for a given keyword
(and optional application):
array egw_index::search($keyword,$app=null) or
foreach(new egw_index($keyword,$app=null) as $app_id => $title)
To also allow to search by a category or keyword part of it, the index
also tracks the categories of the entries. Applications can choose to
only use it for category storage, or cat do it redundant in there own
table too. To retrieve the categories of one or multiple entries:
array egw_index::cats($app,$ids)
Applications can use a sql (sub-)query to get the id's of there app
matching a certain keyword and include that in there own queries:
string egw_index::sql_ids_by_keyword($app,$keyword)
Please note: the index knows nothing about ACL, so it's the task of
the application to ensure ACL rights.