Ignore:
Timestamp:
2016-12-21T01:49:14+13:00 (7 years ago)
Author:
Georgiy Litvinov
Message:

Add snippets to cross collection search results

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java

    r31181 r31262  
    220220        new_param_list.appendChild(GSXML.createParameter(msg_doc, HITS_PER_PAGE_PARAM, maxdocs));
    221221        Element query_result = (Element) this.router.process(query_message);
    222 
    223222        // create the doc list for the response
    224223        Element doc_node_list = result_doc.createElement(GSXML.DOC_NODE_ELEM + GSXML.LIST_MODIFIER);
    225224        result.appendChild(doc_node_list);
     225        Element result_snippet_list = result_doc.createElement(GSXML.HL_SNIPPET_ELEM + GSXML.LIST_MODIFIER);
     226        result.appendChild(result_snippet_list);
     227        NodeList hl_snippet_list = query_result.getElementsByTagName(GSXML.HL_SNIPPET_ELEM);
     228        if (hl_snippet_list != null){
     229            for (int hls = 0; hls < hl_snippet_list.getLength(); hls++){
     230                result_snippet_list.appendChild(result_doc.importNode(hl_snippet_list.item(hls), true));
     231            }
     232        }
    226233
    227234        NodeList responses = query_result.getElementsByTagName(GSXML.RESPONSE_ELEM);
     
    240247                this_node = (Element) nodes.item(n);
    241248                this_node.setAttribute("collection", coll_name);
     249   
    242250                if (k == 0)
    243251                {
Note: See TracChangeset for help on using the changeset viewer.