sets search tracking

@param string $sQueryString  query string
@param int    $iNumberOfHits number of hits
323253
public function addSearch($sQueryString, $iNumberOfHits)
    {
        // #4018: The emospro.search string is URL-encoded forwarded to econda instead of URL-escaped
        $this->_searchQuery = $this->_emos_DataFormat($sQueryString);
        $this->_searchNumberOfHits = $iNumberOfHits;
    }
1282597
public function seek($intPosition)
    {
        if (is_numeric($intPosition) && $intPosition < count($this->collection)) {
            reset($this->collection);
            while ($intPosition < key($this->collection)) {
                next($this->collection);
            }
        }

        $this->isSeek = true;
    }
70217
private void getHits() throws IOException
   {
      TopFieldCollector collector = TopFieldCollector.create(sort, numHits, false, true, false, false);
      searcher.search(query, collector);

      this.size = collector.getTotalHits();
      ScoreDoc[] docs = collector.topDocs().scoreDocs;
      for (int i = scoreDocs.size(); i < docs.length; i++)
      {
         scoreDocs.add(docs[i]);
      }
      log.debug("getHits() {}/{}", scoreDocs.size(), numHits);
      // double hits for next round
      numHits *= 2;
   }
488135
public function GetNumberOfHitsForSearchCacheId($iShopSearchCacheId, $bApplyActiveFilter = false)
    {
        $iNumHits = 0;

        if ($bApplyActiveFilter) {
            $query = "SELECT COUNT(DISTINCT `shop_search_cache_item`.`id`) AS hits
                    FROM `shop_search_cache_item`
              INNER JOIN `shop_article` ON `shop_search_cache_item`.`shop_article_id` = `shop_article`.`id`
               LEFT JOIN `shop_article_shop_category_mlt` ON `shop_article`.`id` = `shop_article_shop_category_mlt`.`source_id`
                   WHERE `shop_search_cache_item`.`shop_search_cache_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($iShopSearchCacheId)."'
                     AND `shop_article`.`shop_manufacturer_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."'
                  ";
            $sFilter = TdbShop::GetActiveFilterString(TdbShopManufacturer::FILTER_KEY_NAME);
            if (!empty($sFilter)) {
                $query .= " AND {$sFilter}";
            }

            $query .= ' GROUP BY `shop_article`.`shop_manufacturer_id`';
        //        echo "<pre>".$query."</pre><br>";
        } else {
            $query = "SELECT COUNT(DISTINCT `shop_search_cache_item`.`id`) AS hits
                    FROM `shop_search_cache_item`
              INNER JOIN `shop_article` ON `shop_search_cache_item`.`shop_article_id` = `shop_article`.`id`
                   WHERE `shop_search_cache_item`.`shop_search_cache_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($iShopSearchCacheId)."'
                     AND `shop_article`.`shop_manufacturer_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."'
                GROUP BY `shop_article`.`shop_manufacturer_id`
                 ";
        }
        if ($row = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) {
            $iNumHits = $row['hits'];
        }

        return $iNumHits;
    }
219924
protected function getMySQLqueryWithParameterIdentifier($sQuery, $paramIdentifier)
    {
        $sReturn = true;
        if (strpos($sQuery, $paramIdentifier) === false) {
            $sReturn = false;
        }
        return $sReturn;
    }
545147
protected void addHits(@Nullable SearchResults results, boolean isReplacing) {
        if (results == null) {
            if (isReplacing) {
                clear();
                if (infiniteScrollListener != null) {
                    infiniteScrollListener.setCurrentlyLoading(false);
                }
            }
            return;
        }

        JSONArray hits = results.hits;

        if (isReplacing) {
            adapter.clear(false);
        }

        for (int i = 0; i < hits.length(); ++i) {
            JSONObject hit = hits.optJSONObject(i);
            if (hit != null) {
                adapter.add(hit);
            }
        }

        if (isReplacing) {
            adapter.notifyDataSetChanged();
            smoothScrollToPosition(0);
            if (infiniteScrollListener != null) {
                infiniteScrollListener.setCurrentlyLoading(false);
            }
        } else {
            adapter.notifyItemRangeInserted(adapter.getItemCount(), hits.length());
        }
    }
251289
public function attachBound(\PHPDaemon\BoundSocket\Generic $bound, $inf = null)
    {
        $this->bound->attach($bound, $inf);
        if ($this->eventLoop !== null) {
            $bound->setEventLoop($this->eventLoop);
        }
    }
1090455
public void set(long count, long min, long max, long total, double sumOfSquares,
                    long startTime, long lastSampleTime) {
        this.count = count;
        this.min = min;
        this.max = max;
        this.total = total;
        this.sumOfSquares = sumOfSquares;
        this.startTime = startTime;
        this.lastSampleTime = lastSampleTime;
        // TODO: createTime
    }
