Returns the total number of non-deleted documents in this index.

@return integer
17741
public function numDocs()
    {
        $numDocs = 0;

        foreach ($this->_segmentInfos as $segmentInfo) {
            $numDocs += $segmentInfo->numDocs();
        }

        return $numDocs;
    }
355470
public function totalCount()
    {
        if ($this->skipTotalRecords) {
            return true;
        }

        return $this->totalRecords ? $this->totalRecords : $this->count();
    }
656129
public function getObjectsCount() : int
    {
        return $this->nb_language_list->getSize() +
               $this->nb_role_list->getSize() +
               $this->nb_site_list->getSize()
        ;
    }
80196
public function getArtCount()
    {
        $iCnt = 0;
        $sSelect = $this->_getArticleSelect();
        if ($sSelect) {
            $iCnt = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sSelect);
        }

        return $iCnt;
    }
193431
public function getNbResults()
    {
        if (isset($this->nbResults)) {
            return $this->nbResults;
        }

        $countQuery = clone $this->query;
        $countQuery->limit = 0;

        return $this->nbResults = $this->findService->findNodes($countQuery)->totalCount;
    }
588612
public function count()
    {
        if(!isset($this->_count))
            $this->_count = $this->_iterator->count();

        return $this->_count;
    }
1069005
public function count()
    {
        $timeBefore = microtime(true);
        $request = $this->getRequest()->getCountRequestAsJson();

        $response = $this->elasticSearchClient->getIndex()->request('GET', '/_count', [], $request);
        $timeAfterwards = microtime(true);

        $treatedContent = $response->getTreatedContent();
        $count = $treatedContent['count'];

        $this->logThisQuery && $this->logger->log('Count Query Log (' . $this->logMessage . '): ' . $request . ' -- execution time: ' . (($timeAfterwards - $timeBefore) * 1000) . ' ms -- Total Results: ' . $count, LOG_DEBUG);

        return $count;
    }
290651
public function count(): int
    {
        $query = $this->viewable->views();

        $cacheKey = Key::createForEntity($this->viewable, $this->period ?? Period::create(), $this->unique, $this->collection);

        if ($this->shouldCache) {
            $cachedViewsCount = $this->cache->get($cacheKey);

            // Return cached views count if it exists
            if ($cachedViewsCount !== null) {
                return (int) $cachedViewsCount;
            }
        }

        if ($period = $this->period) {
            $query->withinPeriod($period);
        }

        $query->where('collection', $this->collection);

        if ($this->unique) {
            $viewsCount = $query->uniqueVisitor()->count('visitor');
        } else {
            $viewsCount = $query->count();
        }

        if ($this->shouldCache) {
            $this->cache->put($cacheKey, $viewsCount, $this->cacheLifetime);
        }

        return $viewsCount;
    }
791960
public function total() {
        
        if(is_null($this->totalCount)) {
            $cpt = $this->getParent()->fetchQuery($this->countQuery);
            $this->totalCount = intval($cpt['cpt']);
        }
        
        return $this->totalCount;
    }
534898
public function NumberOfRecordsLeftToIndex()
    {
        $iCount = 0;
        if ($this->fieldIndexRunning) {
            $sIndexTableName = $this->GetIndexRawTableName();
            $query = "SHOW TABLES LIKE '".MySqlLegacySupport::getInstance()->real_escape_string($sIndexTableName)."'";
            $tRes = MySqlLegacySupport::getInstance()->query($query);
            $bTableExists = (MySqlLegacySupport::getInstance()->num_rows($tRes) >= 1);
            if ($bTableExists) {
                $query = 'SELECT COUNT(sysid) AS reccount FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($sIndexTableName).'`';
                if ($trow = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) {
                    $iCount = $trow['reccount'];
                }
            }
            if ($iCount < 1) {
                $this->StopIndex();
            }
        }

        return $iCount;
    }
118376
public function getLastIndex()
    {	
		if (!$this->itemCountPerPage) return $this->getCountAll();
		$count = $this->itemCountPerPage + $this->itemCountPerPage * ($this->pageNumber - 1);
		if ($count > $this->getCountAll()) $count = $this->getCountAll();
		return $count;
	}
1057501
public function getBasketTotal()
    {
        $total = $this->find()
            ->where([
                'id_user' => $this->idUser,
                'storage' => $this->owner->storageName
            ])
            ->sum('count');

        return ($total) ? $total : 0;
    }
798952
public function getPublishedDocumentCount()
	{
		$count = 0;
		foreach ($this->arrDocuments as $document)
		{
			if ($document->isPublished())
			{
				$count++;
			}
		}
		return $count;
	}
1360550
private function getTotalCount(): int
    {
        if ($this->totalCount === -1) {
            $this->setTotalCount($this->getLastResponse()->getTotal());
        }

        return $this->totalCount;
    }
1202457
public function count(): int
    {
        if ($this->count == null) {
            $this->count = 0;

            if ($handle = opendir($this->fileInfo->getAbsoluteFilePath())) {
                while (($file = readdir($handle)) !== false) {
                    if (!in_array($file, array('.', '..'))) {
                        $this->count++;
                    }
                }

                closedir($handle);
            }
        }

        return $this->count;
    }
105284
public function count()
	{
		$count = count($this->jar);
		if ($this->parentEnabled)
		{
			$count += $this->parent->count();
		}
		return $count;
	}
104894
public function last()
    {
        $lastIndex = $this->count() - 1;
        if ($this->offsetExists($lastIndex)) {
            return $this->offsetGet($lastIndex);
        }
    }