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 Radha Krishna Reddy <ra...@gmail.com> on 2011/12/01 14:32:52 UTC

highlight issue

Hi,

I am indexing around 2000 names using solr. highlight flag is on while
querying.

For some name i am getting the search substring appened at the start.

Suppose my search query is "*Rak*".In my database i have "*Rakesh Chaturvedi
*" name.
I am getting "*<em>Rak</em><em>Rak</em>esh Chaturvedi*" as the response.

Same the case with the following names.

Search "Dhar" ------ highlight "<em>Dhar</em><em>Dhar</em>mesh Darshan"
Search "Suda"------ highlight "<em>Suda</em><em>Suda</em>rshan Faakir"

Can someone help me?

I am using the following filters for index and query.

<fieldType name="text_autofill" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" preserveOriginal="1"/>
        <filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
maxGramSize="50" side="front"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" preserveOriginal="1"/>
      </analyzer>
    </fieldType>

Thanks and Regards,
Radha Krishna Reddy.

Re: highlight issue

Posted by Ravish Bhagdev <ra...@gmail.com>.
Also, not entirely sure wild-cards are supported in text based fields, only
on strings.  Although things may have changed in recent versions of Solr, I
am not sure.

R

On Thu, Dec 1, 2011 at 3:55 PM, Koji Sekiguchi <ko...@r.email.ne.jp> wrote:

> Suppose my search query is "*Rak*".In my database i have "*Rakesh
>> Chaturvedi
>> *" name.
>> I am getting "*<em>Rak</em><em>Rak</em>esh Chaturvedi*" as the response.
>>
>> Same the case with the following names.
>>
>> Search "Dhar" ------ highlight "<em>Dhar</em><em>Dhar</em>**mesh Darshan"
>> Search "Suda"------ highlight "<em>Suda</em><em>Suda</em>**rshan Faakir"
>>
>> Can someone help me?
>>
>> I am using the following filters for index and query.
>>
>> <fieldType name="text_autofill" class="solr.TextField"
>> positionIncrementGap="100">
>>       <analyzer type="index">
>>         <tokenizer class="solr.**KeywordTokenizerFactory"/>
>>         <filter class="solr.**LowerCaseFilterFactory"/>
>>         <filter class="solr.**WordDelimiterFilterFactory"
>> generateWordParts="1" preserveOriginal="1"/>
>>         <filter class="solr.**EdgeNGramFilterFactory" minGramSize="1"
>> maxGramSize="50" side="front"/>
>>       </analyzer>
>>       <analyzer type="query">
>>         <tokenizer class="solr.**StandardTokenizerFactory"/>
>>         <filter class="solr.**LowerCaseFilterFactory"/>
>>         <filter class="solr.**WordDelimiterFilterFactory"
>> generateWordParts="1" preserveOriginal="1"/>
>>       </analyzer>
>>     </fieldType>
>>
>
> I don't think Highlighter can support n-gram field.
> Can you try to comment out EdgeNGramFilterFactory and re-index then
> highlight?
>
> koji
> --
> Check out "Query Log Visualizer" for Apache Solr
> http://www.rondhuit-demo.com/**loganalyzer/loganalyzer.html<http://www.rondhuit-demo.com/loganalyzer/loganalyzer.html>
> http://www.rondhuit.com/en/
>

Re: highlight issue

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
> Suppose my search query is "*Rak*".In my database i have "*Rakesh Chaturvedi
> *" name.
> I am getting "*<em>Rak</em><em>Rak</em>esh Chaturvedi*" as the response.
>
> Same the case with the following names.
>
> Search "Dhar" ------ highlight "<em>Dhar</em><em>Dhar</em>mesh Darshan"
> Search "Suda"------ highlight "<em>Suda</em><em>Suda</em>rshan Faakir"
>
> Can someone help me?
>
> I am using the following filters for index and query.
>
> <fieldType name="text_autofill" class="solr.TextField"
> positionIncrementGap="100">
>        <analyzer type="index">
>          <tokenizer class="solr.KeywordTokenizerFactory"/>
>          <filter class="solr.LowerCaseFilterFactory"/>
>          <filter class="solr.WordDelimiterFilterFactory"
> generateWordParts="1" preserveOriginal="1"/>
>          <filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
> maxGramSize="50" side="front"/>
>        </analyzer>
>        <analyzer type="query">
>          <tokenizer class="solr.StandardTokenizerFactory"/>
>          <filter class="solr.LowerCaseFilterFactory"/>
>          <filter class="solr.WordDelimiterFilterFactory"
> generateWordParts="1" preserveOriginal="1"/>
>        </analyzer>
>      </fieldType>

I don't think Highlighter can support n-gram field.
Can you try to comment out EdgeNGramFilterFactory and re-index then highlight?

koji
-- 
Check out "Query Log Visualizer" for Apache Solr
http://www.rondhuit-demo.com/loganalyzer/loganalyzer.html
http://www.rondhuit.com/en/