IndexedSearch.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2015 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
11 namespace wcmf\lib\search;
12 
15 
16 /**
17  * IndexedSearch implementations are used to search entity objects
18  * in a search index
19  *
20  * @author ingo herwig <ingo@wemove.com>
21  */
22 interface IndexedSearch extends Search {
23 
24  /**
25  * Reset the search index.
26  */
27  public function resetIndex();
28 
29  /**
30  * Add/update a PersistentObject instance to/in the search index. This method modifies the
31  * index. For that reason IndexedSearch::commitIndex() should be called afterwards.
32  * @param $obj The PersistentObject instance.
33  */
34  public function addToIndex(PersistentObject $obj);
35 
36  /**
37  * Delete a PersistentObject instance from the search index. This method modifies the
38  * index. For that reason IndexedSearch::commitIndex() should be called afterwards.
39  * @param $obj The PersistentObject instance.
40  */
41  public function deleteFromIndex(PersistentObject $obj);
42 
43  /**
44  * Commit changes made on the index.
45  * @note This method only commits the index if changes were made using the methods mentioned above.
46  * @param $optimize Boolean whether the index should be optimized after commit (default: _true_).
47  */
48  public function commitIndex($optimize = true);
49 
50  /**
51  * Optimize the index
52  */
53  public function optimizeIndex();
54 }
55 ?>
deleteFromIndex(PersistentObject $obj)
Delete a PersistentObject instance from the search index.
Search related interfaces and classes.
Definition: namespaces.php:78
resetIndex()
Reset the search index.
addToIndex(PersistentObject $obj)
Add/update a PersistentObject instance to/in the search index.
IndexedSearch implementations are used to search entity objects in a search index.
commitIndex($optimize=true)
Commit changes made on the index.
optimizeIndex()
Optimize the index.
Search implementations are used to search entity objects.
Definition: Search.php:21
PersistentObject defines the interface of all persistent objects.