IndexedSearch.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 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 
16 
17 /**
18  * IndexedSearch implementations are used to search entity objects
19  * in a search index
20  *
21  * @author ingo herwig <ingo@wemove.com>
22  */
23 interface IndexedSearch extends Search {
24 
25  /**
26  * Reset the search index.
27  */
28  public function resetIndex();
29 
30  /**
31  * Add/update a PersistentObject instance to/in the search index. This method modifies the
32  * index. For that reason IndexedSearch::commitIndex() should be called afterwards.
33  * @param $obj The PersistentObject instance.
34  */
35  public function addToIndex(PersistentObject $obj);
36 
37  /**
38  * Delete a PersistentObject instance from the search index. This method modifies the
39  * index. For that reason IndexedSearch::commitIndex() should be called afterwards.
40  * @param $oid The ObjectId of the PersistentObject instance.
41  */
42  public function deleteFromIndex(ObjectId $oid);
43 
44  /**
45  * Commit changes made on the index.
46  * @note This method only commits the index if changes were made using the methods mentioned above.
47  * @param $optimize Boolean whether the index should be optimized after commit (default: _true_).
48  */
49  public function commitIndex($optimize = true);
50 
51  /**
52  * Optimize the index
53  */
54  public function optimizeIndex();
55 }
56 ?>
optimizeIndex()
Optimize the index.
resetIndex()
Reset the search index.
IndexedSearch implementations are used to search entity objects in a search index.
Search implementations are used to search entity objects.
Definition: Search.php:21
ObjectId is the unique identifier of an object.
Definition: ObjectId.php:28
deleteFromIndex(ObjectId $oid)
Delete a PersistentObject instance from the search index.
addToIndex(PersistentObject $obj)
Add/update a PersistentObject instance to/in the search index.
Search related interfaces and classes.
Definition: namespaces.php:78
PersistentObject defines the interface of all persistent objects.
commitIndex($optimize=true)
Commit changes made on the index.