[ 
https://issues.apache.org/jira/browse/SOLR-9271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15363781#comment-15363781
 ] 

David Smiley commented on SOLR-9271:
------------------------------------

I agree this would be useful; not sure if it should do this by default as some 
people may not care... but then such clients could trivially remove an ellipsis 
at the very start or end if they didn't care.

FWIW with the Postings highlighter, this can be done by extending 
DefaultPassageFormatter with one that adds these ellipsis conditionally to the 
front & back when they should be there.  To plug it into Solr, you'd extend 
PostingsSolrHighlighter.  Or if DefaultPassageFormatter simply worked this way 
to begin with (patching at the Lucene level) then this would be even simpler of 
course.

The other highlighter impls are different, unfortunately.

Loosely related to this is SOLR-1954 pertaining to enhancing the highlighting 
response structure to expose offsets. That would enable a client to add the 
ellipsis since it'd know if the fragment started at offset 0 or not.  Although 
knowing to insert a trailing ellipsis would require knowing the doc length.  
Hmmm.

> Make fragment ellipsis definable
> --------------------------------
>
>                 Key: SOLR-9271
>                 URL: https://issues.apache.org/jira/browse/SOLR-9271
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: highlighter
>    Affects Versions: 5.4.1
>            Reporter: Christoph Uhland
>            Priority: Minor
>
> The client has to deal if the highlight fragment is only an excerpt or the 
> whole content of a field. 
> It would be a good feature if the highlight component could already process 
> this information, and enrich the highlight fragment with configured ellipsis.
> See stackoverflow: 
> http://stackoverflow.com/questions/3400271/display-ellipsis-before-and-after-fragment-in-solr



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to