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 Mohamed Parvez <pa...@gmail.com> on 2009/09/11 23:55:41 UTC

Concatenate in Copy Field

Is its possible to concatenate two fields and copy it to a new field, in the
schema.xml file

I am importing from two tables and both have numeric value as primary key.

If i copy just the primary key, which is a number, from both the tables, to
one field and make it primary key, records may get over written.

So i want  create a composite primary key for solar schema by concatenating
two fields.

---
Thanks/Regards,
Parvez

Re: Concatenate in Copy Field

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Sat, Sep 12, 2009 at 3:25 AM, Mohamed Parvez <pa...@gmail.com> wrote:

> Is its possible to concatenate two fields and copy it to a new field, in
> the
> schema.xml file
>
> I am importing from two tables and both have numeric value as primary key.
>
> If i copy just the primary key, which is a number, from both the tables, to
> one field and make it primary key, records may get over written.
>
> So i want  create a composite primary key for solar schema by concatenating
> two fields.
>

Are you using DataImportHandler? If yes, then you can use
TemplateTransformer to achieve this. If not, then you can either concatenate
the values before sending it to Solr or you can write a custom
UpdateRequestProcessor which can do this.

-- 
Regards,
Shalin Shekhar Mangar.