lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrien RUFFIE <a.ruf...@e-deal.com>
Subject highlighting component to searchComponent
Date Mon, 01 Jul 2013 08:36:45 GMT
Hello all I had the following configuration in my 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[]]></str> -->
<!--     <str name="hl.simple.post"><![CDATA[]]></str> -->
<!--    </lst> -->
<!--    </formatter> -->
<!--   </highlighting> -->



But when I start my webapp the following message appears: WARNING: Deprecated syntax found.
<highlighting/> should move to <searchComponent/>

So I have tried to convert my highlighting to searchComponent with following configuration:

<searchComponent class="solr.HighlightComponent" name="highlight">
    <highlighting>
        <fragmentsBuilder name="gap" class="solr.highlight.GapFragmenter" default="true">
            <lst name="defaults">
                <str name="hl.tag.pre"><![CDATA[<span class="highlight">]]></str>
                <str name="hl.tag.post"><![CDATA[</span>]]></str>
            </lst>
        </fragmentsBuilder>
        <fragmentsBuilder name="regex" class="solr.highlight.RegexFragmenter" default="true">
                        <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>
        </fragmentsBuilder>
        <formatter name="html" class="solr.highlight.HtmlFormatter" default="true">
            <lst name="defaults">
                <str name="hl.simple.pre"><![CDATA[<span class="highlight">]]></str>
                <str name="hl.simple.post"><![CDATA[</span>]]></str>
            </lst>
        </formatter>
    </highlighting>
</searchComponent>

But now following error appears ... do you know the problem and what is the correct class
implementation ?

GRAVE: org.apache.solr.common.SolrException: Error Instantiating SolrFragmentsBuilder, solr.highlight.GapFragmenter
is not a org.apache.solr.highlight.SolrFragmentsBuilder

if you know the right way to do this conversion, I'm interested

Best regards,

Bien cordialement,

[cid:image006.png@01CE7646.E1F262F0]<http://e-deal.biz/kd/9eZ>

[cid:image003.png@01CE7646.C80FF3C0]<http://e-deal.biz/kd/UOh>[cid:image004.png@01CE7646.C80FF3C0]<http://e-deal.biz/kd/X9Q>[cid:image005.png@01CE7646.C80FF3C0]<http://e-deal.biz/kd/bTG>

Adrien RUFFIE
Ingénieur R&D

40, rue du Village d'Entreprises
31670 Labège
www.e-deal.com<http://www.e-deal.com/>


LD : +33 1 73 03 29 50
Std : +33 1 73 03 29 80
Fax : +33 1 73 01 69 77
a.ruffie@e-deal.com <mailto:a.ruffie@e-deal.com>


E-DEAL soutient le Pacte Mondial de l'ONU<http://e-deal.biz/kd/mPQ>


Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message