lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Derrick <sc...@tnstaafl.net>
Subject Re: Highlighting
Date Wed, 12 Aug 2015 12:39:29 GMT
I was pretty sure I tried that, though I thought if you don't specify it 
just uses the search terms?

If I just search for "calvin" and don't specify a field, what do I 
assign hl.fl?

Scott

On 8/11/2015 7:27 PM, Erik Hatcher wrote:
> Scott - doesn’t look you’ve specified hl.fl specifying which field(s) to highlight.
>
> p.s. Erick Erickson surely likes your e-mail domain :)
>
>
> —
> Erik Hatcher, Senior Solutions Architect
> http://www.lucidworks.com <http://www.lucidworks.com/>
>
>
>
>
>> On Aug 11, 2015, at 9:02 PM, Scott Derrick <scott@tnstaafl.net> wrote:
>>
>> I guess I really don't get Highlighting in Solr.
>>
>> We are transitioning from Google Custom Search which generally sucks, but does return
nicely formatted highlighted fragment.
>>
>> I turn highlighting on hl=true in the query and I get a highlighting section returned
at the bottom of the page, each identified by the document file name with a empty {} .  It
doesn't matter what I search for, plain text, a field, I get a list of documents followed
by an empty brace?
>>
>> "highlighting": {
>> "/home/scott/workspace/mbel-work/tei2html/build/web/./A10385B/A10385B.html": {},
>> "/home/scott/workspace/mbel-work/tei2html/build/web/./A10089/A10089.html": {},
>> "/home/scott/workspace/mbel-work/tei2html/build/web/./L00003/L00003.html": {},
>> "/home/scott/workspace/mbel-work/tei2html/build/web/./A10646/A10646.html": {},
>> "/home/scott/workspace/mbel-work/tei2html/build/web/./V03482/V03482.html": {},
>> "/home/scott/workspace/mbel-work/tei2html/build/web/./A10594/A10594.html": {},
>> "/home/scott/workspace/mbel-work/tei2html/build/web/./645A.66.043/645A.66.043.html":
{},
>> "/home/scott/workspace/mbel-work/tei2html/build/web/./352.48.001/352.48.001.html":
{},
>> "/home/scott/workspace/mbel-work/tei2html/build/web/./144.23.001/144.23.001.html":
{},
>> "/home/scott/workspace/mbel-work/tei2html/build/web/./L18512/L18512.html": {}
>>   }
>>
>> I haven't made any changes to the default settings
>>
>>    <highlighting>
>>       <!-- Configure the standard fragmenter -->
>>       <!-- This could most likely be commented out in the "default" case -->
>>       <fragmenter name="gap"
>>                   default="true"
>>                   class="solr.highlight.GapFragmenter">
>>         <lst name="defaults">
>>           <int name="hl.fragsize">100</int>
>>         </lst>
>>       </fragmenter>
>>
>>       <!-- A regular-expression-based fragmenter
>>            (for sentence extraction)
>>         -->
>>       <fragmenter name="regex"
>>                   class="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\&quot;&apos;]{20,200}</str>
>>         </lst>
>>       </fragmenter>
>>
>>       <!-- Configure the standard formatter -->
>>       <formatter name="html"
>>                  default="true"
>>                  class="solr.highlight.HtmlFormatter">
>>         <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="solr.highlight.HtmlEncoder" />
>>
>>       <!-- Configure the standard fragListBuilder -->
>>       <fragListBuilder name="simple"
>>                        class="solr.highlight.SimpleFragListBuilder"/>
>>
>>       <!-- Configure the single fragListBuilder -->
>>       <fragListBuilder name="single"
>>                        class="solr.highlight.SingleFragListBuilder"/>
>>
>>       <!-- Configure the weighted fragListBuilder -->
>>       <fragListBuilder name="weighted"
>>                        default="true"
>>                        class="solr.highlight.WeightedFragListBuilder"/>
>>
>>       <!-- default tag FragmentsBuilder -->
>>       <fragmentsBuilder name="default"
>>                         default="true"
>>                         class="solr.highlight.ScoreOrderFragmentsBuilder">
>>         <!--
>>         <lst name="defaults">
>>           <str name="hl.multiValuedSeparatorChar">/</str>
>>         </lst>
>>         -->
>>       </fragmentsBuilder>
>>
>>       <!-- multi-colored tag FragmentsBuilder -->
>>       <fragmentsBuilder name="colored"
>>                         class="solr.highlight.ScoreOrderFragmentsBuilder">
>>         <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>
>>
>>       <boundaryScanner name="default"
>>                        default="true"
>>                        class="solr.highlight.SimpleBoundaryScanner">
>>         <lst name="defaults">
>>           <str name="hl.bs.maxScan">10</str>
>>           <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
>>         </lst>
>>       </boundaryScanner>
>>
>>       <boundaryScanner name="breakIterator"
>>                        class="solr.highlight.BreakIteratorBoundaryScanner">
>>         <lst name="defaults">
>>           <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE
-->
>>           <str name="hl.bs.type">WORD</str>
>>           <!-- language and country are used when constructing Locale object.
 -->
>>           <!-- And the Locale object will be used when getting instance of BreakIterator
-->
>>           <str name="hl.bs.language">en</str>
>>           <str name="hl.bs.country">US</str>
>>         </lst>
>>       </boundaryScanner>
>>     </highlighting>
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


Mime
View raw message