Lines Matching full:search

15  * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html
25 * @var Search
51 public function __construct(Search $search, string $expiryTime = '1m') argument
53 $this->_search = $search;
72 * Next scroll search.
86 $this->_search->setOption(Search::OPTION_SCROLL, $this->expiryTime);
87 $this->_search->setOption(Search::OPTION_SCROLL_ID, $this->_nextScrollId);
89 $this->_setScrollId($this->_search->search());
119 * Initial scroll search.
133 // initial search
136 $this->_search->setOption(Search::OPTION_SCROLL, $this->expiryTime);
137 $this->_search->setOption(Search::OPTION_SCROLL_ID, null);
139 $this->_setScrollId($this->_search->search());
145 * Cleares the search context on ES and marks this Scroll instance as finished.
157 [Search::OPTION_SCROLL_ID => [$this->_nextScrollId]]
190 * Save all search options manipulated by Scroll.
194 if ($this->_search->hasOption(Search::OPTION_SCROLL)) {
195 $this->_options[0] = $this->_search->getOption(Search::OPTION_SCROLL);
198 if ($this->_search->hasOption(Search::OPTION_SCROLL_ID)) {
199 $this->_options[1] = $this->_search->getOption(Search::OPTION_SCROLL_ID);
202 if ($this->_search->hasOption(Search::OPTION_SEARCH_IGNORE_UNAVAILABLE)) {
204 … $this->_options[2] = $this->_search->getOption(Search::OPTION_SEARCH_IGNORE_UNAVAILABLE);
206 // remove ignore_unavailable from options if not initial search
209 unset($searchOptions[Search::OPTION_SEARCH_IGNORE_UNAVAILABLE]);
216 * Revert search options to previously saved state.
220 $this->_search->setOption(Search::OPTION_SCROLL, $this->_options[0]);
221 $this->_search->setOption(Search::OPTION_SCROLL_ID, $this->_options[1]);
223 $this->_search->setOption(Search::OPTION_SEARCH_IGNORE_UNAVAILABLE, $this->_options[2]);