You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Ma, Xiaohui (NIH/NLM/LHC) [C]" <xi...@mail.nlm.nih.gov> on 2010/08/09 19:45:52 UTC

hl.usePhraseHighlighter

I am trying to do exactly match. For example, I hope only get study highlighted if I search "study", not others (studies, studied and so on).

I didn't find any function for it from SolrQuery. I added following in solrconfig.xml
<str name="hl.usePhraseHighlighter">true</str>.

Unfortunately I didn't get it work. 

Please help me out.

Thanks so much,
Xiaohui 

RE: hl.usePhraseHighlighter

Posted by "Ma, Xiaohui (NIH/NLM/LHC) [C]" <xi...@mail.nlm.nih.gov>.
Thanks so much for your help! It works. I really appreciate it.

-----Original Message-----
From: Ahmet Arslan [mailto:iorixxx@yahoo.com] 
Sent: Monday, August 09, 2010 6:05 PM
To: solr-user@lucene.apache.org
Subject: RE: hl.usePhraseHighlighter

> I used text type and found the following in schema.xml. I
> don't know which ones I should remove. 
> ***********************************

You should remove <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/> from both index and query time.


      

RE: hl.usePhraseHighlighter

Posted by Ahmet Arslan <io...@yahoo.com>.
> I used text type and found the following in schema.xml. I
> don't know which ones I should remove. 
> ***********************************

You should remove <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/> from both index and query time.


      

RE: hl.usePhraseHighlighter

Posted by "Ma, Xiaohui (NIH/NLM/LHC) [C]" <xi...@mail.nlm.nih.gov>.
Thanks so much for your help!

I used text type and found the following in schema.xml. I don't know which ones I should remove. 
***********************************
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <!-- in this example, we will only use synonyms at query time
        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
        -->
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>
***********************************

-----Original Message-----
From: Ahmet Arslan [mailto:iorixxx@yahoo.com] 
Sent: Monday, August 09, 2010 4:32 PM
To: solr-user@lucene.apache.org
Subject: Re: hl.usePhraseHighlighter


> I am trying to do exactly match. For
> example, I hope only get study highlighted if I search
> "study", not others (studies, studied and so on).

This has nothing to do with highlighting and its parameters. 
You need to remove stem filter factory (porter, snowball) from your analyzer chain. Re-start solr and re-index is also necessary.


      

Re: hl.usePhraseHighlighter

Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: hl.usePhraseHighlighter
: References: <12...@n3.nabble.com>
:  <96...@web52904.mail.re2.yahoo.com>
: In-Reply-To: <96...@web52904.mail.re2.yahoo.com>

http://people.apache.org/~hossman/#threadhijack
Thread Hijacking on Mailing Lists

When starting a new discussion on a mailing list, please do not reply to 
an existing message, instead start a fresh email.  Even if you change the 
subject line of your email, other mail headers still track which thread 
you replied to and your question is "hidden" in that thread and gets less 
attention.   It makes following discussions in the mailing list archives 
particularly difficult.
See Also:  http://en.wikipedia.org/wiki/User:DonDiego/Thread_hijacking


-Hoss


Re: hl.usePhraseHighlighter

Posted by Ahmet Arslan <io...@yahoo.com>.
> I am trying to do exactly match. For
> example, I hope only get study highlighted if I search
> "study", not others (studies, studied and so on).

This has nothing to do with highlighting and its parameters. 
You need to remove stem filter factory (porter, snowball) from your analyzer chain. Re-start solr and re-index is also necessary.