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 Spadez <ja...@hotmail.com> on 2012/12/06 13:10:38 UTC

Put straight to a copyfield

Hi,

I currently have this setup:

Bring in data into the "description" schema and then have this code:

<copyField source="description" dest="truncated_description"
maxChars="168"/>

To then truncate the description and move it to "truncated_description".
This works fine.

I was wondering, is it possible so that when I bring in data from another
source I actually bring it straight in to "truncated_description", like
this:

DIH Source 1: Bring into "description" and copyfield moves it to
"truncated_description"
DIH Source 2: Bring pre-truncated description straight into
"truncated_description"



--
View this message in context: http://lucene.472066.n3.nabble.com/Put-straight-to-a-copyfield-tp4024761.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Put straight to a copyfield

Posted by Gora Mohanty <go...@mimirtech.com>.
On 6 December 2012 17:40, Spadez <ja...@hotmail.com> wrote:
> Hi,
>
> I currently have this setup:
>
> Bring in data into the "description" schema and then have this code:
>
> <copyField source="description" dest="truncated_description"
> maxChars="168"/>
>
> To then truncate the description and move it to "truncated_description".
> This works fine.
>
> I was wondering, is it possible so that when I bring in data from another
> source I actually bring it straight in to "truncated_description", like
> this:
>
> DIH Source 1: Bring into "description" and copyfield moves it to
> "truncated_description"
> DIH Source 2: Bring pre-truncated description straight into
> "truncated_description"

Yes, instead of using a copyField directive, you could import the data
straight into the destination field of the copyField. There is nothing
special about the destination field, and it behaves just as another
index field. Of course, you would need to do the truncation outside
Solr, or through a script transformer.

Maybe it would help if you explained what you wanted to achieve.
In general, a copyField should be faster than a separate DIH entity.

Regards,
Gora