Lines Matching defs:search
11 * Elastica multi search.
15 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html
73 public function addSearch(BaseSearch $search, ?string $key = null): self
76 $this->_searches[$key] = $search;
78 $this->_searches[] = $search;
91 foreach ($searches as $key => $search) {
92 $this->addSearch($search, $key);
129 public function search(): ResultSet
147 foreach ($this->getSearches() as $search) {
148 $data .= $this->_getSearchData($search);
154 protected function _getSearchData(BaseSearch $search): string
156 $header = $this->_getSearchDataHeader($search);
159 $query = $search->getQuery();
161 // Keep other query options as part of the search body
162 $queryOptions = \array_diff_key($search->getOptions(), \array_flip(self::$HEADER_OPTIONS));
170 protected function _getSearchDataHeader(BaseSearch $search): array
172 $header = $search->getOptions();
174 if ($search->hasIndices()) {
175 $header['index'] = $search->getIndices();