Changeset 31858


Ignore:
Timestamp:
08/08/17 01:40:17 (3 years ago)
Author:
Georgiy Litvinov
Message:

Due to slow search queries on on big documents with standard Solr highlighter switched to FastVectorHighlighter.

Location:
gs3-extensions/solr/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/perllib/solrbuilder.pm

    r30050 r31858  
    309309        # set termVectors=\"true\" when term vectors info is required,
    310310        # see TermsResponse termResponse = solrResponse.getTermsResponse();
    311         #$schema_insert_xml .=  "indexed=\"true\" stored=\"false\" termVectors=\"true\" multiValued=\"true\" />\n";
    312         $schema_insert_xml .=  "indexed=\"true\" stored=\"true\" multiValued=\"true\" />\n";
    313                 #$schema_insert_xml .=  "indexed=\"true\" stored=\"true\" multiValued=\"true\" />\n";
     311        $schema_insert_xml .=  "indexed=\"true\" stored=\"true\" multiValued=\"true\" termVectors=\"true\" termPositions=\"true\" termOffsets=\"true\" />\n";
    314312    }
    315313
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/util/SolrQueryWrapper.java

    r30149 r31858  
    366366        //Return 3 snippets for each document
    367367        solrQuery.setParam("hl.snippets", "3");
     368        solrQuery.setParam("hl.useFastVectorHighlighter", "true");
    368369        solrQuery.setParam("hl.fl", highlight_field);
    369         solrQuery.setHighlightSimplePre("<span class=\"snippetText\">");
    370        
    371         //Set text which appears after highlighted term
    372         solrQuery.setHighlightSimplePost("</span>");
     370        solrQuery.setParam("hl.tag.pre", "<span class=\"snippetText\">" );
     371        solrQuery.setParam("hl.tag.post","</span>" );
    373372       
    374373        //solrQuery.setTerms(true); // turn on the termsComponent       
     
    545544        solrQuery.setFilterQueries("docOID:"+ hldocOID);
    546545       
    547         //Set text which appears before highlighted term
    548         //solrQuery.setHighlightSimplePre("<annotation type=\"query_term\">");
    549546        solrQuery.setHighlightSimplePre("<span class=\"termHighlight\">");
    550         //Set text which appears after highlighted term
    551         //solrQuery.setHighlightSimplePost("</annotation>");
    552547        solrQuery.setHighlightSimplePost("</span>");
     548       
    553549        //Prepare results
    554550        String text = null;
Note: See TracChangeset for help on using the changeset viewer.