diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:31:33 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:31:33 -0400 |
commit | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (patch) | |
tree | 181f454813b310ee97385058c6c6f2e3f34d5fd8 /vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/GeoClusterTest.php | |
parent | 7e85254903c7c0cb49e381f16b18441ea7b058cc (diff) | |
parent | 80f7dc77d430774192b929d780f96260066df2ee (diff) |
Merge commit '80f7dc'
# Conflicts:
# extensions/ArchInterWiki.sql
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/GeoClusterTest.php')
-rw-r--r-- | vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/GeoClusterTest.php | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/GeoClusterTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/GeoClusterTest.php deleted file mode 100644 index d06b58f9..00000000 --- a/vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/GeoClusterTest.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -namespace Elastica\Test\Facet; - -use Elastica\Test\Base as BaseTest; - -class GeoClusterTest extends BaseTest{ - public function testQuery() { - $client = $this->_getClient(); - $nodes = $client->getCluster()->getNodes(); - if(!$nodes[0]->getInfo()->hasPlugin('geocluster-facet')){ - $this->markTestSkipped('geocluster-facet plugin not installed'); - } - - $index = $this->_createIndex('geocluster_test'); - $type = $index->getType('testQuery'); - $geoField = 'location'; - - $type->setMapping(new \Elastica\Type\Mapping($type, array( - $geoField => array( 'type' => 'geo_point', 'lat_lon' => true ) - ))); - - $doc = new \Elastica\Document(1, array('name' => 'item1', 'location' => array(20,20))); - $type->addDocument($doc); - - $doc = new \Elastica\Document(2, array('name' => 'item2', 'location' => array(20,20))); - $type->addDocument($doc); - - $doc = new \Elastica\Document(3, array('name' => 'item3', 'location' => array(20,20))); - $type->addDocument($doc); - - $index->refresh(); - - $facet = new \Elastica\Facet\GeoCluster('clusters'); - $facet - ->setField($geoField) - ->setFactor(1) - ->setShowIds(false); - $query = new \Elastica\Query(); - $query->setFacets(array($facet)); - - $response = $type->search($query); - $facets = $response->getFacets(); - - $this->assertEquals(1, count($facets['clusters']['clusters'])); - - $index->delete(); - } -}
\ No newline at end of file |