[MGNLSTK-997] Search Result: Snippets do not display hits in content Created: 17/Aug/12  Updated: 13/Nov/12  Resolved: 24/Oct/12

Status: Closed
Project: Magnolia Standard Templating Kit (closed)
Component/s: paragraphs, templates
Affects Version/s: 2.0.4
Fix Version/s: 2.0.7

Type: Bug Priority: Major
Reporter: Natascha Desmarais Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File SearchResultItem.patch     PNG File search_content.png     PNG File search_content_result.png    
Issue Links:
causality
relation
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Date of First Response:

 Description   

It seems that the current search does not display snippets from the content area. Snippets are only displayed if the searched text is in the abstract of the page for example.



 Comments   
Comment by Natascha Desmarais [ 17/Aug/12 ]

This is due to the fact that getChildren() (in SearchResultItem, getSnippets() function) for the content area returned an empty result set, which is clear since getChildren() with no parameter only returns children of the same type.

Will include patch for this.

Comment by Jan Haderka [ 13/Nov/12 ]
      ComponentsTestUtil.setInstance(I18nContentSupport.class, new AbstractI18nContentSupport() {
  63             @Override
  64             protected Locale onDetermineLocale() {
  65                 return null;
  66             }
  67 
  68             @Override
  69             protected String toI18NURI(String uri, Locale locale) {
  70                 return uri;
  71             }
  72 
  73             @Override
  74             protected String toRawURI(String i18nURI, Locale locale) {
  75                 return i18nURI;
  76             }
  77         });

It should not be necessary to implement AI18CS in the test. Using instance of DefaultI18nContentSupport should be enough.

Generated at Mon Feb 12 07:32:24 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.