Changeset 35172 for gs3-extensions


Ignore:
Timestamp:
2021-05-20T14:26:35+12:00 (3 years ago)
Author:
kjdon
Message:

we noticed when doing a solr search at document level that we were getting a random section of the document appearing outside the section headings. This is because when doing a highlighting query at document level, it was returning the first TX element that matched, which was not the top level content element. That was getting added in as the top level content, which it shouldn't be. So only check one TX element for a match then stop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/util/SolrQueryWrapper.java

    r33388 r35172  
    547547    public String runHighlightingQuery(String query,String hldocOID)
    548548    {
    549                    
    550549        SolrQueryResult solr_query_result = new SolrQueryResult();
    551550        solr_query_result.clear();
     
    564563        //Set field for highlighting
    565564        solrQuery.setParam("hl.fl", highlight_field);
     565       
     566        // this option only available for the OriginalHighlighter (hl.method=original, the default)
     567        // if we are doing document level search, we only want to highlight the first section,
     568        // (TX element) if applicable. Otherwise get a middle section displayed at the start of
     569        // a document, outside the toc.
     570        // if we are doing section level search, there will only be one TX element
     571        solrQuery.setParam("hl.maxMultiValuedToExamine", "1");
    566572       
    567573        //Get whole highlighted field
Note: See TracChangeset for help on using the changeset viewer.