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 "Doddamani, Prakash" <pr...@corp.aol.com> on 2010/05/24 17:55:16 UTC

Highlighting is not happening

Hi 

 

I am using dismax request handler, I wanted to highlight the search
field,

So added 

<str name="hl">true</str>

I was expecting like if I search for keyword "Akon" resultant docs
wherever the Akon is available is bold.

 

But I am not seeing them getting bold, could some one tell me the real
path where I should tune

If I pass explicitly the hl=true does not work

 

I have added the request handler

 

<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">
  name^20.0 coming^5 playing^4 keywords^0.1
     </str>
  <str name="bf">
        rord(isclassic)^0.5 ord(listeners)^0.3
     </str>
  <str name="*,score">
  name, coming, playing, keywords, score
     </str>
     <str name="mm">
        2&lt;-1 5&lt;-2 6&lt;90%
     </str>
     <int name="ps">100</int>
     <str name="q.alt">*:*</str>
     <!-- example highlighter config, enable per-query with hl=true -->

     <str name="hl">true</str>
    <!--   <str name="hl.simple.pre"><b></str> 
             <str name="hl.simple.post"></b></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>
 
regards
prakash

RE: Highlighting is not happening

Posted by "Doddamani, Prakash" <pr...@corp.aol.com>.
Thanks much all
I am using following looks good to me

<str name="hl.simple.pre"><![CDATA[<b>]]></str> 
<str name="hl.simple.post"><![CDATA[</b>]]></str> 

Regards
Prakash

-----Original Message-----
From: Sascha Szott [mailto:szott@zib.de] 
Sent: Tuesday, May 25, 2010 1:16 PM
To: solr-user@lucene.apache.org
Subject: Re: Highlighting is not happening

Hi,

to accomplish that, use the highlighting parameters hl.simple.pre and
hl.simple.post.

By the way, there are a plenty of other parameters that affect
highlighting. Take a look at:

http://wiki.apache.org/solr/HighlightingParameters

-Sascha

Doddamani, Prakash wrote:
> Hey,
>
> I thought the Highlights would happen in the field of the documents 
> returned from SOLR J But it gives new list of Highlighting at below, 
> sorry for the confusion
>
> I was wondering is there a way that the fields returned itself 
> contains bold characters
>
> Eg : if searched for "query"
>
> <doc>
> 	<str field name="one">returned response which contains
<b>query</b>  
> should be bold</str> </doc>
>
>
> Regards
> Prakash
>
> -----Original Message-----
> From: Sascha Szott [mailto:szott@zib.de]
> Sent: Monday, May 24, 2010 10:55 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Highlighting is not happening
>
> Hi Prakash,
>
> can you provide
>
> 1. the definition of the relevant field 2. your query 3. the 
> definition of the relevant request handler 4. a field value that is 
> stored in your index and should be highlighted
>
> -Sascha
>
> Doddamani, Prakash wrote:
>> Thanks Sascha,
>>
>> The "type" for fields for which I am searching are all "text" , and I

>> am using solr.TextField
>>
>>
>> <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"/>
>>           -->
>>           <!-- Case insensitive stop word removal.
>>                enablePositionIncrements=true ensures that a 'gap' is 
>> left to
>>                allow for accurate phrase queries.
>>           -->
>>           <filter class="solr.StopFilterFactory"
>>                   ignoreCase="true"
>>                   words="stopwords.txt"
>>                   enablePositionIncrements="true"
>>                   />
>>           <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>
>>
>> Regards
>> Prakash
>>
>>
>> -----Original Message-----
>> From: Sascha Szott [mailto:szott@zib.de]
>> Sent: Monday, May 24, 2010 10:29 PM
>> To: solr-user@lucene.apache.org
>> Subject: Re: Highlighting is not happening
>>
>> Hi Prakash,
>>
>> more importantly, check the field type and its associated analyzer. 
>> In
>
>> case you use a "non-tokenized" type (e.g., string), highlighting will

>> not appear if only a partial field match exists (only exact matches, 
>> i.e. the query coincides with the field value, will be highlighted).
>> If that's not your intent, you should at least define an tokenizer 
>> for
>
>> the field type.
>>
>> Best,
>> Sascha
>>
>> Doddamani, Prakash wrote:
>>> Hey Daren,
>>> Yes the fields for which I am searching are stored and indexed, also

