lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergiu Dumitriu (JIRA)" <j...@apache.org>
Subject [jira] [Moved] (SOLR-9920) error fixes included for did_you_mean.vm and richtext_doc.vm velocity examples
Date Wed, 04 Jan 2017 01:51:58 GMT

     [ https://issues.apache.org/jira/browse/SOLR-9920?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergiu Dumitriu moved VELOCITY-879 to SOLR-9920:
------------------------------------------------

    Affects Version/s:     (was: 1.7)
             Security: Public
          Component/s:     (was: Scripting)
                  Key: SOLR-9920  (was: VELOCITY-879)
              Project: Solr  (was: Velocity)

>  error fixes included for did_you_mean.vm and richtext_doc.vm velocity examples
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-9920
>                 URL: https://issues.apache.org/jira/browse/SOLR-9920
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>         Environment: 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
>            Reporter: matthew grisius
>            Priority: Trivial
>         Attachments: jira-VELOCITY-979-bug-report.txt
>
>
> 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
> 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
> ... ## Row 1: Icon and Title and mlt link



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message