As is typical with much of debugging, I figured out the solution to my 
problem soon after posting. It was a combination of things.

1. I had to turn off hit highlighting in the discovery.xml under the 
config/spring/api directory.
2. Rebuild the index with the -b flag (-f might work)
3. Clear the Cocoon cache.

After all that, we no longer get the abstract in the middle snippets. Yay!

kate


On Monday, October 17, 2016 at 10:01:04 AM UTC-7, Kate Deibel wrote:
>
> We'd like to change the search results in our Mirage2 theme to show just 
> the first N words in abstracts. We do NOT want to show the search hits in 
> context as we've found this is not useful to users. I honestly thought that 
> the following code would suffice:
>
> <xsl:choose>                       
>     <!-- abstract exists-->
>     <xsl:when test="dri:list[@n=(concat($handle, 
> ':dc.description.abstract'))]/dri:item">
>         <div class="abstract">                          
>             <xsl:value-of 
> select="util:shortenString(dri:list[@n=(concat($handle, 
> ':dc.description.abstract'))]/dri:item[1], 220, 10)"/>
>             <br/>
>         </div>
>     </xsl:when>
>     
>     <!-- search hit but no abstract to show -->
>     <xsl:otherwise>
>         <div class="abstract">
>             <em>No abstract or description.</em>
>         </div>
>     </xsl:otherwise>
> </xsl:choose>
>
> The problem is that on some items, we don't get the abstract from the 
> beginning. Instead, if there's a search hit in the middle of the abstract, 
> we still get the snippets showing the search term in context. 
>
> Do I need to turn off hit highlighting or some other feature?
>
> Thanks!
>
> kate
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to