Created
September 26, 2012 10:54
-
-
Save dmj/3787317 to your computer and use it in GitHub Desktop.
Test vf2 search subsystem @ v0.6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once(realpath(__DIR__ . '/vendor/autoload.php')); | |
$sm = new \Zend\ServiceManager\ServiceManager(new \Zend\Mvc\Service\ServiceManagerConfig(array())); | |
$sm->setService( | |
'ApplicationConfig', | |
array( | |
'modules' => array('VuFindSearch'), | |
'module_listener_options' => array( | |
'module_paths' => array( | |
'VuFindSearch' => realpath(__DIR__), | |
) | |
) | |
) | |
); | |
$sm->get('ModuleManager')->loadModules(); | |
$q = new VuFindSearch\Query\Query(''); | |
$p = new VuFindSearch\Query\Params(); | |
$result = $sm->get('VuFind\Search')->search(array('solr', 'biblio'), $q, $p); | |
foreach ($result as $position => $record) { | |
printf("%2d. %.80s%s\n", 1 + $position, $record->title, strlen($record->title) > 80 ? '…' : ''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment