Elasticquent\ElasticquentTrait::getBasicEsParams PHP Method

getBasicEsParams() public method

Most Elasticsearch API calls need the index and type passed in a parameter array.
public getBasicEsParams ( boolean $getIdIfPossible = true, boolean $getSourceIfPossible = false, boolean $getTimestampIfPossible = false, integer $limit = null, integer $offset = null ) : array
$getIdIfPossible boolean
$getSourceIfPossible boolean
$getTimestampIfPossible boolean
$limit integer
$offset integer
return array
    public function getBasicEsParams($getIdIfPossible = true, $getSourceIfPossible = false, $getTimestampIfPossible = false, $limit = null, $offset = null)
    {
        $params = array('index' => $this->getIndexName(), 'type' => $this->getTypeName());
        if ($getIdIfPossible && $this->getKey()) {
            $params['id'] = $this->getKey();
        }
        $fields = $this->buildFieldsParameter($getSourceIfPossible, $getTimestampIfPossible);
        if (!empty($fields)) {
            $params['fields'] = implode(',', $fields);
        }
        if (is_numeric($limit)) {
            $params['size'] = $limit;
        }
        if (is_numeric($offset)) {
            $params['from'] = $offset;
        }
        return $params;
    }