> hi
> i am trying to get highlighting working and its turning out
> to be a pain.
> here is my schema
> 
> <field name="id" type="string" indexed="true"
> stored="true" required="true"
> /> 
> <field name="title" type="string" indexed="true"
> stored="true"  /> 
> <field name="pi" type="string" indexed="true"
> stored="true" /> 
> <field name="status" type="string" indexed="true"
> stored="true" /> 
> 
> here is the catchall field (default field for search as
> well)
> <field name="content" type="text" indexed="true"
> stored="false"
> multiValued="true"/>
> 
> here is how I have setup the solrconfig file
> <!-- example highlighter config, enable per-query with
> hl=true -->
>      <str name="hl.fl">title pi
> status</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.title.hl.alternateField">content</str>
>      <str
> name="f.pi.hl.alternateField">content</str>
>      <str
> name="f.status.hl.alternateField">content</str>
>      
>      <str
> name="f.title.hl.fragmenter">regex</str> <!--
> defined below -->
>      <str
> name="f.pi.hl.fragmenter">regex</str> <!--
> defined below -->
>      <str
> name="f.status.hl.fragmenter">regex</str> <!--
> defined below -->    
>     
> after this when I search for lets say
> http://localhost:8983/solr/select?q=submit&hl=true
> I get these results in highlight section
> <lst name="highlighting">
>   <lst name="FP00001934" /> 
>   <lst name="FP00001934-PR02" /> 
>   <lst name="FP00001934-PR03" /> 
>   <lst name="FP00000526" /> 
>   <lst name="FP00000385" /> 
>   </lst>
> with no reference to the actual string .. this number thats
> being returned
> is the id of the records .. and is also the unique
> identifier .. why am I
> not getting the string fragments with search terms
> highlighted

You need to change type of fields (title, pi, staus) from string to text (same 
as content field). 

There should be a match/hit on that field in order to create highlighted 
snippets.

For example q=title:submit should return documents so that snippet of title can 
be generated.

FYI: You can search title, pi, status at the same time using 
http://wiki.apache.org/solr/DisMaxRequestHandler without copying all of them 
into a catch all field.






Reply via email to