Details
-
Bug
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
None
-
None
-
None
-
None
-
openSUSE leap42.2, Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode), Solr 6.3.0 includes lucene 6.30 which includes velocity
Description
fixes included for velocity examples 1) did_you_mean.vm 2) and richtext_doc.vm
1) did_you_mean.vm - java ERROR in log get .size of null value
#**
- Hyperlinked spelling suggestions in results list
*#
#set($collations = $response.response.spellcheck.collations.getAll("collation"))- make sure we get a non-null result before checking size . . .
#if($collations && $collations.size() > 0)
Did you mean
#foreach($collation in $collations)
<a href="# {url_for_home}#
{lensNoQ}&q=$esc.url($collation.collationQuery)">$esc.html($collation.collationQuery)</a> ($collation.hits)?
#end
#end
- make sure we get a non-null result before checking size . . .
2) richtext_doc.vm - Mime-Type/filetype mapping to reasonable display icon
replace everything between line from: "## Sort out Mime-Type"
to line "## Row 1: Icon and Title and mlt link" with:
... ## Sort out Mime-Type
-
- change 'content_type' to 'type', Nutch ootb default field per https://wiki.apache.org/nutch/IndexStructure
- should change other Nutch/Solr config files too, e.g. schema.xml or managed_schema . . .
#set($ct = $list.get($doc.getFirstValue('type').split(";"),0))
#set($filename = $doc.getFieldValue('resourcename'))
#set($filetype = false)
#set($filetype = $mimeExtensionsMap.get($ct))
-
- delete/update this block of comments to suit maintainer. . .
- TODO: falling back to file extension is convenient,
- except when you don't have an icon for that extension
- example "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
- document with a .docx extension.
- It'd be nice to fall back to an "unknown" or the existing "file" type
- We sort of do this below, but only if the filename has no extension
- (anything after the last dot).
-
- if we still don't have filetype...
#if (!$filetype) - get file extension if any
#set ($dot = $url.lastIndexOf("."))
#if ($dot > 0) ## ok, found a '.'
#set ($dot = $dot + 1) ## move past it
#set ($filetype = $url.substring($dot))
#end - still no filetype extension or no supported icon for extension
#if (!$filetype || !$supportedMimeTypes.contains($filetype))
#set ($filetype = "file") ## use default for unknown
#end - could check for mere existence of a filetype file in img/ but that would
- would be an expensive dir/file read, anyway user should config
- $supportedMimeTypes and $mimeExtensionsMap properly in mime_type_lists.vm
#end
- if we still don't have filetype...
... ## Row 1: Icon and Title and mlt link
Attachments
Attachments
Issue Links
- is part of
-
SOLR-13335 Upgrade to velocity 2.0 and velocity-tools 3.0
- Closed