I have SOLR configured to return fragments with a fragsize of 500.
Sometimes, the whole field is 500 characters or less, so the fragment is identical to the field. For fields that are longer than that, SOLR just returns the fragment without any indication (or so it seems) that the fragment only represents part of the content of a field. That means the fragment could start mid-sentence.
I want to make it clear to users that they're looking at a fragment and simply display ellipsis at the end and/or start of such a fragment. Is that functionality built into SOLR? If not, how would you go about inserting ellipsis?
What I ended up doing was returning both the fragment and the unaltered field from which the fragment was created.
I then wrote some logic that compared the two in order to determine whether ellipsis should be added to the fragment and if so, whether to add it before, after or both before and after the fragment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With