Return query terms

@return array
347253
public function getQueryTerms()
    {
        if ($this->_signs === null) {
            return $this->_terms;
        }

        $terms = array();

        foreach ($this->_signs as $id => $sign) {
            if ($sign !== false) {
                $terms[] = $this->_terms[$id];
            }
        }

        return $terms;
    }
905913
private function getSuggestedTerms()
    {
        $terms = array_map(
            function (\Magento\Search\Model\Autocomplete\Item $termItem) {
                return $termItem->getTitle();
            },
            $this->termDataProvider->getItems()
        );

        return $terms;
    }
486280
public function getSearchData()
    {
        try {
            $q = $this->_request->getParam('q');
            if ($q != '') {
                return [
                    'term' => $q,
                ];
            }
        } catch (\Exception $e) {
            throw $e;
        }
        return false;
    }
64962
public function getSearchQuery()
    {
        $query      = null;
        $conditions = $this->getConditions();

        if ($conditions) {
            $query = $conditions->getSearchQuery();
        }

        return $query;
    }
147170
public function getQueries()
    {
        return array_merge(
            $this->createNamespaceQueries,
            $this->createTableQueries,
            $this->createSequenceQueries,
            $this->createFkConstraintQueries
        );
    }
778335
public function getKeywords()
    {
        $return  = array();
        $keywords = $this->entry->get_categories();
        if (is_array($keywords) && count($keywords) > 0) {
            foreach ($keywords as $keyword) {
                $return[] = $this->decodeString($keyword->get_label());
            }
        }

        return $return;
    }
1214363
private function getQueryFields() : array
    {
        $result = [];
        foreach ($this->criteria as $criteria) {
            $field = $this->table->aliasField($criteria->getField());
            if (! in_array($field, $result)) {
                $result[] = $field;
            }
        }

        foreach ($this->query->clause('select') as $field) {
            if (is_string($field) && ! in_array($field, $result)) {
                $result[] = $field;
            }
        }

        return $result;
    }
1116245
public function getQueries()
    {
        return array_merge(
            $this->getRenameTableQueries(),
            $this->getDropCheckQueries(),
            $this->getDropForeignKeyQueries(),
            $this->getDropIndexQueries(),
            $this->getDropPrimaryKeyQueries(),
            $this->getDropColumnQueries(),
            $this->getAlterColumnQueries(),
            $this->getCreateColumnQueries(),
            $this->getCreatePrimaryKeyQueries(),
            $this->getCreateIndexQueries(),
            $this->getCreateForeignKeyQueries(),
            $this->getCreateCheckQueries()
        );
    }
573397
public function query(): array
    {
        return [
            'charts'  => [
                [
                    'name'   => 'Some Data',
                    'values' => [25, 40, 30, 35, 8, 52, 17],
                ],
                [
                    'name'   => 'Another Set',
                    'values' => [25, 50, -10, 15, 18, 32, 27],
                ],
                [
                    'name'   => 'Yet Another',
                    'values' => [15, 20, -3, -15, 58, 12, -17],
                ],
                [
                    'name'   => 'And Last',
                    'values' => [10, 33, -8, -3, 70, 20, -34],
                ],
            ],
            'table'   => [
                new Repository(['product_id' => 'prod-100', 'name' => 'Desk', 'price' => 10.24, 'created_at' => '01.01.2020']),
                new Repository(['product_id' => 'prod-200', 'name' => 'Chair', 'price' => 65.9, 'created_at' => '01.01.2020']),
                new Repository(['product_id' => 'prod-300', 'name' => 'Computer', 'price' => 754.2, 'created_at' => '01.01.2020']),
                new Repository(['product_id' => 'prod-400', 'name' => 'Pen', 'price' => 0.1, 'created_at' => '01.01.2020']),
                new Repository(['product_id' => 'prod-400', 'name' => 'Brush', 'price' => 0.15, 'created_at' => '01.01.2020']),

            ],
            'metrics' => [
                ['keyValue' => number_format(6851, 0), 'keyDiff' => 10.08],
                ['keyValue' => number_format(24668, 0), 'keyDiff' => -30.76],
                ['keyValue' => number_format(65661, 2), 'keyDiff' => 3.84],
                ['keyValue' => number_format(10000, 0), 'keyDiff' => -169.54],
                ['keyValue' => number_format(1454887.12, 2), 'keyDiff' => 0.2],
            ],
            'place'   => [
                'lat' => 37.181244855427394,
                'lng' => -3.6021993309259415,
            ],
        ];
    }
