Also, I found this in SolrConfig.xml ... <requestHandler name="dismax" class="solr.SearchHandler" > <lst name="defaults"> <str name="defType">dismax</str> <str name="echoParams">explicit</str> <float name="tie">0.01</float> <str name="qf"> text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4 </str> <str name="pf"> text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9 </str> <str name="bf"> popularity^0.5 recip(price,1,1000,1000)^0.3 </str> <str name="fl"> id,name,price,score </str> <str name="mm"> 2<-1 5<-2 6<90% </str> <int name="ps">100</int> <str name="q.alt">*:*</str> <!-- example highlighter config, enable per-query with hl=true --> <str name="hl.fl">text features name</str> <!-- for this field, we want no fragmenting, just highlighting --> <str name="f.name.hl.fragsize">0</str> <!-- instructs Solr to return the field itself if no query terms are found --> <str name="f.name.hl.alternateField">name</str> <str name="f.text.hl.fragmenter">regex</str> <!-- defined below --> </lst> </requestHandler>
And also this .... <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> Hope this sheds some light on identifying this issue. thanks & regards, Rajesh Ramana -----Original Message----- From: Ramanathapuram, Rajesh [mailto:rajesh.ramanathapu...@turner.com] Sent: Saturday, April 23, 2011 9:18 PM To: solr-user@lucene.apache.org Subject: RE: Solr - Multi Term highlighting issue I don't have hl.fl defined in my schema.xml, I am passing it in as my query parameters <str name="hl.fl">story, slug</str> The elongated parameters is sent like this... 'hl' => 'on', 'hl.fragsize' => $fragsize, 'hl.maxAnalyzedChars' => $fragsize, 'hl.fl' => 'slug,story', 'hl.simple.pre' => '<span class="' .$className . '">', 'hl.simple.post' => '</span>', Here is my query params in response -<response> -<lst name="responseHeader"> <int name="status">0</int> <int name="QTime">26</int> -<lst name="params"> <str name="hl.fragsize">100000</str> <str name="explainOther" /> <str name="indent">on</str> <str name="hl.fl">story, slug</str> <str name="wt">standard</str> <str name="hl">on</str> <str name="rows">10</str> <str name="version">2.2</str> <str name="hl.highlightMultiTerm">true</str> <str name="fl">*</str> <str name="start">0</str> <str name="q">mec us chile</str> <str name="qt">standard</str> <str name="hl.usePhraseHighlighter">true</str> <str name="fq">storyid="XXXX XXXX XXXXX"</str> </lst> </lst> Please let me know. thanks & regards, Rajesh Ramana -----Original Message----- From: Koji Sekiguchi [mailto:k...@r.email.ne.jp] Sent: Friday, April 22, 2011 8:38 PM To: solr-user@lucene.apache.org Subject: Re: Solr - Multi Term highlighting issue How are your hl.fl fields defined in schema.xml? Koji -- http://www.rondhuit.com/en/ (11/04/23 1:23), Ramanathapuram, Rajesh wrote: > Does anybody has other suggestions? > > thanks& regards, > Rajesh Ramana > Enterprise Applications, Turner Broadcasting System, Inc. > 404.878.7474 > > > -----Original Message----- > From: Ramanathapuram, Rajesh [mailto:rajesh.ramanathapu...@turner.com] > Sent: Wednesday, April 20, 2011 2:51 PM > To: solr-user@lucene.apache.org > Subject: RE: Solr - Multi Term highlighting issue > > Thanks Erick. > > I tried your suggestion, the issue still exists. > > http://localhost:8983/searchsolr/mainCore/select?indent=on&version=2.2 > &q=mec+us+chile&fq=storyid%3DXXXXXXX%22&start=0&rows=10&fl=*&qt=standa > rd&wt=standard&explainOther=&hl=on&hl.fl=story%2C+slug&hl.fragsize=100 > 000&hl.highlightMultiTerm=true&hl.usePhraseHighlighter=true&hl.mergeCo > ntiguous=false > > -<lst name="params"> > <str name="hl.fragsize">100000</str> > <str name="explainOther" /> > <str name="indent">on</str> > <str name="hl.mergeContiguous">false</str> .... > > > ... Corboba. (<em>MEC)</b></p><p></p><p><b>CHILE</em>/FOREST FIRES ... > > > thanks& regards, > Rajesh Ramana > > > -----Original Message----- > From: Erick Erickson [mailto:erickerick...@gmail.com] > Sent: Wednesday, April 20, 2011 11:59 AM > To: solr-user@lucene.apache.org > Subject: Re: Solr - Multi Term highlighting issue > > Does your configuration have "hl.mergeContiguous" set to true by any chance? And what happens if you explicitly set this to "false" on your query? > > Best > Erick > > On Wed, Apr 20, 2011 at 9:43 AM, Ramanathapuram, Rajesh<rajesh.ramanathapu...@turner.com> wrote: >> Hello, >> >> I am dealing with a highlighting issue in SOLR, I will try to explain >> the issue. >> >> When I search for a single term in solr, it wraps<em> tag around the >> words I want to highlight, all works well. >> But if I search multiple term, for most part highlighting works good >> and then for some of the terms, the highlight return multiple terms in >> a sing<em> tag ... >> <em>srchtrm1)<br><b><p>.... srchtrm2</em> I expect solr to return >> highlight terms like ...<em>srchtrm1</em>)<br><b><p>... >> <em>srchtrm2</em> >> >> When I search for 'US mec chile', here is how my result appears >> ... Corboba. (<em>MEC)</b></p><p></p><p><b>CHILE</em>/FOREST FIRES: >> We had ... with<em>US</em> and<em>Chile</em> ..., >> (<em>MEC)</b></p><p></p><p><b>US</em> .... >> >> This is what I was expecting it to be >> ... Corboba. >> (<em>MEC</em>)</b></p><p></p><p><b><em>CHILE</em>/FOREST >> FIRES: We had ... with<em>US</em> and<em>Chile</em> ..., >> (<em>MEC</em>)</b></p><p></p><p><b><em>US</em> .... >> >> Here is my query params >> -<response> >> -<lst name="responseHeader"> >> <int name="status">0</int> >> <int name="QTime">26</int> >> -<lst name="params"> >> <str name="hl.fragsize">100000</str> >> <str name="explainOther" /> >> <str name="indent">on</str> >> <str name="hl.fl">story, slug</str> >> <str name="wt">standard</str> >> <str name="hl">on</str> >> <str name="rows">10</str> >> <str name="version">2.2</str> >> <str name="hl.highlightMultiTerm">true</str> >> <str name="fl">*</str> >> <str name="start">0</str> >> <str name="q">mec us chile</str> >> <str name="qt">standard</str> >> <str name="hl.usePhraseHighlighter">true</str> >> <str name="fq">storyid="XXXX XXXX XXXXX"</str> >> </lst> >> </lst> >> >> Here are some other links I found in the forum, but no real >> conclusion >> >> http://www.lucidimagination.com/search/document/ac64e4f0abb6e4fc/solr >> _ >> hi >> ghlighting_question#78163c42a67cb533 >> >> I am going to try this patch, which also had no conclusive results >> https://issues.apache.org/jira/browse/SOLR-1394 >> >> Has anyone come across this issue? >> Any suggestions on how to fix this issue is much appreciated. >> >> >> thanks& regards, >> Rajesh Ramana >> >