>>> they are returned from the query, Also it is not coming, if the 
>>> entire
>>
>>> search keyword is part of the field.
>>>
>>> Thanks
>>> Prakash
>>>
>>> -----Original Message-----
>>> From: darren@ontrenet.com [mailto:darren@ontrenet.com]
>>> Sent: Monday, May 24, 2010 9:32 PM
>>> To: solr-user@lucene.apache.org
>>> Subject: Re: Highlighting is not happening
>>>
>>> Check that the field you are highlighting on is "stored". It won't 
>>> work otherwise.
>>>
>>>
>>> Now, this also means that the field is returned from the query. For 
>>> large text fields to be highlighted only, this means the entire text

>>> is returned for each result.
>>>
>>>
>>> There is a pending feature to address this, that allows you to tell 
>>> Solr to NOT return a specific field (to avoid unecessary transfer of

>>> large text fields in this scenario).
>>>
>>> Darren
>>>
>>>> Hi
>>>>
>>>>
>>>>
>>>> I am using dismax request handler, I wanted to highlight the search

>>>> field,
>>>>
>>>> So added
>>>>
>>>> <str name="hl">true</str>
>>>>
>>>> I was expecting like if I search for keyword "Akon" resultant docs 
>>>> wherever the Akon is available is bold.
>>>>
>>>>
>>>>
>>>> But I am not seeing them getting bold, could some one tell me the 
>>>> real
>>>
>>>> path where I should tune
>>>>
>>>> If I pass explicitly the hl=true does not work
>>>>
>>>>
>>>>
>>>> I have added the request handler
>>>>
>>>>
>>>>
>>>> <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">
>>>>      name^20.0 coming^5 playing^4 keywords^0.1
>>>>         </str>
>>>>      <str name="bf">
>>>>            rord(isclassic)^0.5 ord(listeners)^0.3
>>>>         </str>
>>>>      <str name="*,score">
>>>>      name, coming, playing, keywords, score
>>>>         </str>
>>>>         <str name="mm">
>>>>            2&lt;-1 5&lt;-2 6&lt;90%
>>>>         </str>
>>>>         <int name="ps">100</int>
>>>>         <str name="q.alt">*:*</str>
>>>>         <!-- example highlighter config, enable per-query with 
>>>> hl=true
>>>> -->
>>>>
>>>>         <str name="hl">true</str>
>>>>        <!--<str name="hl.simple.pre"><b></str>
>>>>                 <str name="hl.simple.post"></b></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>
>>>>
>>>> regards
>>>> prakash
>>>>
>>>


Re: Highlighting is not happening

Posted by Sascha Szott <sz...@zib.de>.
Hi,

to accomplish that, use the highlighting parameters hl.simple.pre and 
hl.simple.post.

By the way, there are a plenty of other parameters that affect 
highlighting. Take a look at:

http://wiki.apache.org/solr/HighlightingParameters

-Sascha

