1 | <?php |
||
24 | class Manager |
||
25 | { |
||
26 | const SOLR_DATE_FORMAT = 'Y-m-d\TH:i:s\Z'; |
||
27 | const SORT_ASCENDING = 0; |
||
28 | const SORT_DESCENDING = 1; |
||
29 | |||
30 | /** |
||
31 | * @var ModuleOptions |
||
32 | */ |
||
33 | protected $connectOption; |
||
34 | |||
35 | /** |
||
36 | * Manager constructor. |
||
37 | * @param ModuleOptions $connectOption |
||
38 | */ |
||
39 | public function __construct(ModuleOptions $connectOption) |
||
43 | |||
44 | /** |
||
45 | * Get \SolrClient with custom path option |
||
46 | * |
||
47 | * @param string $path |
||
48 | * @return \SolrClient |
||
49 | */ |
||
50 | public function getClient($path='/solr') |
||
64 | |||
65 | /** |
||
66 | * Add new document into Solr server |
||
67 | * |
||
68 | * @param \SolrInputDocument $document |
||
69 | * @param string $path |
||
70 | * @throws ServerException When failed adding document to server |
||
71 | */ |
||
72 | public function addDocument(\SolrInputDocument $document,$path='/solr') |
||
83 | |||
84 | /** |
||
85 | * Create new instance for Solr\Manager |
||
86 | * @param ServiceLocatorInterface $sl |
||
87 | * @return Manager |
||
88 | */ |
||
89 | static public function factory(ServiceLocatorInterface $sl) |
||
95 | } |