In MySql at least, you can do achieve what I think you want by
manipulating the SQL, like this:

mysql> select "foo" as Constant1, id from Article limit 10;
select "foo" as Constant1, id from Article limit 10;
+-----------+----+
| Constant1 | id |
+-----------+----+
| foo       |  1 |
| foo       |  2 |
| foo       |  3 |
| foo       |  4 |
| foo       |  5 |
| foo       |  6 |
| foo       |  7 |
| foo       |  8 |
| foo       |  9 |
| foo       | 10 |
+-----------+----+
10 rows in set (0.00 sec)

mysql> select 435 as Constant2, id from Article limit 10;
select 435 as Constant2, id from Article limit 10;
+-----------+----+
| Constant2 | id |
+-----------+----+
|       435 |  1 |
|       435 |  2 |
|       435 |  3 |
|       435 |  4 |
|       435 |  5 |
|       435 |  6 |
|       435 |  7 |
|       435 |  8 |
|       435 |  9 |
|       435 | 10 |
+-----------+----+
10 rows in set (0.00 sec)

mysql>

2009/4/8 Shalin Shekhar Mangar <shalinman...@gmail.com>:
> On Wed, Apr 8, 2009 at 10:23 PM, gateway0 <reiterwo...@yahoo.de> wrote:
>
>>
>> The problem as you see is the line:
>> "<field name="definition">Projects</field>"
>>
>> I want to set a constant value for every row in the SQL table but it
>> doesn´t
>> work that way, any ideas?
>>
>
> That is not a valid syntax.
>
> There are two ways to do this:
> 1. In your schema.xml provide the 'default' attribute
> 2. Use TemplateTransformer - see
> http://wiki.apache.org/solr/DataImportHandlerFaq
>
> --
> Regards,
> Shalin Shekhar Mangar.
>



-- 

-

Reply via email to