Doddamani, Prakash wrote:
> Hey,
>
> I thought the Highlights would happen in the field of the documents
> returned from SOLR J
> But it gives new list of Highlighting at below, sorry for the confusion
>
> I was wondering is there a way that the fields returned itself contains
> bold characters
>
> Eg : if searched for "query"
>
> <doc>
> 	<str field name="one">returned response which contains
> <b>query</b>  should be bold</str>
> </doc>
>
>
> Regards
> Prakash
>
> -----Original Message-----
> From: Sascha Szott [mailto:szott@zib.de]
> Sent: Monday, May 24, 2010 10:55 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Highlighting is not happening
>
> Hi Prakash,
>
> can you provide
>
> 1. the definition of the relevant field
> 2. your query
> 3. the definition of the relevant request handler 4. a field value that
> is stored in your index and should be highlighted
>
> -Sascha
>
> Doddamani, Prakash wrote:
>> Thanks Sascha,
>>
>> The "type" for fields for which I am searching are all "text" , and I
>> am using solr.TextField
>>
>>
>> <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"/>
>>           -->
>>           <!-- Case insensitive stop word removal.
>>                enablePositionIncrements=true ensures that a 'gap' is
>> left to
>>                allow for accurate phrase queries.
>>           -->
>>           <filter class="solr.StopFilterFactory"
>>                   ignoreCase="true"
>>                   words="stopwords.txt"
>>                   enablePositionIncrements="true"
>>                   />
>>           <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>
>>
>> Regards
>> Prakash
>>
>>
>> -----Original Message-----
>> From: Sascha Szott [mailto:szott@zib.de]
>> Sent: Monday, May 24, 2010 10:29 PM
>> To: solr-user@lucene.apache.org
>> Subject: Re: Highlighting is not happening
>>
>> Hi Prakash,
>>
>> more importantly, check the field type and its associated analyzer. In
>
>> case you use a "non-tokenized" type (e.g., string), highlighting will
>> not appear if only a partial field match exists (only exact matches,
>> i.e. the query coincides with the field value, will be highlighted).
>> If that's not your intent, you should at least define an tokenizer for
>
>> the field type.
>>
>> Best,
>> Sascha
>>
>> Doddamani, Prakash wrote:
>>> Hey Daren,
>>> Yes the fields for which I am searching are stored and indexed, also
>>> they are returned from the query, Also it is not coming, if the
>>> entire
>>
>>> search keyword is part of the field.
>>>
>>> Thanks
>>> Prakash
>>>
>>> -----Original Message-----
>>> From: darren@ontrenet.com [mailto:darren@ontrenet.com]
>>> Sent: Monday, May 24, 2010 9:32 PM
>>> To: solr-user@lucene.apache.org
>>> Subject: Re: Highlighting is not happening
>>>
>>> Check that the field you are highlighting on is "stored". It won't
>>> work otherwise.
>>>
>>>
>>> Now, this also means that the field is returned from the query. For
>>> large text fields to be highlighted only, this means the entire text
>>> is returned for each result.
>>>
>>>
>>> There is a pending feature to address this, that allows you to tell
>>> Solr to NOT return a specific field (to avoid unecessary transfer of
>>> large text fields in this scenario).
>>>
>>> Darren
>>>
>>>> Hi
>>>>
>>>>
>>>>
>>>> I am using dismax request handler, I wanted to highlight the search
>>>> field,
>>>>
>>>> So added
>>>>
>>>> <str name="hl">true</str>
>>>>
>>>> I was expecting like if I search for keyword "Akon" resultant docs
>>>> wherever the Akon is available is bold.
>>>>
>>>>
>>>>
>>>> But I am not seeing them getting bold, could some one tell me the
>>>> real
>>>
>>>> path where I should tune
>>>>
>>>> If I pass explicitly the hl=true does not work
>>>>
>>>>
>>>>
>>>> I have added the request handler
>>>>
>>>>
>>>>
>>>> <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">
>>>>      name^20.0 coming^5 playing^4 keywords^0.1
>>>>         </str>
>>>>      <str name="bf">
>>>>            rord(isclassic)^0.5 ord(listeners)^0.3
>>>>         </str>
>>>>      <str name="*,score">
>>>>      name, coming, playing, keywords, score
>>>>         </str>
>>>>         <str name="mm">
>>>>            2&lt;-1 5&lt;-2 6&lt;90%
>>>>         </str>
>>>>         <int name="ps">100</int>
>>>>         <str name="q.alt">*:*</str>
>>>>         <!-- example highlighter config, enable per-query with
>>>> hl=true
>>>> -->
>>>>
>>>>         <str name="hl">true</str>
>>>>        <!--<str name="hl.simple.pre"><b></str>
>>>>                 <str name="hl.simple.post"></b></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>
>>>>
>>>> regards
>>>> prakash
>>>>
>>>


RE: Highlighting is not happening

Posted by "Doddamani, Prakash" <pr...@corp.aol.com>.
Hey,

I thought the Highlights would happen in the field of the documents
returned from SOLR J
But it gives new list of Highlighting at below, sorry for the confusion 

I was wondering is there a way that the fields returned itself contains
bold characters

Eg : if searched for "query"

<doc>
	<str field name="one">returned response which contains
<b>query</b> should be bold</str>
</doc>


Regards
Prakash

-----Original Message-----
From: Sascha Szott [mailto:szott@zib.de] 
Sent: Monday, May 24, 2010 10:55 PM
To: solr-user@lucene.apache.org
Subject: Re: Highlighting is not happening

Hi Prakash,

can you provide

