mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
BUG Fixed SolrIndex::$sortTypeMap usage
Wasn't defined, so broke with a fatal error when calling addSortField(). Have it fall back to $filterTypeMap.
This commit is contained in:
parent
bcff30d9ca
commit
2a3e882d70
@ -22,6 +22,8 @@ abstract class SolrIndex extends SearchIndex {
|
||||
'Double' => 'tdouble'
|
||||
);
|
||||
|
||||
static $sortTypeMap = array();
|
||||
|
||||
function generateSchema() {
|
||||
return $this->renderWith(Director::baseFolder() . '/fulltextsearch/conf/templates/schema.ss');
|
||||
}
|
||||
@ -73,7 +75,9 @@ abstract class SolrIndex extends SearchIndex {
|
||||
|
||||
$multiValued = (isset($field['multi_valued']) && $field['multi_valued']) ? "multiValued='true'" : '';
|
||||
|
||||
$type = self::$sortTypeMap[$field['type']];
|
||||
$typeMap = array_merge(self::$filterTypeMap, self::$sortTypeMap);
|
||||
$type = isset($typeMap[$field['type']]) ? $typeMap[$field['type']] : $typeMap['*'];
|
||||
|
||||
$xml[] = "<field name='{$name}' type='{$type}' indexed='true' $stored $multiValued />";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user