Example #1
0
 public function testDateRangeWithMinCount()
 {
     $app = JFactory::getApplication();
     $properties = $app->get('build.properties');
     $host = JArrayHelper::getValue($properties, 'solr.host');
     $port = JArrayHelper::getValue($properties, 'solr.port');
     $path = JArrayHelper::getValue($properties, 'solr.path');
     $field = "dc.date.issued_tdt";
     $start = "NOW/YEAR-5YEAR";
     $end = "NOW";
     $gap = "+1YEAR";
     $service = new Service($host, $port, $path);
     $query = new Query('*:*', $service);
     $query->useQueryParser('edismax')->facet(1, 'index', -1)->rows(0)->facetRange($field, $start, $end, $gap);
     $results = $query->search();
     $this->assertEquals(count((array) $results->getFacetRanges()->{"dc.date.issued_tdt"}->counts), 1);
 }