1. the definition of the relevant field
2. your query
3. the definition of the relevant request handler 4. a field value that
is stored in your index and should be highlighted

-Sascha

Doddamani, Prakash wrote:
> Thanks Sascha,
>
> The "type" for fields for which I am searching are all "text" , and I 
> am using solr.TextField
>
>
> <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"/>
>          -->
>          <!-- Case insensitive stop word removal.
>               enablePositionIncrements=true ensures that a 'gap' is 
> left to
>               allow for accurate phrase queries.
>          -->
>          <filter class="solr.StopFilterFactory"
>                  ignoreCase="true"
>                  words="stopwords.txt"
>                  enablePositionIncrements="true"
>                  />
>          <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>
>
> Regards
> Prakash
>
>
> -----Original Message-----
> From: Sascha Szott [mailto:szott@zib.de]
> Sent: Monday, May 24, 2010 10:29 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Highlighting is not happening
>
> Hi Prakash,
>
> more importantly, check the field type and its associated analyzer. In

> case you use a "non-tokenized" type (e.g., string), highlighting will 
> not appear if only a partial field match exists (only exact matches, 
> i.e. the query coincides with the field value, will be highlighted). 
> If that's not your intent, you should at least define an tokenizer for

> the field type.
>
> Best,
> Sascha
>
> Doddamani, Prakash wrote:
>> Hey Daren,
>> Yes the fields for which I am searching are stored and indexed, also 
>> they are returned from the query, Also it is not coming, if the 
>> entire
>
>> search keyword is part of the field.
>>
>> Thanks
>> Prakash
>>
>> -----Original Message-----
>> From: darren@ontrenet.com [mailto:darren@ontrenet.com]
>> Sent: Monday, May 24, 2010 9:32 PM
>> To: solr-user@lucene.apache.org
>> Subject: Re: Highlighting is not happening
>>
>> Check that the field you are highlighting on is "stored". It won't 
>> work otherwise.
>>
>>
>> Now, this also means that the field is returned from the query. For 
>> large text fields to be highlighted only, this means the entire text 
>> is returned for each result.
>>
>>
>> There is a pending feature to address this, that allows you to tell 
>> Solr to NOT return a specific field (to avoid unecessary transfer of 
>> large text fields in this scenario).
>>
>> Darren
>>
>>> Hi
>>>
>>>
>>>
>>> I am using dismax request handler, I wanted to highlight the search 
>>> field,
>>>
>>> So added
>>>
>>> <str name="hl">true</str>
>>>
>>> I was expecting like if I search for keyword "Akon" resultant docs 
>>> wherever the Akon is available is bold.
>>>
>>>
>>>
>>> But I am not seeing them getting bold, could some one tell me the 
>>> real
>>
>>> path where I should tune
>>>
>>> If I pass explicitly the hl=true does not work
>>>
>>>
>>>
>>> I have added the request handler
>>>
>>>
>>>
>>> <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">
>>>     name^20.0 coming^5 playing^4 keywords^0.1
>>>        </str>
>>>     <str name="bf">
>>>           rord(isclassic)^0.5 ord(listeners)^0.3
>>>        </str>
>>>     <str name="*,score">
>>>     name, coming, playing, keywords, score
>>>        </str>
>>>        <str name="mm">
>>>           2&lt;-1 5&lt;-2 6&lt;90%
>>>        </str>
>>>        <int name="ps">100</int>
>>>        <str name="q.alt">*:*</str>
>>>        <!-- example highlighter config, enable per-query with 
>>> hl=true
>>> -->
>>>
>>>        <str name="hl">true</str>
>>>       <!--<str name="hl.simple.pre"><b></str>
>>>                <str name="hl.simple.post"></b></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>
>>>
>>> regards
>>> prakash
>>>
>>
>


Re: Highlighting is not happening

Posted by Sascha Szott <sz...@zib.de>.
Hi Prakash,

can you provide

1. the definition of the relevant field
2. your query
3. the definition of the relevant request handler
4. a field value that is stored in your index and should be highlighted

-Sascha

