Ignore:
Timestamp:
2015-07-25T07:27:52+12:00 (9 years ago)
Author:
Georgiy Litvinov
Message:

Solr repo fixes for highlighting bug.

File:
1 edited

Legend:

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

    r24641 r30057  
    2020
    2121import org.apache.log4j.Logger;
     22import org.greenstone.gsdl3.core.GSException;
     23import org.greenstone.gsdl3.util.GSXML;
     24import org.w3c.dom.Document;
     25import org.w3c.dom.Element;
     26import org.w3c.dom.Text;
    2227
    2328/** Does excatly the same as GS2LuceneRetrieve.  Wrap up in a bit of
     
    3742    super();
    3843    }
     44    @Override
     45    protected Element getNodeContent(Document doc, String doc_id, String lang) throws GSException
     46    {
     47     // IF we need only process our content by macro resolver
     48        if (highlightedNode != null)
     49        {
     50            String highlightedTextContent = highlightedNode.getTextContent();
     51           
     52            //Process text
     53            highlightedTextContent = resolveTextMacros(highlightedTextContent, doc_id, lang);
     54            //Create result element
     55            Element highlighted_node = doc.createElement(GSXML.NODE_CONTENT_ELEM);
     56            Text hlt = doc.createTextNode(highlightedTextContent);
     57            highlighted_node.appendChild(hlt);
     58            return highlighted_node;
     59        }
     60        return super.getNodeContent(doc, doc_id, lang);
     61   
     62    }
    3963}
    4064
Note: See TracChangeset for help on using the changeset viewer.