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 Tejinder Rawat <te...@gmail.com> on 2011/03/31 20:17:38 UTC

Exact keyword search and redirect term

Hi All,



I have many documents indexed based on a field having value “anniversary”.



Also there is a redirect term which is having “anniversary” inside this.
E.g. below:



------------------

    <field name="docType_meta_s">termRedirect</field>

   <field
name="redirectUri_meta_s">/product/silver+25th+anniversary.do</field>

    <field name="redirectTerms_en_us_meta_mv_t">25th anniversary</field>

------------------



Now for any search based on “anniversary”, I am getting the redirection to
above uri. I am expecting the redirection only for exact term “25th
anniversary”.



Is there any configuration to make sure that redirection should work on
exact match?





Thank You!

Re: Exact keyword search and redirect term

Posted by Erick Erickson <er...@gmail.com>.
Oops, fat fingers.

In addition to Jonathan's comment, you can construct your own
field type from, say, keywordanalyzer and lowercasefilter to do
some normalization, and/or patternreplacefilterfactory if you want
to do even more normalization.

Best
Erick

On Thu, Mar 31, 2011 at 3:57 PM, Erick Erickson <er...@gmail.com> wrote:
> In addition to Jo
>
> On Thu, Mar 31, 2011 at 2:43 PM, Jonathan Rochkind <ro...@jhu.edu> wrote:
>> There is no configuration.
>>
>> If:
>> 1) you index your records as type String, with no analysis
>> 2) You always do phrase searches in your query, surround it with double
>> quotes. (Neccesary because otherwise queries with spaces in them won't be
>> passed intact to the field for matching). (Alternately use the 'field' or
>> 'raw' query parsers, or that other new one that will be in solr 3.1 that i
>> forget the name of).
>>
>> Then I believe it will work how you say you want, only matching on _exact_
>> matches.   I think, try it out. But beware that 'exact' here will REALLY
>> mean 'exact' -- same case, exact same punctuation and spacing, exact same
>> bytes. (Same serialization for unicode that can be serialized to several
>> different valid byte representations in UTF8, etc)
>>
>> On 3/31/2011 2:17 PM, Tejinder Rawat wrote:
>>>
>>> Hi All,
>>>
>>>
>>>
>>> I have many documents indexed based on a field having value “anniversary”.
>>>
>>>
>>>
>>> Also there is a redirect term which is having “anniversary” inside this.
>>> E.g. below:
>>>
>>>
>>>
>>> ------------------
>>>
>>>     <field name="docType_meta_s">termRedirect</field>
>>>
>>>    <field
>>> name="redirectUri_meta_s">/product/silver+25th+anniversary.do</field>
>>>
>>>     <field name="redirectTerms_en_us_meta_mv_t">25th anniversary</field>
>>>
>>> ------------------
>>>
>>>
>>>
>>> Now for any search based on “anniversary”, I am getting the redirection to
>>> above uri. I am expecting the redirection only for exact term “25th
>>> anniversary”.
>>>
>>>
>>>
>>> Is there any configuration to make sure that redirection should work on
>>> exact match?
>>>
>>>
>>>
>>>
>>>
>>> Thank You!
>>>
>>
>

Re: Exact keyword search and redirect term

Posted by Erick Erickson <er...@gmail.com>.
In addition to Jo

On Thu, Mar 31, 2011 at 2:43 PM, Jonathan Rochkind <ro...@jhu.edu> wrote:
> There is no configuration.
>
> If:
> 1) you index your records as type String, with no analysis
> 2) You always do phrase searches in your query, surround it with double
> quotes. (Neccesary because otherwise queries with spaces in them won't be
> passed intact to the field for matching). (Alternately use the 'field' or
> 'raw' query parsers, or that other new one that will be in solr 3.1 that i
> forget the name of).
>
> Then I believe it will work how you say you want, only matching on _exact_
> matches.   I think, try it out. But beware that 'exact' here will REALLY
> mean 'exact' -- same case, exact same punctuation and spacing, exact same
> bytes. (Same serialization for unicode that can be serialized to several
> different valid byte representations in UTF8, etc)
>
> On 3/31/2011 2:17 PM, Tejinder Rawat wrote:
>>
>> Hi All,
>>
>>
>>
>> I have many documents indexed based on a field having value “anniversary”.
>>
>>
>>
>> Also there is a redirect term which is having “anniversary” inside this.
>> E.g. below:
>>
>>
>>
>> ------------------
>>
>>     <field name="docType_meta_s">termRedirect</field>
>>
>>    <field
>> name="redirectUri_meta_s">/product/silver+25th+anniversary.do</field>
>>
>>     <field name="redirectTerms_en_us_meta_mv_t">25th anniversary</field>
>>
>> ------------------
>>
>>
>>
>> Now for any search based on “anniversary”, I am getting the redirection to
>> above uri. I am expecting the redirection only for exact term “25th
>> anniversary”.
>>
>>
>>
>> Is there any configuration to make sure that redirection should work on
>> exact match?
>>
>>
>>
>>
>>
>> Thank You!
>>
>

Re: Exact keyword search and redirect term

Posted by Jonathan Rochkind <ro...@jhu.edu>.
There is no configuration.

If:
1) you index your records as type String, with no analysis
2) You always do phrase searches in your query, surround it with double 
quotes. (Neccesary because otherwise queries with spaces in them won't 
be passed intact to the field for matching). (Alternately use the 
'field' or 'raw' query parsers, or that other new one that will be in 
solr 3.1 that i forget the name of).

Then I believe it will work how you say you want, only matching on 
_exact_ matches.   I think, try it out. But beware that 'exact' here 
will REALLY mean 'exact' -- same case, exact same punctuation and 
spacing, exact same bytes. (Same serialization for unicode that can be 
serialized to several different valid byte representations in UTF8, etc)

On 3/31/2011 2:17 PM, Tejinder Rawat wrote:
> Hi All,
>
>
>
> I have many documents indexed based on a field having value “anniversary”.
>
>
>
> Also there is a redirect term which is having “anniversary” inside this.
> E.g. below:
>
>
>
> ------------------
>
>      <field name="docType_meta_s">termRedirect</field>
>
>     <field
> name="redirectUri_meta_s">/product/silver+25th+anniversary.do</field>
>
>      <field name="redirectTerms_en_us_meta_mv_t">25th anniversary</field>
>
> ------------------
>
>
>
> Now for any search based on “anniversary”, I am getting the redirection to
> above uri. I am expecting the redirection only for exact term “25th
> anniversary”.
>
>
>
> Is there any configuration to make sure that redirection should work on
> exact match?
>
>
>
>
>
> Thank You!
>