Doddamani, Prakash wrote:
> Thanks Sascha,
>
> The "type" for fields for which I am searching are all "text" , and I am
> using solr.TextField
>
>
> <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"/>
>          -->
>          <!-- Case insensitive stop word removal.
>               enablePositionIncrements=true ensures that a 'gap' is left
> to
>               allow for accurate phrase queries.
>          -->
>          <filter class="solr.StopFilterFactory"
>                  ignoreCase="true"
>                  words="stopwords.txt"
>                  enablePositionIncrements="true"
>                  />
>          <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>
>
> Regards
> Prakash
>
>
> -----Original Message-----
> From: Sascha Szott [mailto:szott@zib.de]
> Sent: Monday, May 24, 2010 10:29 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Highlighting is not happening
>
> Hi Prakash,
>
> more importantly, check the field type and its associated analyzer. In
> case you use a "non-tokenized" type (e.g., string), highlighting will
> not appear if only a partial field match exists (only exact matches,
> i.e. the query coincides with the field value, will be highlighted). If
> that's not your intent, you should at least define an tokenizer for the
> field type.
>
> Best,
> Sascha
>
> Doddamani, Prakash wrote:
>> Hey Daren,
>> Yes the fields for which I am searching are stored and indexed, also
>> they are returned from the query, Also it is not coming, if the entire
>
>> search keyword is part of the field.
>>
>> Thanks
>> Prakash
>>
>> -----Original Message-----
>> From: darren@ontrenet.com [mailto:darren@ontrenet.com]
>> Sent: Monday, May 24, 2010 9:32 PM
>> To: solr-user@lucene.apache.org
>> Subject: Re: Highlighting is not happening
>>
>> Check that the field you are highlighting on is "stored". It won't
>> work otherwise.
>>
>>
>> Now, this also means that the field is returned from the query. For
>> large text fields to be highlighted only, this means the entire text
>> is returned for each result.
>>
>>
>> There is a pending feature to address this, that allows you to tell
>> Solr to NOT return a specific field (to avoid unecessary transfer of
>> large text fields in this scenario).
>>
>> Darren
>>
>>> Hi
>>>
>>>
>>>
>>> I am using dismax request handler, I wanted to highlight the search
>>> field,
>>>
>>> So added
>>>
>>> <str name="hl">true</str>
>>>
>>> I was expecting like if I search for keyword "Akon" resultant docs
>>> wherever the Akon is available is bold.
>>>
>>>
>>>
>>> But I am not seeing them getting bold, could some one tell me the
>>> real
>>
>>> path where I should tune
>>>
>>> If I pass explicitly the hl=true does not work
>>>
>>>
>>>
>>> I have added the request handler
>>>
>>>
>>>
>>> <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">
>>>     name^20.0 coming^5 playing^4 keywords^0.1
>>>        </str>
>>>     <str name="bf">
>>>           rord(isclassic)^0.5 ord(listeners)^0.3
>>>        </str>
>>>     <str name="*,score">
>>>     name, coming, playing, keywords, score
>>>        </str>
>>>        <str name="mm">
>>>           2&lt;-1 5&lt;-2 6&lt;90%
>>>        </str>
>>>        <int name="ps">100</int>
>>>        <str name="q.alt">*:*</str>
>>>        <!-- example highlighter config, enable per-query with hl=true
>>> -->
>>>
>>>        <str name="hl">true</str>
>>>       <!--<str name="hl.simple.pre"><b></str>
>>>                <str name="hl.simple.post"></b></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>
>>>
>>> regards
>>> prakash
>>>
>>
>


RE: Highlighting is not happening

Posted by "Doddamani, Prakash" <pr...@corp.aol.com>.
Thanks Sascha,

The "type" for fields for which I am searching are all "text" , and I am
using solr.TextField


<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"/>
        -->
        <!-- Case insensitive stop word removal.
             enablePositionIncrements=true ensures that a 'gap' is left
to
             allow for accurate phrase queries.
        -->
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="stopwords.txt"
                enablePositionIncrements="true"
                />
        <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>

Regards
Prakash


-----Original Message-----
From: Sascha Szott [mailto:szott@zib.de] 
Sent: Monday, May 24, 2010 10:29 PM
To: solr-user@lucene.apache.org
Subject: Re: Highlighting is not happening

Hi Prakash,

more importantly, check the field type and its associated analyzer. In
case you use a "non-tokenized" type (e.g., string), highlighting will
not appear if only a partial field match exists (only exact matches,
i.e. the query coincides with the field value, will be highlighted). If
that's not your intent, you should at least define an tokenizer for the
field type.

