From 1a365e77dfb8825136626202b1df462731b42060 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 16 Aug 2015 08:22:05 +0200 Subject: Update to MediaWiki 1.25.2 --- .../Exception/PartialShardFailureExceptionTest.php | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 vendor/ruflin/elastica/test/lib/Elastica/Test/Exception/PartialShardFailureExceptionTest.php (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Exception/PartialShardFailureExceptionTest.php') diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Exception/PartialShardFailureExceptionTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Exception/PartialShardFailureExceptionTest.php new file mode 100644 index 00000000..31698e26 --- /dev/null +++ b/vendor/ruflin/elastica/test/lib/Elastica/Test/Exception/PartialShardFailureExceptionTest.php @@ -0,0 +1,55 @@ +_getClient(); + $index = $client->getIndex('elastica_partial_failure'); + $index->create(array( + 'index' => array( + 'number_of_shards' => 5, + 'number_of_replicas' => 0 + ) + ), true); + + $type = $index->getType('folks'); + + $type->addDocument(new Document('', array('name' => 'ruflin'))); + $type->addDocument(new Document('', array('name' => 'bobrik'))); + $type->addDocument(new Document('', array('name' => 'kimchy'))); + + $index->refresh(); + + $query = Query::create(array( + 'query' => array( + 'filtered' => array( + 'filter' => array( + 'script' => array( + 'script' => 'doc["undefined"] > 8', // compiles, but doesn't work + ), + ), + ), + ), + )); + + try { + $index->search($query); + + $this->fail('PartialShardFailureException should have been thrown'); + } catch (PartialShardFailureException $e) { + $resultSet = new ResultSet($e->getResponse(), $query); + $this->assertEquals(0, count($resultSet->getResults())); + } + } + +} -- cgit v1.2.2