/** * @{inheritDoc} */ public function mass_index($data) { $this->client->beginTransaction(); foreach ($data as $row) { $object_type = $row['object_type']; $object_id = $row['object_id']; unset($row['object_type'], $row['object_id']); $this->index($object_type, $object_id, $row); } $this->client->commit(); }
public function testIndexDocument2() { $a = new Article(null, 'Test Article', 'This is an article to test', 'the body of the article', time()); $session = new ezcSearchSession($this->backend, new ezcSearchXmlManager($this->testFilesDir)); $session->beginTransaction(); for ($i = 0; $i < 100; $i++) { $session->index($a); } $session->commit(); $q = $session->createFindQuery('Article'); $q->where($q->eq('title', 'Article')); $r = $session->find($q); self::assertEquals(1, $r->resultCount); }
public function testIndexDocument2() { $content = file_get_contents('/home/derick/dev/ezcomponents-web/files/parsed_rst/coding_standards.xml'); $a = new Article(null, 'Test Article', 'This is an article to test', $content, time()); $session = new ezcSearchSession($this->backend, new ezcSearchXmlManager($this->testFilesDir)); $session->beginTransaction(); for ($i = 0; $i < 5; $i++) { $session->index($a); } $session->commit(); $q = $session->createFindQuery('Article'); $q->where($q->eq('title', 'Article')); $r = $session->find($q); self::assertEquals(5, $r->resultCount); }