Best,
Sascha

Doddamani, Prakash wrote:
> Hey Daren,
> Yes the fields for which I am searching are stored and indexed, also 
> they are returned from the query, Also it is not coming, if the entire

> search keyword is part of the field.
>
> Thanks
> Prakash
>
> -----Original Message-----
> From: darren@ontrenet.com [mailto:darren@ontrenet.com]
> Sent: Monday, May 24, 2010 9:32 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Highlighting is not happening
>
> Check that the field you are highlighting on is "stored". It won't 
> work otherwise.
>
>
> Now, this also means that the field is returned from the query. For 
> large text fields to be highlighted only, this means the entire text 
> is returned for each result.
>
>
> There is a pending feature to address this, that allows you to tell 
> Solr to NOT return a specific field (to avoid unecessary transfer of 
> large text fields in this scenario).
>
> Darren
>
>> Hi
>>
>>
>>
>> I am using dismax request handler, I wanted to highlight the search 
>> field,
>>
>> So added
>>
>> <str name="hl">true</str>
>>
>> I was expecting like if I search for keyword "Akon" resultant docs 
>> wherever the Akon is available is bold.
>>
>>
>>
>> But I am not seeing them getting bold, could some one tell me the 
>> real
>
>> path where I should tune
>>
>> If I pass explicitly the hl=true does not work
>>
>>
>>
>> I have added the request handler
>>
>>
>>
>> <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">
>>    name^20.0 coming^5 playing^4 keywords^0.1
>>       </str>
>>    <str name="bf">
>>          rord(isclassic)^0.5 ord(listeners)^0.3
>>       </str>
>>    <str name="*,score">
>>    name, coming, playing, keywords, score
>>       </str>
>>       <str name="mm">
>>          2&lt;-1 5&lt;-2 6&lt;90%
>>       </str>
>>       <int name="ps">100</int>
>>       <str name="q.alt">*:*</str>
>>       <!-- example highlighter config, enable per-query with hl=true
>> -->
>>
>>       <str name="hl">true</str>
>>      <!--<str name="hl.simple.pre"><b></str>
>>               <str name="hl.simple.post"></b></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>
>>
>> regards
>> prakash
>>
>


Re: Highlighting is not happening

Posted by Sascha Szott <sz...@zib.de>.
Hi Prakash,

more importantly, check the field type and its associated analyzer. In 
case you use a "non-tokenized" type (e.g., string), highlighting will 
not appear if only a partial field match exists (only exact matches, 
i.e. the query coincides with the field value, will be highlighted). If 
that's not your intent, you should at least define an tokenizer for the 
field type.

Best,
Sascha

Doddamani, Prakash wrote:
> Hey Daren,
> Yes the fields for which I am searching are stored and indexed, also
> they are returned from the query,
> Also it is not coming, if the entire search keyword is part of the
> field.
>
> Thanks
> Prakash
>
> -----Original Message-----
> From: darren@ontrenet.com [mailto:darren@ontrenet.com]
> Sent: Monday, May 24, 2010 9:32 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Highlighting is not happening
>
> Check that the field you are highlighting on is "stored". It won't work
> otherwise.
>
>
> Now, this also means that the field is returned from the query. For
> large text fields to be highlighted only, this means the entire text is
> returned for each result.
>
>
> There is a pending feature to address this, that allows you to tell Solr
> to NOT return a specific field (to avoid unecessary transfer of large
> text fields in this scenario).
>
> Darren
>
>> Hi
>>
>>
>>
>> I am using dismax request handler, I wanted to highlight the search
>> field,
>>
>> So added
>>
>> <str name="hl">true</str>
>>
>> I was expecting like if I search for keyword "Akon" resultant docs
>> wherever the Akon is available is bold.
>>
>>
>>
>> But I am not seeing them getting bold, could some one tell me the real
>
>> path where I should tune
>>
>> If I pass explicitly the hl=true does not work
>>
>>
>>
>> I have added the request handler
>>
>>
>>
>> <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">
>>    name^20.0 coming^5 playing^4 keywords^0.1
>>       </str>
>>    <str name="bf">
>>          rord(isclassic)^0.5 ord(listeners)^0.3
>>       </str>
>>    <str name="*,score">
>>    name, coming, playing, keywords, score
>>       </str>
>>       <str name="mm">
>>          2&lt;-1 5&lt;-2 6&lt;90%
>>       </str>
>>       <int name="ps">100</int>
>>       <str name="q.alt">*:*</str>
>>       <!-- example highlighter config, enable per-query with hl=true
>> -->
>>
>>       <str name="hl">true</str>
>>      <!--<str name="hl.simple.pre"><b></str>
>>               <str name="hl.simple.post"></b></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>
>>
>> regards
>> prakash
>>
>


