diff --git a/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php index b115fba029001b9e37bdfb83561480e7a10f2778..38a2758ef12f9323ac22f48f9d588fcce14a069e 100644 --- a/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php @@ -229,7 +229,7 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface 'defaults' => array('fl' => '*,score'), 'appends' => array('fq' => array()), ), - 'terms' => array( + 'term' => array( 'functions' => array('terms'), ), ); diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Connection/SolrTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Connection/SolrTest.php index a8437127dad03ce072495b528b781c879602a5ed..f9ae374b5ffda079f2f4385844dac5c90d9d8249 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Connection/SolrTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Connection/SolrTest.php @@ -107,4 +107,20 @@ class SolrTest extends \VuFindTest\Unit\TestCase $this->assertEquals($item['count'], count($item['ids'])); $this->assertEquals('123.46 .Q39', $item['heading']); } + + /** + * Check that the terms handler is working. + * + * @return void + */ + public function testTermsHandler() + { + $solr = $this->getServiceManager()->get('VuFind\Search\BackendManager') + ->get('Solr'); + $currentPageInfo = $solr->terms('id', 'test', 1)->getFieldTerms('id'); + $this->assertEquals(1, count($currentPageInfo)); + foreach ($currentPageInfo as $key => $value) { + $this->assertEquals('test', substr($key, 0, 4)); + } + } } \ No newline at end of file