Пример #1
0
 /**
  * Search collection for index
  *
  * @param \Mirasvit\Search\Model\Index $index
  * @return array
  */
 public function getCollection($index)
 {
     $index->getSearchCollection()->setPageSize((int) $this->config->getIndexOptionValue($index->getData('code'), 'limit'));
     return $index->getSearchCollection();
 }
Пример #2
0
 /**
  * Index url
  *
  * @param \Mirasvit\Search\Model\Index $index
  *
  * @return string
  */
 public function getIndexUrl($index)
 {
     $query = ['index' => $index->getId(), 'p' => null];
     if ($index->hasData('store_id') && $index->getData('store_id') != $this->getCurrentStore()->getId()) {
         return $this->getUrl('stores/store/switch', ['_query' => ['___store' => $index->getData('store_code')]]);
     }
     $params = ['_current' => true, '_query' => $query];
     if ($index->hasData('store_id')) {
         $params['_scope'] = $index->getData('store_id');
     }
     return $this->getUrl('*/*/*', $params);
 }