RE: Highlighting is not happening

Posted by "Doddamani, Prakash" <pr...@corp.aol.com>.
Hey Daren,
Yes the fields for which I am searching are stored and indexed, also
they are returned from the query, 
Also it is not coming, if the entire search keyword is part of the
field.

Thanks 
Prakash

-----Original Message-----
From: darren@ontrenet.com [mailto:darren@ontrenet.com] 
Sent: Monday, May 24, 2010 9:32 PM
To: solr-user@lucene.apache.org
Subject: Re: Highlighting is not happening

Check that the field you are highlighting on is "stored". It won't work
otherwise.


Now, this also means that the field is returned from the query. For
large text fields to be highlighted only, this means the entire text is
returned for each result.


There is a pending feature to address this, that allows you to tell Solr
to NOT return a specific field (to avoid unecessary transfer of large
text fields in this scenario).

Darren

> Hi
>
>
>
> I am using dismax request handler, I wanted to highlight the search 
> field,
>
> So added
>
> <str name="hl">true</str>
>
> I was expecting like if I search for keyword "Akon" resultant docs 
> wherever the Akon is available is bold.
>
>
>
> But I am not seeing them getting bold, could some one tell me the real

> path where I should tune
>
> If I pass explicitly the hl=true does not work
>
>
>
> I have added the request handler
>
>
>
> <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">
>   name^20.0 coming^5 playing^4 keywords^0.1
>      </str>
>   <str name="bf">
>         rord(isclassic)^0.5 ord(listeners)^0.3
>      </str>
>   <str name="*,score">
>   name, coming, playing, keywords, score
>      </str>
>      <str name="mm">
>         2&lt;-1 5&lt;-2 6&lt;90%
>      </str>
>      <int name="ps">100</int>
>      <str name="q.alt">*:*</str>
>      <!-- example highlighter config, enable per-query with hl=true 
> -->
>
>      <str name="hl">true</str>
>     <!--   <str name="hl.simple.pre"><b></str>
>              <str name="hl.simple.post"></b></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>
>
> regards
> prakash
>


Re: Highlighting is not happening

Posted by Darren Govoni <da...@ontrenet.com>.
Ahhhh. Good to know. Thanks!

On Mon, 2010-05-24 at 16:34 -0400, Erik Hatcher wrote:

> It's not true that highlighting means you have to return the field  
> from the query too.  You can specify fl independently of hl.fl
> 
> 	Erik
> 
> On May 24, 2010, at 12:02 PM, darren@ontrenet.com wrote:
> 
> > Check that the field you are highlighting on is "stored". It won't  
> > work
> > otherwise.
> >
> > Now, this also means that the field is returned from the query. For  
> > large
> > text fields to be highlighted only, this means the entire text is  
> > returned
> > for each result.
> >
> > There is a pending feature to address this, that allows you to tell  
> > Solr
> > to NOT return a specific field (to avoid unecessary transfer of  
> > large text
> > fields in this scenario).
> >
> > Darren
> >
> >> Hi
> >>
> >>
> >>
> >> I am using dismax request handler, I wanted to highlight the search
> >> field,
> >>
> >> So added
> >>
> >> <str name="hl">true</str>
> >>
> >> I was expecting like if I search for keyword "Akon" resultant docs
> >> wherever the Akon is available is bold.
> >>
> >>
> >>
> >> But I am not seeing them getting bold, could some one tell me the  
> >> real
> >> path where I should tune
> >>
> >> If I pass explicitly the hl=true does not work
> >>
> >>
> >>
> >> I have added the request handler
> >>
> >>
> >>
> >> <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">
> >>  name^20.0 coming^5 playing^4 keywords^0.1
> >>     </str>
> >>  <str name="bf">
> >>        rord(isclassic)^0.5 ord(listeners)^0.3
> >>     </str>
> >>  <str name="*,score">
> >>  name, coming, playing, keywords, score
> >>     </str>
> >>     <str name="mm">
> >>        2&lt;-1 5&lt;-2 6&lt;90%
> >>     </str>
> >>     <int name="ps">100</int>
> >>     <str name="q.alt">*:*</str>
> >>     <!-- example highlighter config, enable per-query with hl=true  
> >> -->
> >>
> >>     <str name="hl">true</str>
> >>    <!--   <str name="hl.simple.pre"><b></str>
> >>             <str name="hl.simple.post"></b></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>
> >>
> >> regards
> >> prakash
> >>
> >
> 



