This is the public method that gets a score for a the set of results.

@return array An array of scores for each of the corresponding results
429821
public function weight()
    {
        $scores = [];
        foreach ($this->results as $result) {
            $scores[] = $this->getResultScore($result);
        }

        return $scores;
    }
556195
public function result()
    {
        $keys      = array_keys($this->data);
        $first_key = reset($keys);

        return (!is_int($first_key)) ? $this->associativeColumns() : $this->columns();
    }
412709
public function getResult()
    {
        $result = $this->mongo->aggregate($this->getCollectionName(), $this->getPipeline());
        return $result->toArray();
    }
931618
protected function _calculateNumberScore()
    {
        $score = 0;
        $numberCount = $this->_getClassCount(self::CLASS_NUMBER);

        if ($numberCount > 0 && $numberCount != $this->_length) {
            $score += $numberCount * 4;
        }

        return $score;
    }
1129027
public function getTotal()
    {
        return $this->score->getValid() + $this->score->getPartial() + $this->score->getNotValid();
    }
582127
public function results()
    {
        // Finish all
        $this->finishLastPoint();

        // Finish all multiple points
        $this->finishAllMultiplePoints();

        // Add results to presenter
        $this->presenter->displayResultsTrigger($this->pointStack);

        // Return export
        return $this->export();
    }
1338747
public function getTotalResults()
    {
        $query = $this->deliverQueryObject();
        $query
            ->resetQueryParts(['groupBy', 'orderBy'])
            ->select('count(distinct p.id)')
            ->setMaxResults(1);
        $result = $query->execute()->fetchColumn();

        return (int) $result;
    }
181764
public function getHits()
    {
        if ($this->hits === null) {
            $this->hits = $this->stmt->rowCount();
        }

        return $this->hits;
    }
181383
public function getResult(): array
    {
        $result =
            (count($this->rejectedAttributes) > 0)
            ? $this->rejectedAttributes
            : []
        ;
        $this->rejectedAttributes = [];
        return $result;
    }
1097369
public function getResults()
    {
        return ! is_null($this->farParent->{$this->localKey})
                ? $this->get()
                : $this->related->newCollection();
    }
111390
public function getResult() {
		if (!$this->result && $this->response && $this->response->getHttpStatus() >= 200 && $this->response->getHttpStatus() < 300) {
			// decode the response
			$this->result = json_decode($this->response->getRawResponse());
		}

		return $this->result;
	}
899834
protected function getResult()
    {
        $result = empty($this->errors) ? true : $this->errors;
        $this->errors = array();
        return $result;
    }
275101
public function getNbResults()
    {
        if (!$this->tag instanceof Tag) {
            return 0;
        }

        if (!isset($this->nbResults)) {
            $this->nbResults = $this->tagsService->getRelatedContentCount($this->tag);
        }

        return $this->nbResults;
    }
309152
public function count()
    {
        if ($this->_resultsCount === null) {
            $this->_resultsCount = $this->_performCount();
        }

        return $this->_resultsCount;
    }
527341
public function quality()
    {
        $propertiesScore = [
            'firstname'      => 3,
            'lastname'       => 7,
            'nin'            => 10,
            'birthdate'      => 5,
            'mobile'         => 20,
            'email'          => 15,
            'postal_address' => 15,
            'user'           => 25,
        ];
        $totalScore = array_sum($propertiesScore);

        $qualityScore = 0;
        foreach ($propertiesScore as $property => $score) {
            if (trim($this->wrappedObject->$property) !== '') {
                $qualityScore += $score;
            }
        }

        return ceil($qualityScore / $totalScore * 100);
    }
1162613
public function getSmsResults()
    {
        $smsPoll = $this->factory->createSmsPoll();
        $smsPoll->send();
        $resultList = array();

        foreach ($smsPoll->getMessages() as $message) {
            $resultList[] = $sms = $this->factory->createEmptySms();
            $sms->setFields($message);
        }

        $smsPoll->delete();

        return $resultList;
    }
469770
public function toArray(): array
    {
        return array_filter([
            'uuid' => $this->UUID,
            'q' => '' !== $this->getQueryText()
                ? $this->getQueryText()
                : null,
            'fields' => $this->getFields(),
            'coordinate' => $this->coordinate instanceof HttpTransportable
                ? $this->coordinate->toArray()
                : null,
            'filters' => array_filter(
                array_map(function (Filter $filter) {
                    return Filter::TYPE_QUERY !== $filter->getFilterType()
                        ? $filter->toArray()
                        : null;
                }, $this->filters)
            ),
            'universe_filters' => array_filter(
                array_map(function (Filter $filter) {
                    return $filter->toArray();
                }, $this->universeFilters)
            ),
            'aggregations' => array_map(function (Aggregation $aggregation) {
                return $aggregation->toArray();
            }, $this->aggregations),
            'sort' => $this->sortBy instanceof SortBy
                ? $this->sortBy->toArray()
                : null,
            'page' => self::DEFAULT_PAGE === $this->page
                ? null
                : $this->page,
            'size' => self::DEFAULT_SIZE === $this->size
                ? null
                : $this->size,
            'results_enabled' => $this->resultsEnabled
                ? null
                : false,
            'suggestions_enabled' => $this->suggestionsEnabled ?: null,
            'highlight_enabled' => $this->highlightEnabled ?: null,
            'aggregations_enabled' => $this->aggregationsEnabled
                ? null
                : false,
            'searchable_fields' => $this->searchableFields,
            'score_strategies' => $this->scoreStrategies instanceof ScoreStrategies
                ? $this->scoreStrategies->toArray()
                : null,
            'fuzziness' => $this->fuzziness,
            'min_score' => ($this->minScore > self::NO_MIN_SCORE)
                ? $this->minScore
                : null,
            'user' => ($this->user instanceof User)
                ? $this->user->toArray()
                : null,
            'metadata' => $this->metadata,
            'subqueries' => array_map(function (Query $query) {
                return $query->toArray();
            }, $this->subqueries),
            'items_promoted' => array_filter(
                array_map(function (ItemUUID $itemUUID) {
                    return $itemUUID->toArray();
                }, $this->itemsPromoted)
            ),
            'index_uuid' => ($this->indexUUID instanceof IndexUUID)
                ? $this->indexUUID->toArray()
                : null,
        ], function ($element) {
            return
            !(
                is_null($element) ||
                (is_array($element) && empty($element))
            );
        });
    }