mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-10 14:11:25 +00:00
Merge pull request #2180 from Alfresco/fix/ACS-9073-Incomplete-Highlights
[ACS-9073] fix incomplete highlights
This commit is contained in:
@@ -352,9 +352,16 @@ public class AlfrescoSolrHighlighter extends DefaultSolrHighlighter implements P
|
|||||||
if (highlightFieldEntry.getValue() instanceof String[])
|
if (highlightFieldEntry.getValue() instanceof String[])
|
||||||
{
|
{
|
||||||
String [] snippets = (String[])highlightFieldEntry.getValue();
|
String [] snippets = (String[])highlightFieldEntry.getValue();
|
||||||
if (snippets.length > 0)
|
if (snippets != null && snippets.length > 0 && snippets[0] != null)
|
||||||
{
|
{
|
||||||
snippets[0] = snippets[0].charAt(3) == '\u0000' ? snippets[0].substring(4) : snippets[0].substring(5);
|
if (snippets[0].charAt(0) == '\u0000')
|
||||||
|
{
|
||||||
|
int pos = snippets[0].indexOf('\u0000',1);
|
||||||
|
if(pos != -1)
|
||||||
|
{
|
||||||
|
snippets[0] = snippets[0].substring(pos + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user