Got the FVH to work in Solr 3.1 (or at least I presume I have given I can see multi-color highlighting in the output.)

But I am not able to get it to recognize the "regex" fragmenter. I get no change in output if I specify the fragmenter. In fact, I can even enter bogus names for the fragmenter and get no change in the output.

Grateful for any suggestions.

Settings and output below.

Christopher


*Query*

   http://localhost:8983/solr/10k-Fragments/select?
   q=content%3Aliquidity
   &rows=100
   &fl=id%2Ccontent
   &qt=standard
   &hl.fl=content
   &hl.useFastVectorHighlighter=true
   &hl=true
   &hl.fragmentsBuilder=colored
   &hl.fragmenter=regex

*Response* (Abbreviated)

   <response>
   -
   <lst name="responseHeader">
   <int name="status">0</int>
   <int name="QTime">47</int>
   -
   <lst name="params">
   <str name="fl">id,content</str>
   <str name="hl.useFastVectorHighlighter">true</str>
   <str name="q">content:liquidity</str>
   <str name="hl.fragmenter">regex1text</str>
   <str name="hl.fl">content</str>
   <str name="hl.fragmentsBuilder">colored</str>
   <str name="qt">standard</str>
   <str name="hl">true</str>
   <str name="rows">100</str>
   </lst>
   </lst>
   . . .
   <lst name="highlighting">
   -
   <lst
   
name="10K/1997-12-31/1998-04-01/1stBergenBancorp/0001005016/ManagementsDiscussionAndAnalysisOfFinancialConditionAndResultsOfOperations/LiquidityAndCapitalResource/paragraph/1/mh1261">
   -
   <arr name="content">
   -
   <str>
   &#4504; <b style="background:yellow">Liquidity</b> is a measure of a
   bank's ability to fund loans and withdrawals of deposits in a cost-ef
   </str>
   </arr>
   </lst>
   . . .

*Field listing in schema.xml*

   <field name="content" type="text" indexed="true" stored="true"
   termVectors="true" termPositions="true" termOffsets="true"/>

*Highlighter listing in solrconfig.xml*

   <highlighting>

   <fragmenter name="gap"
   class="org.apache.solr.highlight.GapFragmenter" default="true">
   <lst name="defaults">
   <int name="hl.fragsize">100</int>
   </lst>
   </fragmenter>
   <fragmenter name="regex"
   class="org.apache.solr.highlight.RegexFragmenter" >
   <lst name="defaults">
   <int name="hl.fragsize">70</int>
   <float name="hl.regex.slop">0.5</float>
   <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
   </lst>
   </fragmenter>

   <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>

   <!-- Configure the standard encoder -->
   <encoder name="html" class="org.apache.solr.highlight.HtmlEncoder"
   default="true"/>

   <!-- Configure the standard fragListBuilder -->
   <fragListBuilder name="simple"
   class="org.apache.solr.highlight.SimpleFragListBuilder" default="true"/>

   <!-- multi-colored tag FragmentsBuilder -->
   <fragmentsBuilder name="colored"
   class="org.apache.solr.highlight.ScoreOrderFragmentsBuilder"
   default="true">
   <lst name="defaults">
   <str name="hl.tag.pre"><![CDATA[
   <b style="background:yellow">,<b style="background:lawgreen">,
   <b style="background:aquamarine">,<b style="background:magenta">,
   <b style="background:palegreen">,<b style="background:coral">,
   <b style="background:wheat">,<b style="background:khaki">,
   <b style="background:lime">,<b style="background:deepskyblue">]]></str>
   <str name="hl.tag.post"><![CDATA[</b>]]></str>
   </lst>
   </fragmentsBuilder>
   </highlighting>

Reply via email to