示例#1
0
 /**
  * @param $locale
  * @param Searchable $inheritFrom
  * @return string
  */
 protected function getSearchableSuggestName($locale, Searchable $inheritFrom = null)
 {
     $suffix = '_suggest_' . $locale->slug;
     if ($inheritFrom) {
         return $inheritFrom->getSearchableType() . $suffix;
     }
     return $this->getSearchableType() . $suffix;
 }
示例#2
0
 /**
  * @param Searchable $type
  * @return array
  */
 protected function data(Searchable $type)
 {
     $params = ['index' => $this->config->getIndex(), 'type' => $type->getSearchableType(), 'id' => $type->getSearchableId(), 'body' => $type->getSearchableDocument()];
     if ($routing = $type->useSearchableRouting()) {
         $params['routing'] = $type->getSearchableRouting();
     }
     return $params;
 }