BaseSearchFactory

Base factory to build elastic search requests.

Deprecated!

since 5.0.0 will be deleted in 6.0.0

Namespace

IO\Services\ItemSearch\Factories

Properties
Type Name Description

array

$aggregations

array

$mutators

array

$filters

array

$resultFields

array

$filterInstances

array

$extensions

string

$collapseField

MultipleSorting

$sorting

RandomScore

$randomScoreModifier

int

$page

int

$itemsPerPage

string

$pluginNamespace

Methods
public inherit($searchBuilder, $inheritedProperties = []):BaseSearchFactory
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Create a new factory instance based on properties of an existing factory.

Parameters

Type

Name

Description

BaseSearchFactory

$searchBuilder

The search factory to inherit properties from.

array

$inheritedProperties

List of properties to inherit or null to inherit all properties.

public withMutator($mutator):Factories
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Add a mutator

Parameters

Type

Name

Description

MutatorInterface

$mutator

public createFilter($filterClass):TypeInterface
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Add a filter. Will create a new instance of the filter class if not already created.

Parameters

Type

Name

Description

string

$filterClass

public withFilter($filter):Factories
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Add a filter. Will override existing filter instances.

Parameters

Type

Name

Description

TypeInterface

$filter

public withResultFields($fields):BaseSearchFactory
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Set fields to be contained in search result.

Parameters

Type

Name

Description

string | array

$fields

Reference to a json file to load fields from or a list of field names.

public getResultFields():array
Deprecated!

since 5.0.0 will be deleted in 6.0.0

public withExtension($extensionClass, $extensionParams = []):Factories
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Add an extension.

Parameters

Type

Name

Description

string

$extensionClass

Extension class to add.

array

$extensionParams

Additional parameters to pass to extensions constructor

public getExtensions():array
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Get all registered extensions

public withAggregation($aggregation):Factories
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Add an aggregation

Parameters

Type

Name

Description

AggregationInterface

$aggregation

public setPage($page, $itemsPerPage):Factories
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Set pagination parameters.

Parameters

Type

Name

Description

int

$page

int

$itemsPerPage

public sortBy($field, $order = \Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory::SORTING_ORDER_DESC):Factories
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Add sorting parameters

Parameters

Type

Name

Description

string

$field

The field to order by

string

$order

Direction to order results. Possible values: 'asc' or 'desc'

public sortByMultiple($sortingList):Factories
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Add multiple sorting parameters

Parameters

Type

Name

Description

array

$sortingList

List of sorting parameters. Each entry should have a 'field' and an 'order' property.

public setOrder($idList):Factories
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Parameters

Type

Name

Description

array

$idList

public groupBy($field):Factories
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Group results by field

Parameters

Type

Name

Description

string

$field

The field to group properties by.

public build():DocumentSearch
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Build the elastic search request.

public prepareSearch($source):DocumentSearch
Deprecated!

since 5.0.0 will be deleted in 6.0.0

Build the search instance itself. May be overridden by concrete factories.

Parameters

Type

Name

Description

IncludeSource

$source