Commit Graph

1 Commits

Author SHA1 Message Date
Ralf Becker
15ca7e90ed eGW wide index over all applications (superindex)
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.
2008-03-08 21:51:12 +00:00