PHP Класс Sleimanx2\Plastic\DSL\SearchBuilder

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$index string The elastic index to query against.
$query ONGR\ElasticsearchDSL\Search An instance of DSL query.
$type string The elastic type to query against.

Защищенные свойства (Protected)

Свойство Тип Описание
$boolState string Query bool state.
$connection Sleimanx2\Plastic\Connection An instance of plastic Connection.
$filtering boolean Query filtering state.
$model Illuminate\Database\Eloquent\Model The model to use when querying elastic search.
$modelFiller Sleimanx2\Plastic\Fillers\FillerInterface The model filler to use after retrieving the results.

Открытые методы

Метод Описание
__construct ( Connection $connection, ONGR\ElasticsearchDSL\Search $grammar = null ) Builder constructor.
aggregate ( Closure $closure ) Add aggregation.
append ( $query ) Append a query.
commonTerm ( $field, $term, array $attributes = [] ) Add a common term query.
exists ( string | array $fields ) Add an exists query.
filter ( ) Switch to a filter query.
from ( integer $offset ) Set the query from/offset value.
fuzzy ( $field, $term, array $attributes = [] ) Add a fuzzy query.
geoBoundingBox ( string $field, array $values, array $parameters = [] ) Add a geo bounding box query.
geoDistance ( string $field, string $distance, mixed $location, array $attributes = [] ) Add a geo distance query.
geoDistanceRange ( string $field, $from, $to, array $location, array $attributes = [] ) Add a geo distance range query.
geoHash ( string $field, mixed $location, array $attributes = [] ) Add a geo hash query.
geoPolygon ( string $field, array $points = [], array $attributes = [] ) Add a geo polygon query.
get ( ) : PlasticResult Execute the search query against elastic and return the raw result if the model is not set.
getBoolState ( ) : string Return the boolean query state.
getConnection ( ) : Connection Return the current plastic connection.
getFilteringState ( ) : string Return the filtering state.
getIndex ( ) : string Return the current elastic index.
getModelFiller ( ) : Sleimanx2\Plastic\Fillers\FillerInterface get the model filler to use after retrieving the results.
getRaw ( ) : array Execute the search query against elastic and return the raw result.
getType ( ) : string Return the current elastic type.
ids ( array | string $ids ) Add an ids query.
index ( string $index ) Set the elastic index to query against.
match ( string $field, string $term, array $attributes = [] ) Add a match query.
matchAll ( float | null $boost = 1 ) Add a boost query.
minScore ( $score ) Set the query min score value.
model ( Model $model ) Set the eloquent model to use when querying elastic search.
multiMatch ( array $fields, string $term, array $attributes = [] ) Add a multi match query.
must ( ) Switch to a must statement.
mustNot ( ) Switch to a must not statement.
nested ( $field, Closure $closure, string $score_mode = 'avg' ) Add a nested query.
paginate ( integer $limit = 25 ) : PlasticPaginator Paginate result hits.
prefix ( string $field, string $term, array $attributes = [] ) Add a prefix query.
query ( ) Switch to a regular query.
queryString ( string $query, array $attributes = [] ) Add a query string query.
range ( string $field, array $attributes = [] ) Add a range query.
regexp ( string $field, $regex, array $attributes = [] ) Add a regexp query.
setModelFiller ( Sleimanx2\Plastic\Fillers\FillerInterface $filler ) Set the model filler to use after retrieving the results.
should ( ) Switch to a should statement.
simpleQueryString ( string $query, array $attributes = [] ) Add a simple query string query.
size ( integer $limit ) Set the query limit/size value.
sortBy ( string | array $fields, null $order = null, array $parameters = [] ) Set the query sort values values.
term ( string $field, string $term, array $attributes = [] ) Add an term query.
terms ( string $field, array $terms, array $attributes = [] ) Add an terms query.
toDSL ( ) : array Return the DSL query.
type ( string $type ) Set the elastic type to query against.
wildcard ( string $field, string $value, float $boost = 1 ) Add a wildcard query.

Защищенные методы

Метод Описание
getCurrentPage ( ) : integer return the current query string value.

Описание методов

__construct() публичный Метод

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

aggregate() публичный Метод

Add aggregation.
public aggregate ( Closure $closure )
$closure Closure

append() публичный Метод

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

commonTerm() публичный Метод

Add a common term query.
public commonTerm ( $field, $term, array $attributes = [] )
$field
$term
$attributes array

exists() публичный Метод

Add an exists query.
public exists ( string | array $fields )
$fields string | array

filter() публичный Метод

Switch to a filter query.
public filter ( )

from() публичный Метод

Set the query from/offset value.
public from ( integer $offset )
$offset integer

fuzzy() публичный Метод

Add a fuzzy query.
public fuzzy ( $field, $term, array $attributes = [] )
$field
$term
$attributes array

geoBoundingBox() публичный Метод

Add a geo bounding box query.
public geoBoundingBox ( string $field, array $values, array $parameters = [] )
$field string
$values array
$parameters array

geoDistance() публичный Метод

Add a geo distance query.
public geoDistance ( string $field, string $distance, mixed $location, array $attributes = [] )
$field string
$distance string
$location mixed
$attributes array

geoDistanceRange() публичный Метод

Add a geo distance range query.
public geoDistanceRange ( string $field, $from, $to, array $location, array $attributes = [] )
$field string
$from
$to
$location array
$attributes array

geoHash() публичный Метод

Add a geo hash query.
public geoHash ( string $field, mixed $location, array $attributes = [] )
$field string
$location mixed
$attributes array

