Documentation

pm_SearchIndex
in package

Global search index and presentation

Tags
since
17.8

Table of Contents

$data  : mixed
The data of the item.
__construct()  : mixed
Creates an item of search index with the provided data.
getBoost()  : float
Returns a boost of the search result.
getData()  : mixed
Returns the data of the item.
getDescription()  : string
Returns a description (tooltip) for the search result.
getIcon()  : string
Returns an icon (32x32px) for the search result.
getIndexedFields()  : array<string|int, array<string|int, mixed>>|array<string|int, string>|string
Returns a set of fields to be used in full-text index.
getLink()  : string
Returns a link for the search result
getTitle()  : string
Returns a title for the search result
isVisible()  : bool
Finds whether the search result should be visible to the current user.

Properties

$data

The data of the item.

protected mixed $data

Serialized and stored by the search engine.

Methods

__construct()

Creates an item of search index with the provided data.

public __construct([mixed $data = null ]) : mixed

Only scalar types are allowed in the data. Use assoc arrays for multiple fields.

Parameters
$data : mixed = null
Return values
mixed

getBoost()

Returns a boost of the search result.

public getBoost() : float
Return values
float

getData()

Returns the data of the item.

public final getData() : mixed

Usage of the data is preferred than fetching from external resources.

Return values
mixed

getDescription()

Returns a description (tooltip) for the search result.

public getDescription() : string
Return values
string

getIcon()

Returns an icon (32x32px) for the search result.

public getIcon() : string
Return values
string

getIndexedFields()

Returns a set of fields to be used in full-text index.

public abstract getIndexedFields() : array<string|int, array<string|int, mixed>>|array<string|int, string>|string

Use string or array of strings for simple text index. Use the following structure for a fields with specific boost

[
     [
         'name' => 'title',
         'content' => 'some text data',
         'boost' => 0.5,
     ],
]
Return values
array<string|int, array<string|int, mixed>>|array<string|int, string>|string

Returns a link for the search result

public getLink() : string
Return values
string

getTitle()

Returns a title for the search result

public getTitle() : string
Return values
string

isVisible()

Finds whether the search result should be visible to the current user.

public isVisible() : bool
Return values
bool

Search results