Thanks, Mike. Sorry I was busy with something else. What does it mean "field F 
must have an analyzer defined"?

My F defined as:
        <field name="F" type="text" indexed="true" stored="true" 
multiValued="true"/>
text is defined as:
    <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" 
generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" 
splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" 
generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" 
splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>

Do you see anything wrong there?

Thanks,
- Kevin

-----Original Message-----
From: Mike Klaas [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 14, 2008 12:03 PM
To: solr-user@lucene.apache.org
Subject: Re: solr highlighting

The minimum "stuff" needed to highlight term X in field F is:

field F must be 'stored'
field F must have an analyzer defined
a query with term X is sent (e.g., q=X)
with parameters hl=true (or 'on'), hl.fl=F

Try it on the example:
1. get the example running
2. cd example/exampledocs
3. ./post.sh *.xml
4. execute a query:

http://localhost:8983/solr/select?indent=on&version=2.2&q=solr&start=0&rows=10&fl=*%2Cscore&qt=standard&wt=standard&explainOther=&hl=on&hl.fl=features

-Mike

On 14-May-08, at 9:39 AM, Kevin Xiao wrote:

> Thanks Christian. I did try many options indicated in wiki, didn't
> work. So I want to see if the basics work, i.e. only define hl=true
> and a field for hl.fl. Do I need to include something global to make
> hl settings work?
>
> Thanks,
> - Kevin
>
> -----Original Message-----
> From: Christian Vogler [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 14, 2008 5:55 AM
> To: solr-user@lucene.apache.org
> Subject: Re: solr highlighting
>
> On Wednesday 14 May 2008 09:21:36 Kevin Xiao wrote:
>> Hi there,
>>
>> I am new to solr. I want search term to be highlighted on the
>> results. I
>> thought it is pretty simple, but could not make it work. I read a
>> lot of
>> solr documents and mail archives (I wish there is a search function
>> for
>> this, we are talking about solr, aren’t we? ☺).
>
> Take a look at hl.fragsize, hl.snippets, and hl.mergeContiguous, as
> per
> http://wiki.apache.org/solr/HighlightingParameters.
>
> In particular, setting hl.fragsize to 0 might be what you want if I
> understand
> your question correctly.
>
> Best regards
> - Christian
> --
> Christian Vogler, Ph.D.
> Institute for Language and Speech Processing, Athens, Greece
> http://gri.gallaudet.edu/~cvogler/
> [EMAIL PROTECTED]

Reply via email to