939903
public function getTerms($post)
    {
        $taxonomies = get_field('taxonomy_display', $this->data['ID']);

        if (empty($taxonomies)) {
            return [];
        }


        $terms = array();
        if (!empty($taxonomies)) {
            foreach ($taxonomies as $taxonomy) {
                $terms = array_merge($terms, get_the_terms($post->ID, $taxonomy));
            }
        }

        return $terms;
    }
927549
private function getQueries()
    {
        $queries = [
            'all'      => $this->queryFactory->create(
                QueryInterface::TYPE_BOOL,
                []
            ),
            'searches' => $this->queryFactory->create(
                QueryInterface::TYPE_TERM,
                [
                    'field' => 'page.type.identifier',
                    'value' => 'catalogsearch_result_index',
                ]
            ),
        ];

        return $queries;
    }
1071171
public function find($term, $fields = [])
    {
        Wildcard::setMinPrefixLength($this->minPrefixLength);
        Lucene::setResultSetLimit($this->resultsLimit);

        if (empty($fields)) {
            return [
                'results' => $this->luceneIndex->find($term),
                'query' => $term
            ];
        }

        $fieldTerms[] = new IndexTerm($term);
        foreach ($fields as $field => $fieldText) {
            $fieldTerms[] = new IndexTerm($fieldText, $field);
        }
        return [
            'results' => $this->luceneIndex->find(new MultiTerm($fieldTerms)),
            'query' => $term
        ];
    }
1195913
public function query(): array
    {
        $comments = Comment::with([
            'post' => function ($query) {
                $query->select('id', 'type', 'slug');
            },
        ])->latest()
            ->paginate();

        return [
            'comments' => $comments,
        ];
    }
342055
public function terms()
    {
        $result = array();

        /**
 * Zend_Search_Lucene_Index_TermsPriorityQueue 
*/
        include_once 'Zend/Search/Lucene/Index/TermsPriorityQueue.php';

        $segmentInfoQueue = new Zend_Search_Lucene_Index_TermsPriorityQueue();

        foreach ($this->_segmentInfos as $segmentInfo) {
            $segmentInfo->resetTermsStream();

            // Skip "empty" segments
            if ($segmentInfo->currentTerm() !== null) {
                $segmentInfoQueue->put($segmentInfo);
            }
        }

        while (($segmentInfo = $segmentInfoQueue->pop()) !== null) {
            if ($segmentInfoQueue->top() === null 
                || $segmentInfoQueue->top()->currentTerm()->key() !=                $segmentInfo->currentTerm()->key()
            ) {
                // We got new term
                $result[] = $segmentInfo->currentTerm();
            }

            if ($segmentInfo->nextTerm() !== null) {
                // Put segment back into the priority queue
                $segmentInfoQueue->put($segmentInfo);
            }
        }

        return $result;
    }
775029
public function getTermsAttribute(): array
    {
        $taxonomies = $this->taxonomies;
        foreach ($taxonomies as $taxonomy) {
            $taxonomyName =
                $taxonomy['taxonomy'] === 'post_tag' ? 'tag' : $taxonomy['taxonomy'];
            $terms[$taxonomyName][$taxonomy->term['slug']] = $taxonomy->term->content;
        }

        return $terms ?? [];
    }
758979
public function getSearchResults()
    {
        $term = $this->getRequest()->get('search', null);

        // Avoid querying ALL content when no search value is provided
        if (!$term) {
            return [];
        }

        $host = $this->getRequest()->getHost();
        $locale = $this->getRequest()->attributes->get('content')->getLocale();

        return $this->contentManager->getRepository()->search($term, $host, $locale);
    }
1255153
private function getQueries()
    {
        $queries = [
            'all'      => $this->queryFactory->create(
                QueryInterface::TYPE_BOOL,
                []
            ),
            'searches' => $this->queryFactory->create(
                QueryInterface::TYPE_EXISTS,
                [
                    'field' => 'search_query',
                ]
            ),
            'no_searches' => $this->queryFactory->create(
                QueryInterface::TYPE_MISSING,
                [
                    'field' => 'search_query',
                ]
            ),
        ];

        return $queries;
    }