multi value field search

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

multi value field search

Ronen
Hi guys,

I have a problem that I hope you guys can help with.  I have a multi-value field that I use to store the alias names of companies. For example, in Canada, the bank CIBC actually stands for Canadian Imperial Bank of Commerce, so I'm storing both of these (short name and long name) in a multi-value field.  At index time, I'd like to tokenize this field so that a search for "bank" will return this record. I have this working using the field type "text_ws".

The problem I have is that at search time, I have faceting turned on for this field and therefore, I get the four facets "canadian", "imperial", "bank", and "commerce", which all refer to the same record.

How can I go about searching for any word contained in the company name but then return the entire company name as one facet?

Thanks for your help.
--Ronen
Reply | Threaded
Open this post in threaded view
|

RE: multi value field search

Michael Ryan
> The problem I have is that at search time, I have faceting turned on for
> this field and therefore, I get the four facets "canadian", "imperial",
> "bank", and "commerce", which all refer to the same record.
>
> How can I go about searching for any word contained in the company name but
> then return the entire company name as one facet?

The typical way to do this is to have two fields with the same data - one for faceting and one for searching. The faceted field can just be a plain StrField.

-Michael
Reply | Threaded
Open this post in threaded view
|

Re: multi value field search

lee carroll
You could use a synonyms file for the alternative names. That way you
do not need to store only index the alternatives.
For faceting use a field were the analysis chain does not use the
synonyms filter. For search the analysis chain will.
You also get the benefit of only storing the normative values so
display is easy.





On 18 December 2011 02:16, Michael Ryan <[hidden email]> wrote:

>> The problem I have is that at search time, I have faceting turned on for
>> this field and therefore, I get the four facets "canadian", "imperial",
>> "bank", and "commerce", which all refer to the same record.
>>
>> How can I go about searching for any word contained in the company name but
>> then return the entire company name as one facet?
>
> The typical way to do this is to have two fields with the same data - one for faceting and one for searching. The faceted field can just be a plain StrField.
>
> -Michael
Reply | Threaded
Open this post in threaded view
|

RE: multi value field search

Ronen
In reply to this post by Michael Ryan
Many thanks.. I took the suggestion of using a <copyField/> and it did the trick.

--Ronen