1317123
protected function ProcessIndex($sFieldValue, $iArticleId, $sTableName, $iSubstringLength)
    {
        $oShop = &$this->GetFieldShop();
        $aInserts = array();
        $aInsertsCompleteWords = array();

        $aWords = TdbShopSearchIndexer::PrepareSearchWords($sFieldValue);
        foreach ($aWords as $sWord) {
            $iPos = 0;
            $done = false;
            $iCurrentWordLength = mb_strlen($sWord);
            if ($iCurrentWordLength < $iSubstringLength) {
                continue;
            }
            $bIsCompleteWord = ($iSubstringLength == $iCurrentWordLength);
            if (false === $this->fieldIndexPartialWords && false === $bIsCompleteWord) {
                continue;
            }
            do {
                $done = ($iPos > $iCurrentWordLength - $iSubstringLength);
                if (false === $done) {
                    $sSubStr = mb_substr($sWord, $iPos, $iSubstringLength);
                    if (!array_key_exists($sSubStr, $aInserts)) {
                        $aInserts[$sSubStr] = array('count' => 0, 'weight' => 0);
                    }
                    $dWeight = ($iSubstringLength / $oShop->fieldShopSearchMaxIndexLength) * $oShop->fieldShopSearchWordLengthFactor * ($this->fieldWeight);
                    // is this a complete word?
                    $bIsCompleteWord = (mb_strlen($sSubStr) == $iCurrentWordLength);

                    if ($bIsCompleteWord) {
                        $dWeight = $dWeight * (1 + $oShop->fieldShopSearchWordBonus);
                    }

                    $bAllowInsert = false;
                    if (!$bIsCompleteWord) {
                        // if this is not a complete word, and partial indexing is active, we allow insert
                        if ($this->fieldIndexPartialWords) {
                            $bAllowInsert = true;
                        }
                    } else {
                        // if this is a complete word, we allow index only the word is not in the black list
                        $bAllowInsert = $this->AllowInsertOfThisCompleteWord($sSubStr);
                    }
                    if ($bAllowInsert) {
                        $aInserts[$sSubStr]['count'] = $aInserts[$sSubStr]['count'] + 1;
                        $aInserts[$sSubStr]['weight'] = $aInserts[$sSubStr]['weight'] + $dWeight / $aInserts[$sSubStr]['count'];
                        if ($bIsCompleteWord) {
                            // insert soundex

                            if (!array_key_exists($sSubStr, $aInsertsCompleteWords)) {
                                $aInsertsCompleteWords[$sSubStr] = array('count' => 0, 'weight' => 0);
                            }
                            $aInsertsCompleteWords[$sSubStr]['count'] = $aInsertsCompleteWords[$sSubStr]['count'] + 1;
                            $aInsertsCompleteWords[$sSubStr]['weight'] = $aInsertsCompleteWords[$sSubStr]['weight'] + ($dWeight / (1 + $oShop->fieldShopSearchWordBonus));
                        }
                    }
                }
                ++$iPos;
            } while (!$done);
        }

        // now insert sections into database;
        foreach ($aInserts as $sSubString => $aSubStringInfo) {
            $this->AddIndexToTable($sTableName, $iArticleId, $sSubString, $aSubStringInfo['count'], $aSubStringInfo['weight']);
        }

        foreach ($aInsertsCompleteWords as $sSubString => $aSubStringInfo) {
            $this->InsertSoundex($iArticleId, $sSubString, $aSubStringInfo['count'], $aSubStringInfo['weight']);
        }
    }
1302394
public void setEnterpriseNumber(int index, Number value)
   {
      set(selectField(TaskFieldLists.ENTERPRISE_NUMBER, index), value);
   }
582712
public void setTrack(int track, int type)
	{
		if (allow(type&ID3V1))
		{
			id3v1.setTrack(track);
		}
		if (allow(type&ID3V2))
		{
			id3v2.setTextFrame(ID3v2Frames.TRACK_NUMBER, String.valueOf(track));
		}
	}
1112921
protected function shouldHideResultsFromInitialSearch(SearchRequest $searchRequest)
    {
        return ($this->typoScriptConfiguration->getSearchInitializeWithEmptyQuery() ||
            $this->typoScriptConfiguration->getSearchInitializeWithQuery()) &&
            !$this->typoScriptConfiguration->getSearchShowResultsOfInitialEmptyQuery() &&
            !$this->typoScriptConfiguration->getSearchShowResultsOfInitialQuery() &&
            $searchRequest->getRawUserQueryIsNull();
    }
832012
protected function update(array $lastSearchesRow)
    {
        $queryBuilder = $this->getQueryBuilder();

        $affectedRows = $queryBuilder
            ->update($this->table)
            ->where(
                $queryBuilder->expr()->eq('sequence_id', $queryBuilder->createNamedParameter($lastSearchesRow['sequence_id']))
            )
            ->set('tstamp', time())
            ->set('keywords', $lastSearchesRow['keywords'])
            ->execute();

        if ($affectedRows < 1) {
            throw new \InvalidArgumentException(vsprintf('By trying to update last searches row with values "%s" nothing was updated, make sure the given "sequence_id" exists in database.', [\json_encode($lastSearchesRow)]), 1502717923);
        }
    }
686424
public function countNumberOfUserInSearch($searchString = null)
    {
        $builder = $this->buildUserSearchQuery($searchString);

        return $builder->select($builder->expr()->count('u.id'))
            ->getQuery()
            ->getSingleScalarResult();
    }
310073
public void setEnterpriseNumber(int index, Number value)
   {
      set(selectField(AssignmentFieldLists.ENTERPRISE_NUMBER, index), value);
   }
264649
private function set_query($iquery)
    {
        if ($iquery === null)
        {
            $this->iquery = null;
        }
        else
        {
            $this->iquery = $this->replace_invalid_with_pct_encoding($iquery, '!$&\'()*+,;=:@/?', true);
            $this->scheme_normalization();
        }
        return true;
    }
749146
public function seek($position)
    {
        if ($position < 0) {
            throw new \OutOfBoundsException("Unable to seek to negative offset $position");
        }

        if ($this->_position !== $position) {
            if(($count = $this->_result->num_rows) && ($position > ($count-1)))
                throw new \OutOfBoundsException("Unable to seek to offset $position");

            if ($count) {
                $this->_result->data_seek($this->_position = $position);
                $this->_currentRow = $this->_fetch();
            }

            $this->_position = $position;
        }
    }