Re: Highlighting is not happening

Posted by Erik Hatcher <er...@gmail.com>.
It's not true that highlighting means you have to return the field  
from the query too.  You can specify fl independently of hl.fl

	Erik

On May 24, 2010, at 12:02 PM, darren@ontrenet.com wrote:

> Check that the field you are highlighting on is "stored". It won't  
> work
> otherwise.
>
> Now, this also means that the field is returned from the query. For  
> large
> text fields to be highlighted only, this means the entire text is  
> returned
> for each result.
>
> There is a pending feature to address this, that allows you to tell  
> Solr
> to NOT return a specific field (to avoid unecessary transfer of  
> large text
> fields in this scenario).
>
> Darren
>
>> Hi
>>
>>
>>
>> I am using dismax request handler, I wanted to highlight the search
>> field,
>>
>> So added
>>
>> <str name="hl">true</str>
>>
>> I was expecting like if I search for keyword "Akon" resultant docs
>> wherever the Akon is available is bold.
>>
>>
>>
>> But I am not seeing them getting bold, could some one tell me the  
>> real
>> path where I should tune
>>
>> If I pass explicitly the hl=true does not work
>>
>>
>>
>> I have added the request handler
>>
>>
>>
>> <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">
>>  name^20.0 coming^5 playing^4 keywords^0.1
>>     </str>
>>  <str name="bf">
>>        rord(isclassic)^0.5 ord(listeners)^0.3
>>     </str>
>>  <str name="*,score">
>>  name, coming, playing, keywords, score
>>     </str>
>>     <str name="mm">
>>        2&lt;-1 5&lt;-2 6&lt;90%
>>     </str>
>>     <int name="ps">100</int>
>>     <str name="q.alt">*:*</str>
>>     <!-- example highlighter config, enable per-query with hl=true  
>> -->
>>
>>     <str name="hl">true</str>
>>    <!--   <str name="hl.simple.pre"><b></str>
>>             <str name="hl.simple.post"></b></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>
>>
>> regards
>> prakash
>>
>


Re: Highlighting is not happening

Posted by da...@ontrenet.com.
Check that the field you are highlighting on is "stored". It won't work
otherwise.

Now, this also means that the field is returned from the query. For large
text fields to be highlighted only, this means the entire text is returned
for each result.

There is a pending feature to address this, that allows you to tell Solr
to NOT return a specific field (to avoid unecessary transfer of large text
fields in this scenario).

Darren

> Hi
>
>
>
> I am using dismax request handler, I wanted to highlight the search
> field,
>
> So added
>
> <str name="hl">true</str>
>
> I was expecting like if I search for keyword "Akon" resultant docs
> wherever the Akon is available is bold.
>
>
>
> But I am not seeing them getting bold, could some one tell me the real
> path where I should tune
>
> If I pass explicitly the hl=true does not work
>
>
>
> I have added the request handler
>
>
>
> <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">
>   name^20.0 coming^5 playing^4 keywords^0.1
>      </str>
>   <str name="bf">
>         rord(isclassic)^0.5 ord(listeners)^0.3
>      </str>
>   <str name="*,score">
>   name, coming, playing, keywords, score
>      </str>
>      <str name="mm">
>         2&lt;-1 5&lt;-2 6&lt;90%
>      </str>
>      <int name="ps">100</int>
>      <str name="q.alt">*:*</str>
>      <!-- example highlighter config, enable per-query with hl=true -->
>
>      <str name="hl">true</str>
>     <!--   <str name="hl.simple.pre"><b></str>
>              <str name="hl.simple.post"></b></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>
>
> regards
> prakash
>