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 Senthil Kumar <me...@gmail.com> on 2009/04/24 20:42:21 UTC

Copy field : String Vs Text

Hi,
I have a requirement as below. The field needs to be available for facet.
The value will not be a single letter word. But I should be able to search
like a text fields.
<doc>
   <field name="actor">Silver stolen</field>
</doc>

Schema.xml
   <field name="actor"  type="string"  indexed="true"  stored="true"/>
   <field name="name"  type="text"  indexed="true"  stored="true"/>
   <copyField source="actor" dest="text"/>

I should be able to search for the word "silver" on actor field and should
get the result facet as "Silver Stolen". But I am getting the result onle if
I pass the complete "Silver Stolen" to the search query.

Please help me. Am I missing anything in the config?

thanks,
Senthil

Re: Copy field : String Vs Text

Posted by Senthil Kumar <me...@gmail.com>.
Hi Timothy,

In copyfield I used the name that was not part of the doc and matching to
the dynamic text fieldType declaration. It worked.

  <copyField source="actor" dest="gudactor_t"/>
   <dynamicField name="*_t" type="text"    indexed="true"  stored="true"/>

I searched on Q=gudactor:"xxx". It is able to search on actor with full
text...


thanks,
Senthil

On Fri, Apr 24, 2009 at 4:08 PM, Harsch, Timothy J. (ARC-SC)[PEROT SYSTEMS]
<ti...@nasa.gov> wrote:

> I'd be curious to hear someone explain the mechanics of a String field.
>  I'm not entirely sure but I believe a String field is not tokenized and
> thus only exact matches work.  I think in your case you should be searching
> on your "name" field and faceting on the "actor" field.
>
> -----Original Message-----
> From: Senthil Kumar [mailto:mesenthil@gmail.com]
> Sent: Friday, April 24, 2009 11:42 AM
> To: solr-user@lucene.apache.org
> Subject: Copy field : String Vs Text
>
> Hi,
> I have a requirement as below. The field needs to be available for facet.
> The value will not be a single letter word. But I should be able to search
> like a text fields.
> <doc>
>   <field name="actor">Silver stolen</field>
> </doc>
>
> Schema.xml
>   <field name="actor"  type="string"  indexed="true"  stored="true"/>
>   <field name="name"  type="text"  indexed="true"  stored="true"/>
>   <copyField source="actor" dest="text"/>
>
> I should be able to search for the word "silver" on actor field and should
> get the result facet as "Silver Stolen". But I am getting the result onle
> if
> I pass the complete "Silver Stolen" to the search query.
>
> Please help me. Am I missing anything in the config?
>
> thanks,
> Senthil
>

RE: Copy field : String Vs Text

Posted by "Harsch, Timothy J. (ARC-SC)[PEROT SYSTEMS]" <ti...@nasa.gov>.
I'd be curious to hear someone explain the mechanics of a String field.  I'm not entirely sure but I believe a String field is not tokenized and thus only exact matches work.  I think in your case you should be searching on your "name" field and faceting on the "actor" field.

-----Original Message-----
From: Senthil Kumar [mailto:mesenthil@gmail.com] 
Sent: Friday, April 24, 2009 11:42 AM
To: solr-user@lucene.apache.org
Subject: Copy field : String Vs Text

Hi,
I have a requirement as below. The field needs to be available for facet.
The value will not be a single letter word. But I should be able to search
like a text fields.
<doc>
   <field name="actor">Silver stolen</field>
</doc>

Schema.xml
   <field name="actor"  type="string"  indexed="true"  stored="true"/>
   <field name="name"  type="text"  indexed="true"  stored="true"/>
   <copyField source="actor" dest="text"/>

I should be able to search for the word "silver" on actor field and should
get the result facet as "Silver Stolen". But I am getting the result onle if
I pass the complete "Silver Stolen" to the search query.

Please help me. Am I missing anything in the config?

thanks,
Senthil