getNaturalSorting example

'name' => $aggregation->getName(),
                'type' => 'histogram',
                'interval' => $aggregation->getInterval(),
                'format' => $aggregation->getFormat(),
                'field' => $aggregation->getField(),
                'timeZone' => $aggregation->getTimeZone(),
            ];

            if ($aggregation->getSorting()) {
                $data['sort'] = [
                    'order' => $aggregation->getSorting()->getDirection(),
                    'naturalSorting' => $aggregation->getSorting()->getNaturalSorting(),
                    'field' => $aggregation->getSorting()->getField(),
                ];
            }

            if ($aggregation->getAggregation()) {
                $data['aggregation'] = $this->aggregationToArray($aggregation->getAggregation());
            }

            return $data;
        }

        
continue;
            }

            $accessor = $this->helper->getFieldAccessor($sorting->getField()$definition$definition->getEntityName()$context);

            if ($sorting instanceof CountSorting) {
                $query->addOrderBy(sprintf('COUNT(%s)', $accessor)$sorting->getDirection());

                continue;
            }

            if ($sorting->getNaturalSorting()) {
                $query->addOrderBy('LENGTH(' . $accessor . ')', $sorting->getDirection());
            }

            if (!$this->hasGroupBy($criteria$query)) {
                $query->addOrderBy($accessor$sorting->getDirection());

                continue;
            }

            if (!\in_array($sorting->getField()['product.cheapestPrice', 'cheapestPrice'], true)) {
                if ($sorting->getDirection() === FieldSorting::ASCENDING) {
                    
Home | Imprint | This part of the site doesn't use cookies.