set global search

@param bool $globalSearch

@return Datatable
500675
public function setGlobalSearch($globalSearch)
    {
        $this->globalSearch = $globalSearch;
        $this->queryBuilder->setSearch($globalSearch || $this->search);
        return $this;
    }
157204
private boolean setLocation(String global, String context, Map<String, Object> properties) {
        String locationKey = "location." + context;
        Object propvalue = properties.get(locationKey);
        if (propvalue == null) {
            properties.put(locationKey, global);
        } else if (propvalue.getClass().isArray()) {
            Object[] locations = (Object[]) propvalue;
            if (ArrayUtils.contains(locations, global)) {
                return false;
            }
            Object[] newArray = Arrays.copyOf(locations, locations.length + 1);
            newArray[locations.length] = global;
            properties.put(locationKey, newArray);
        } else {
            if (((String) propvalue).equals(global)) {
                return false;
            }
            Object[] newArray = new Object[2];
            newArray[0] = propvalue;
            newArray[1] = global;
            properties.put(locationKey, newArray);
        }
        return true;
    }
422577
protected function setPagerListSearch()
    {
        $options = array(
            'status' => 1,
            'count' => true,
            'store_id' => $this->store_id,
            'language' => $this->langcode
        );

        $pager = array(
            'query' => $this->query_filter,
            'limit' => $this->configTheme('catalog_limit', 20),
            'total' => (int) $this->search->search('product', $this->data_term, $options)
        );

        return $this->data_limit = $this->setPager($pager);
    }
133793
function searchGlobalMetadata(query, opts, callback) {
    if (typeof opts === 'function' && !callback) {
        callback = opts;
        opts = {};
    }

    var searchEndpointUrl = this.getResourceUrl({
        path: '/images',
        user: null,
        query: buildQuery(opts, true).toString()
    });

    request({
        method: 'SEARCH',
        uri: searchEndpointUrl.toString(),
        json: query,
        header: {
            'User-Agent': 'imboclient-js'
        },
        onComplete: function(err, res, body) {
            callback(
                err,
                body ? body.images : [],
                body ? body.search : {},
                res
            );
        }
    });

    return true;
}
1026481
public static function factory($globalCode, $data = null)
    {
        if (self::R_SUCCESS === $globalCode) {
            return new self($globalCode, $data);
        }

        $code = $globalCode % 1000;
        $resultClassIndex = (int) ($globalCode / 1000);
        $resultClass = array_search($resultClassIndex,
            self::getClassIndexMap());

        if ($resultClass != null) {
            return new $resultClass($code, $data);
        }

        throw new InvalidArgumentException("Unknown result code [$globalCode]");
    }
894032
protected function smartGlobalSearch($keyword)
    {
        collect(explode(' ', $keyword))
            ->reject(function ($keyword) {
                return trim($keyword) === '';
            })
            ->each(function ($keyword) {
                $this->globalSearch($keyword);
            });
    }
1250268
public function setGqlQuery($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\GqlQuery::class);
        $this->writeOneof(7, $var);

        return $this;
    }
66409
public void setGlobalTables(java.util.Collection<GlobalTable> globalTables) {
        if (globalTables == null) {
            this.globalTables = null;
            return;
        }

        this.globalTables = new java.util.ArrayList<GlobalTable>(globalTables);
    }
