Smile\ElasticsuiteCore\Api\Index\Mapping\FieldInterface::getNestedPath PHP Method

getNestedPath() public method

Returns nested path for the field (Example : "category" for "category.position").
public getNestedPath ( ) : string
return string
    public function getNestedPath();

Usage Example

 /**
  * Preprocess aggregations params before they are used into the aggregation factory.
  *
  * @param FieldInterface $field             Bucket field.
  * @param array          $aggregationParams Aggregation params.
  * @param array          $filters           Filter applied to the search request.
  *
  * @return array
  */
 private function getBucketParams(FieldInterface $field, array $aggregationParams, array $filters)
 {
     $bucketField = $field->getMappingProperty(FieldInterface::ANALYZER_UNTOUCHED);
     if ($bucketField === null) {
         throw new \LogicException("Unable to init the filter field for {$field->getName()}");
     }
     $bucketParams = ['field' => $bucketField, 'name' => $field->getName(), 'metrics' => [], 'filter' => array_diff_key($filters, [$field->getName() => true])];
     $bucketParams += $aggregationParams['config'];
     if (empty($bucketParams['filter'])) {
         unset($bucketParams['filter']);
     }
     if ($field->isNested() && !isset($bucketParams['nestedPath'])) {
         $bucketParams['nestedPath'] = $field->getNestedPath();
     } elseif ($field->isNested() === false && isset($bucketParams['nestedPath'])) {
         unset($bucketParams['nestedPath']);
     }
     return $bucketParams;
 }
All Usage Examples Of Smile\ElasticsuiteCore\Api\Index\Mapping\FieldInterface::getNestedPath