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 Radha Krishna Reddy <ra...@gmail.com> on 2011/11/01 18:37:28 UTC

index enum

Hi,

I have 2 issues.

1. I have an enum column in my sql table.i want to index that column.which
fieldtype should i specify in the schema.xml for enum?

2. Normally we can index one column in a table using the  column header as
entity name and the column data as value of the entity.Can i index 2 column
where one column will be the entity name and the other will be the value of
the entity in the data-config.xml?


Thanks and Regards,
Radhakrishna

Re: index enum

Posted by Radha Krishna Reddy <ra...@gmail.com>.
Hi Gora,

Thanks for the replay.

First question is clear.

Second,How can i index 2 column where one column will be the entity name
and the other will be the value of the entity in the data-config.xml? is it
possible to provide me some sample?

Thanks and Regards,
Radhakrishna Reddy.

On Wed, Nov 2, 2011 at 2:43 PM, Gora Mohanty <go...@mimirtech.com> wrote:

> On Tue, Nov 1, 2011 at 11:07 PM, Radha Krishna Reddy
> <ra...@gmail.com> wrote:
> [...]
> > 1. I have an enum column in my sql table.i want to index that
> column.which
> > fieldtype should i specify in the schema.xml for enum?
>
> I presume that you are using the DataImportHandler for indexing.
>
> You will need to convert the enum value into an int (or, whatever is
> appropriate). This can be done in the SQL statement that fetches
> the data, or in a script processor in data-config.xml.
>
> > 2. Normally we can index one column in a table using the  column header
> as
> > entity name and the column data as value of the entity.Can i index 2
> column
> > where one column will be the entity name and the other will be the value
> of
> > the entity in the data-config.xml?
>
> Yes, you can.
>
> Regards,
> Gora
>

Re: index enum

Posted by Gora Mohanty <go...@mimirtech.com>.
On Tue, Nov 1, 2011 at 11:07 PM, Radha Krishna Reddy
<ra...@gmail.com> wrote:
[...]
> 1. I have an enum column in my sql table.i want to index that column.which
> fieldtype should i specify in the schema.xml for enum?

I presume that you are using the DataImportHandler for indexing.

You will need to convert the enum value into an int (or, whatever is
appropriate). This can be done in the SQL statement that fetches
the data, or in a script processor in data-config.xml.

> 2. Normally we can index one column in a table using the  column header as
> entity name and the column data as value of the entity.Can i index 2 column
> where one column will be the entity name and the other will be the value of
> the entity in the data-config.xml?

Yes, you can.

Regards,
Gora