\pm_SearchIndex

Global search index and presentation

Summary

Methods
Properties
Constants
__construct()
getData()
getIndexedFields()
getTitle()
getDescription()
getIcon()
getLink()
isVisible()
getBoost()
No public properties found
No constants found
No protected methods found
$data
N/A

Properties

$data

$data : mixed

The data of the item.

Serialized and stored by the search engine.

Type

mixed

Methods

__construct()

__construct(mixed  $data = null) 

Creates an item of search index with the provided data.

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

Parameters

mixed $data

getData()

getData() : mixed

Returns the data of the item.

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

Returns

mixed

getIndexedFields()

getIndexedFields() : array<mixed,array>|array<mixed,string>|string

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

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,
     ],
]

Returns

array<mixed,array>|array<mixed,string>|string

getTitle()

getTitle() : string

Returns a title for the search result

Returns

string

getDescription()

getDescription() : string

Returns a description (tooltip) for the search result.

Returns

string

getIcon()

getIcon() : string

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

Returns

string

getLink()

getLink() : string

Returns a link for the search result

Returns

string

isVisible()

isVisible() : boolean

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

Returns

boolean

getBoost()

getBoost() : float

Returns a boost of the search result.

Returns

float