566540
def system_global_search(input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/system/globalSearch', input_params, always_retry=always_retry, **kwargs)
694333
public function searcher()
    {
        return new SublimeSearch(
            $this->searchableQuery(),
            $this->searchOperator === 'having' ? $this->columnKeys() : array_values($this->columns()),
            $this->sortSearch,
            method_exists($this, 'sortColumns') ? $this->sortColumns() : $this->columns(),
            $this->searchOperator
        );
    }
415522
public function setSearch($search)
    {
        $this->_search = $search;
        $this->_queryBuilder->setSearch($search);
        return $this;
    }
1185106
public function doSearch($query = [])
    {
        if (!$this->index) {
            throw new \RuntimeException("You must set an index");
        }

        $this->prepare($query);

        // Only process query when there is a value, in order to avoid sending
        // an empty query string to ElasticSearch, its API is so weird that we
        // probably would end up with exceptions
        $value = $this->getQueryParam($query, $this->fulltextParameterName);
        if ($value) {
            $isQueryEmpty = false;

            $queryPart = [
                'query_string' => [
                    'query' => $this->fixSmartSearch((string)$value),
                    'fields' => $this->fulltextFields,
                 ],
            ];

            if ($this->fulltextAnalyzer) {
                $queryPart['query_string']['analyzer'] = $this->fulltextAnalyzer;
            }

        } else {
            $isQueryEmpty = true;
            $queryPart = [];
        }

        // This must be set before filter since filter query will be altered by
        // the applied aggregations
        $aggs = $this->buildAggQueryData($query);

        if (count($this->filterQuery)) {
            if ($isQueryEmpty) {
                $body = [
                    'query' => [
                        'constant_score' => [
                            'filter' => [
                                'fquery' => [
                                    'query' => [
                                        'query_string' => [
                                            'query' => (string)$this->filterQuery
                                        ],
                                    ],
                                    // @todo Without this ElasticSearch seems to
                                    // throw exceptions...
                                    '_cache' => true,
                                ],
                            ],
                        ],
                    ],
                ];
            } else {
                $body = [
                    'query' => [
                        'filtered' => [
                            'query'  => $queryPart,
                            'filter' => [
                                'fquery' => [
                                    'query' => [
                                        'query_string' => [
                                            'query' => (string)$this->filterQuery
                                        ],
                                    ],
                                    // @todo Without this ElasticSearch seems to
                                    // throw exceptions...
                                    '_cache' => true,
                                ],
                            ],
                        ],
                    ],
                ];
            }
        } else {
            if ($isQueryEmpty) {
                $body = [
                    'query' => [
                        'match_all' => []
                    ],
                ];
            } else {
                $body = [
                    'query' => $queryPart,
                ];
            }
        }

        if (count($this->postFilterQuery)) {
            $body['post_filter']['query_string']['query'] = (string)$this->postFilterQuery;
        }

        if ($aggs) {
            $body['aggs'] = $aggs;
        }
/*
        if ($this->fields) {
            $body['fields'] = $this->fields;
        }*/

        if (count($this->sortFields)) {
            foreach ($this->sortFields as $sort) {
                $body['sort'][] = $sort->getSortStructure();
            }
        }

        $data = [
            'index' => $this->index,
            'type'  => 'node',
            'body'  => $body,
        ];

        if (!empty($this->limit)) {
            $data['size'] = $this->limit;
            if (!empty($this->page)) {
                $data['from'] = max([0, $this->page - 1]) * $this->limit;
            }
        }

        return new Response($this, $this->client->search($data));
    }
728459
public function setGlobals($globals = [])
    {
        $this->server = isset($globals['server']) ? array_merge($_SERVER, $globals['server']) : $_SERVER;
        $this->get    = isset($globals['get'])    ? array_merge($_GET, $globals['get'])       : $_GET;
        $this->post   = isset($globals['post'])   ? array_merge($_POST, $globals['post'])     : $_POST;
    }
1058266
public function setLocalOnly($value = false)
    {
        $this->localOnly = $value;
        $this->scope = $value ? $this->worksheet : null;
        return $this;
    }
895205
public function setCoreSearchDefault($value)
    {
        $this->setFieldName('search_default');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
515652
protected function getSuperglobalValue($superglobal, $index, $defaultValue = null)
    {
        $propertyName = $superglobal . 'Data';

        if (isset($this->$propertyName)){
            $data = $this->$propertyName;

            if (isset($data[$index])){
                return $data[$index];
            }
        }

        return $defaultValue;
    }
612844
public function searchResultSet(DataLoadEvent $event)
    {
        if (!in_array(whatwedoSearchBundle::class, $this->container->getParameter('kernel.bundles'))) {
            return;
        }

        $table = $event->getTable();

        if (!$table instanceof DoctrineTable) {
            return;
        }

        // Exec only if query is set
        if ($table->hasExtension(SearchExtension::class)) {
            $query = $table->getSearchExtension()->getSearchQuery();
            if (strlen(trim($query)) == 0) {
                return;
            }
        } else {
            return;
        }

        $model = $table->getQueryBuilder()->getRootEntities()[0];
        $ids = $this->em->getRepository(Index::class)->search($query, $model);

        $table->getQueryBuilder()->andWhere(sprintf(
            '%s.id IN (:q_ids)',
            $table->getQueryBuilder()->getRootAliases()[0]
        ))->setParameter('q_ids', $ids);
    }