Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SearchEngine.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Search\Model;
7 
11 
16 {
20  private $adapter = null;
21 
27  private $adapterFactory;
28 
32  public function __construct(AdapterFactory $adapterFactory)
33  {
34  $this->adapterFactory = $adapterFactory;
35  }
36 
40  public function search(RequestInterface $request)
41  {
42  return $this->getConnection()->query($request);
43  }
44 
50  protected function getConnection()
51  {
52  if ($this->adapter === null) {
53  $this->adapter = $this->adapterFactory->create();
54  }
55  return $this->adapter;
56  }
57 }
search(RequestInterface $request)
__construct(AdapterFactory $adapterFactory)