You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2007/07/20 07:44:33 UTC

[Solr Wiki] Update of "SolrConfigXml" by MikeKlaas

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by MikeKlaas:
http://wiki.apache.org/solr/SolrConfigXml

The comment on the change is:
added highlighter plugin config to SolrConfigXml

------------------------------------------------------------------------------
    <requestHandler name="custom" class="your.package.CustomRequestHandler" />  
  }}}
   
+ == The Highlighter plugin configuration section ==
+ 
+ You can configure custom fragmenters and formatters for use in highlighting.  Each may be configured with its own set of highlighting parameter defaults.  See also HighlightingParameters.
+ 
+ {{{
+   <highlighting>
+    <!-- Configure the standard fragmenter -->
+    <!-- This could most likely be commented out in the "default" case -->
+    <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
+     <lst name="defaults">
+      <int name="hl.fragsize">100</int>
+     </lst>
+    </fragmenter>
+ 
+    <!-- A regular-expression-based fragmenter (f.i., for sentence extraction) -->
+    <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
+     <lst name="defaults">
+       <!-- slightly smaller fragsizes work better because of slop -->
+       <int name="hl.fragsize">70</int>
+       <!-- allow 50% slop on fragment sizes -->
+       <float name="hl.regex.slop">0.5</float> 
+       <!-- a basic sentence pattern -->
+       <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
+     </lst>
+    </fragmenter>
+    
+    <!-- Configure the standard formatter -->
+    <formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
+     <lst name="defaults">
+      <str name="hl.simple.pre"><![CDATA[<em>]]></str>
+      <str name="hl.simple.post"><![CDATA[</em>]]></str>
+     </lst>
+    </formatter>
+   </highlighting>
+ }}}
+ 
  == The Admin/GUI Section ==
  
  This section handles the administration web page.