-
Notifications
You must be signed in to change notification settings - Fork 5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is interesting, in that removing the custom fragsize setting fixes this problem. It looks like we had the MaxFragsize set to 150 while the default from Solr appears to be 100 So the difference of 50 characters is enough to introduce/fix this problem?
@mcritchlow - I tried to change the MaxFragsize to 250 before and it didn't fix the problem. However, when I removed it, then it worked. |
@mcritchlow - attached is the screen shot when that value is set to 250. However, when set it to 300, it also worked. What do you think? Setting it to 300 or remove it? |
So after further discussion on the Sprint call, it seems like the issue is that we have embedded html in the Notes that are getting cut off in the highlight snippet, so we end up with opened tags that are never closed. The challenge here is we'll never know exactly where these embedded tags might be in the note string, so I'm a little wary of setting a new fragsize value since it might break things for a different note. Is is practical to strip out html from highlighted search result fields? |
@mcritchlow - https://github.com/ucsdlib/damspas/blob/develop/app/controllers/catalog_controller.rb#L84 , we can remove that and the tag will use the default value em tag instead and still cause the distorted view. |
@VivianChu - sorry, i mean to say, can we remove the embedded html tags from the note field, not the span wrapper. Looking at the example you mentioned that's linked in the ticket, it looks like it's getting cut off right in the middle of rendering the link:
If that's not practical (or we can't think of some other way to better control the html output of the highlighted snippet), then like you said we might have to consider something more significant, like not displaying those at all because there is so much variability in them.. |
@mcritchlow - I'll try other way to remove the embedded html tags from the note field. I'll keep you posted. |
@@ -19,7 +19,7 @@ def field_with_highlighting document, field, sep=field_value_separator | |||
#Snippets for no default indexed fields | |||
if(hitsonly && highlight_values != nil && highlight_values.count > 0) | |||
highlight_values.collect! {|m|m.length < blacklight_config.hlMaxFragsize || m.ends_with?(".") ? m : m+ " ..."} | |||
return highlight_values.join(sep).html_safe | |||
return strip_tags(highlight_values.join(sep)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
app/helpers/application_helper.rb
Outdated
@@ -19,7 +19,7 @@ def field_with_highlighting document, field, sep=field_value_separator | |||
#Snippets for no default indexed fields | |||
if(hitsonly && highlight_values != nil && highlight_values.count > 0) | |||
highlight_values.collect! {|m|m.length < blacklight_config.hlMaxFragsize || m.ends_with?(".") ? m : m+ " ..."} | |||
return highlight_values.join(sep).html_safe | |||
return strip_tags(highlight_values.join(sep)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationConsistency: Inconsistent indentation detected.
Add test Remove the embedded html tags from the note field Remove tab Fix layout issue Fix space issue Fix space issue
ce39923
to
3a81220
Compare
Fixes #361 ; refs #361
Fix distorted item view display issue for RDCP collection
Changes proposed in this pull request:
@ucsdlib/developers - please review