[TYPO3-Solr] Highlight snippets, fragmentsize and merged snippets

Jigal van Hemert jigal at xs4all.nl
Thu Jun 14 22:55:04 CEST 2012


Hi Ingo,

On 14-6-2012 12:16, Ingo Renner wrote:
> Am 14.06.12 10:37, schrieb Jigal van Hemert:
> I haven't looked into it yet, but if cropping is wrong it's most likely
> a bug in core.

I don't think the cropping is incorrect, I think the snippet is too 
large if two search terms are close together in the text.

If one search term is found in a document a snippet of the set fragment 
size is returned.
If more than one search term (even the same search term) is found near 
another one it looks as if a snippet with the size of two fragementSize 
is returned (maybe because mergeContiguous is set?). If in this 
"super-snippet" the search terms appear somewhere near the end the crop 
action will display a snippet without the search terms.

So far I've found that the behaviour varies a bit with the fragmentSize 
setting in TS.

Like this: ( * = text; H = hightlighted match)
**********************H*****H***************
|<----snippet---->|
Expected:      |<----snippet---->|

I think that solr returns:
|<----------mega-snippet----------->|
After crop:
|<---cropped----->|
and now the highlighted words are not visible.

This is just a hypothesis; have to investigate further...

-- 
Kind regards / Met vriendelijke groet,

Jigal van Hemert.


More information about the TYPO3-project-solr mailing list