コード例 #1
0
 /**
  * @see ISearchDocuments::searchDocuments
  *
  * @return ElasticSearch_SearchResultCollection
  */
 public function searchInFields(array $fields, $request, $offset)
 {
     $terms = trim($request->getValidated('search_fulltext', 'string', ''));
     $results = array();
     if ($terms) {
         $query = $this->getSearchInFieldsQuery($terms, $fields, $offset);
         $searchResult = $this->client->search($query);
         $results = $this->result_factory->getChangesetIds($searchResult);
     }
     return $results;
 }
コード例 #2
0
 public function itDoesNothingIfThereAreNoHits()
 {
     $data = array('took' => 2, 'timed_out' => false, '_shards' => array('total' => 1, 'successful' => 1, 'failed' => 0), 'hits' => array('total' => 0, 'max_score' => 1.3838634), 'time' => 0.0044469833374023);
     $this->assertEqual($this->result_factory->getChangesetIds($data), array());
 }