geoPolygon() публичный Метод

Add a geo polygon query.
public geoPolygon ( string $field, array $points = [], array $attributes = [] )
$field string
$points array
$attributes array

get() публичный Метод

Execute the search query against elastic and return the raw result if the model is not set.
public get ( ) : PlasticResult
Результат Sleimanx2\Plastic\PlasticResult

getBoolState() публичный Метод

Return the boolean query state.
public getBoolState ( ) : string
Результат string

getConnection() публичный Метод

Return the current plastic connection.
public getConnection ( ) : Connection
Результат Sleimanx2\Plastic\Connection

getCurrentPage() защищенный Метод

return the current query string value.
protected getCurrentPage ( ) : integer
Результат integer

getFilteringState() публичный Метод

Return the filtering state.
public getFilteringState ( ) : string
Результат string

getIndex() публичный Метод

Return the current elastic index.
public getIndex ( ) : string
Результат string

getModelFiller() публичный Метод

get the model filler to use after retrieving the results.
public getModelFiller ( ) : Sleimanx2\Plastic\Fillers\FillerInterface
Результат Sleimanx2\Plastic\Fillers\FillerInterface

getRaw() публичный Метод

Execute the search query against elastic and return the raw result.
public getRaw ( ) : array
Результат array

getType() публичный Метод

Return the current elastic type.
public getType ( ) : string
Результат string

ids() публичный Метод

Add an ids query.
public ids ( array | string $ids )
$ids array | string

index() публичный Метод

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

match() публичный Метод

Add a match query.
public match ( string $field, string $term, array $attributes = [] )
$field string
$term string
$attributes array

matchAll() публичный Метод

Add a boost query.
public matchAll ( float | null $boost = 1 )
$boost float | null

minScore() публичный Метод

Set the query min score value.
public minScore ( $score )
$score

model() публичный Метод

Set the eloquent model to use when querying elastic search.
public model ( Model $model )
$model Illuminate\Database\Eloquent\Model

multiMatch() публичный Метод

Add a multi match query.
public multiMatch ( array $fields, string $term, array $attributes = [] )
$fields array
$term string
$attributes array

must() публичный Метод

Switch to a must statement.
public must ( )

mustNot() публичный Метод

Switch to a must not statement.
public mustNot ( )

nested() публичный Метод

Add a nested query.
public nested ( $field, Closure $closure, string $score_mode = 'avg' )
$field
$closure Closure
$score_mode string

paginate() публичный Метод

Paginate result hits.
public paginate ( integer $limit = 25 ) : PlasticPaginator
$limit integer
Результат Sleimanx2\Plastic\PlasticPaginator

prefix() публичный Метод

Add a prefix query.
public prefix ( string $field, string $term, array $attributes = [] )
$field string
$term string
$attributes array

query() публичный Метод

Switch to a regular query.
public query ( )

queryString() публичный Метод

Add a query string query.
public queryString ( string $query, array $attributes = [] )
$query string
$attributes array

range() публичный Метод

Add a range query.
public range ( string $field, array $attributes = [] )
$field string
$attributes array

regexp() публичный Метод

Add a regexp query.
public regexp ( string $field, $regex, array $attributes = [] )
$field string
$attributes array

setModelFiller() публичный Метод

Set the model filler to use after retrieving the results.
public setModelFiller ( Sleimanx2\Plastic\Fillers\FillerInterface $filler )
$filler Sleimanx2\Plastic\Fillers\FillerInterface

should() публичный Метод

Switch to a should statement.
public should ( )

simpleQueryString() публичный Метод

Add a simple query string query.
public simpleQueryString ( string $query, array $attributes = [] )
$query string
$attributes array

size() публичный Метод

Set the query limit/size value.
public size ( integer $limit )
$limit integer

sortBy() публичный Метод

Set the query sort values values.
public sortBy ( string | array $fields, null $order = null, array $parameters = [] )
$fields string | array
$order null
$parameters array

term() публичный Метод

Add an term query.
public term ( string $field, string $term, array $attributes = [] )
$field string
$term string
$attributes array

terms() публичный Метод

Add an terms query.
public terms ( string $field, array $terms, array $attributes = [] )
$field string
$terms array
$attributes array

toDSL() публичный Метод

Return the DSL query.
public toDSL ( ) : array
Результат array

type() публичный Метод

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

wildcard() публичный Метод

Add a wildcard query.
public wildcard ( string $field, string $value, float $boost = 1 )
$field string
$value string
$boost float

Описание свойств

$boolState защищенное свойство

Query bool state.
protected string $boolState
Результат string

$connection защищенное свойство

An instance of plastic Connection.
protected Connection,Sleimanx2\Plastic $connection
Результат Sleimanx2\Plastic\Connection

$filtering защищенное свойство

Query filtering state.
protected bool $filtering
Результат boolean

$index публичное свойство

The elastic index to query against.
public string $index
Результат string

$model защищенное свойство

The model to use when querying elastic search.
protected Model,Illuminate\Database\Eloquent $model
Результат Illuminate\Database\Eloquent\Model

$modelFiller защищенное свойство

The model filler to use after retrieving the results.
protected FillerInterface,Sleimanx2\Plastic\Fillers $modelFiller
Результат Sleimanx2\Plastic\Fillers\FillerInterface

$query публичное свойство

An instance of DSL query.
public Search,ONGR\ElasticsearchDSL $query
Результат ONGR\ElasticsearchDSL\Search

$type публичное свойство

The elastic type to query against.
public string $type
Результат string