PHP Class Sleimanx2\Plastic\DSL\SuggestionBuilder

Show file Open project: sleimanx2/plastic

Public Properties

Property Type Description
$index string The elastic index to query against.
$query ONGR\ElasticsearchDSL\Search An instance of DSL query.

Public Methods

Method Description
__construct ( Connection $connection, ONGR\ElasticsearchDSL\Search $query = null ) Builder constructor.
append ( $suggestion ) Append a suggestion to query.
completion ( $name, $text, array $parameters = [] ) Add a completion suggestion.
get ( ) : array Execute the suggest query against elastic and return the raw result if model not set.
getConnection ( ) : Connection Returns the connection instance.
getIndex ( ) : string Return the current elastic index.
index ( string $index ) Set the elastic index to query against.
term ( string $name, string $text, array $parameters = [] ) Add a term suggestion.
toDSL ( ) : array Return the DSL query.

Method Details

__construct() public method

Builder constructor.
public __construct ( Connection $connection, ONGR\ElasticsearchDSL\Search $query = null )
$connection Sleimanx2\Plastic\Connection
$query ONGR\ElasticsearchDSL\Search

append() public method

Append a suggestion to query.
public append ( $suggestion )
$suggestion

completion() public method

Add a completion suggestion.
public completion ( $name, $text, array $parameters = [] )
$name
$text
$parameters array

get() public method

Execute the suggest query against elastic and return the raw result if model not set.
public get ( ) : array
return array

getConnection() public method

Returns the connection instance.
public getConnection ( ) : Connection
return Sleimanx2\Plastic\Connection

getIndex() public method

Return the current elastic index.
public getIndex ( ) : string
return string

index() public method

Set the elastic index to query against.
public index ( string $index )
$index string

term() public method

Add a term suggestion.
public term ( string $name, string $text, array $parameters = [] )
$name string
$text string
$parameters array

toDSL() public method

Return the DSL query.
public toDSL ( ) : array
return array

Property Details

$index public property

The elastic index to query against.
public string $index
return string

$query public property

An instance of DSL query.
public Search,ONGR\ElasticsearchDSL $query
return ONGR\ElasticsearchDSL\Search