SearchProviderInterface
in
A standard interface used for describing search engine implementations.
Tags
Table of Contents
Methods
- delete() : void
- Deletes the business object provided from the search engine index.
- getNumberFound() : int
- Returns the number of matching objects found in the previous search carried out by this provider.
- getRelated() : array<string|int, mixed>
- Gets a list of documents related to the business objects matching the object provided. An array of business objects will be returned (ordered by the search engine).
- index() : void
- Adds/updates the business object provided to the search engine index.
- search() : array<string|int, mixed>
- The main search function, you should provide the user's search query as-is and pass it to the search engine. An array of business objects will be returned (ordered by the search engine).
Methods
delete()
Deletes the business object provided from the search engine index.
public
delete(ActiveRecord $sourceObject) : void
Parameters
- $sourceObject : ActiveRecord
-
The object to delete from the search index.
Tags
getNumberFound()
Returns the number of matching objects found in the previous search carried out by this provider.
public
getNumberFound() : int
Tags
Return values
intgetRelated()
Gets a list of documents related to the business objects matching the object provided. An array of business objects will be returned (ordered by the search engine).
public
getRelated(ActiveRecord $sourceObject[, string $returnType = 'all' ][, int $start = 0 ][, int $limit = 10 ][, string $distinct = '' ]) : array<string|int, mixed>
Parameters
- $sourceObject : ActiveRecord
-
The source object for comparison.
- $returnType : string = 'all'
-
Use this filter to determine that only business objects of a certain class hould be returned (default is to return all classes indexed).
- $start : int = 0
-
Start point for pagination.
- $limit : int = 10
-
The maximum amount to return in the list (for pagination).
- $distinct : string = ''
-
Related items will only be returned that have distinct values in this named field.
Tags
Return values
array<string|int, mixed>index()
Adds/updates the business object provided to the search engine index.
public
index(ActiveRecord $sourceObject) : void
Parameters
- $sourceObject : ActiveRecord
-
The object to add to the search index. The sourceObject should already be stored in the database.
Tags
search()
The main search function, you should provide the user's search query as-is and pass it to the search engine. An array of business objects will be returned (ordered by the search engine).
public
search(string $query[, string $returnType = 'all' ][, int $start = 0 ][, int $limit = 10 ][, int $createdBy = 0 ]) : array<string|int, mixed>
Parameters
- $query : string
-
The search query.
- $returnType : string = 'all'
-
Use this filter to determine that only business objects of a certain class should be returned (default is to return all classes indexed).
- $start : int = 0
-
Start point for pagination.
- $limit : int = 10
-
The maximum amount to return in the list (for pagination).
- $createdBy : int = 0
-
Optionally provide the creator ID to restrict search to Tags created by that user.