You can use mysql , select *, “staticdata” as staticdata from table x.
As long as your  field name is staticdata, this should add it there.


On 3/12/10 8:39 AM, "Tommy Chheng" <tommy.chh...@gmail.com> wrote:

 Haven't tried this myself but try adding a default value  and don't
specify it during the import.
http://wiki.apache.org/solr/SchemaXml


On 3/12/10 7:56 AM, blargy wrote:
> Forgive me but I'm slightly retarded... I grew up underneath some power lines
> ;)
>
> I've read through that wiki but I still can't find what I'm looking for. I
> just want to give one of the DIH entities/fields a static value (ie it
> doesnt come from a database column). How can I configure this?
>
> FYI this is data-config.xml not schema.xml.
>
>    <document>
>      <entity name="item" query="select * from items">
>        <field name="my_field"  column="static_value_not_from_db"/>
>        ....
>      </entity>
>    </document>
>
>
>
>
> Tommy Chheng-4 wrote:
>>    The wiki page has most of the info you need
>> *http://wiki*.apache.org/*solr*/DataImportHandler
>>
>> To use multi-value fields, your schema.xml must define it with
>> multiValued="true"
>>
>>
>> On 3/11/10 10:58 PM, blargy wrote:
>>> How can you simply add a static value like?<field name="id"
>>> value="123"/>
>>> How does one add a static multi-value field?<field name="category_ids"
>>> values="123, 456"/>
>>>
>>> Is there any documentation on all the options for the field tag in
>>> data-config.xml?
>>>
>>> Thanks for the help
>> --
>> Tommy Chheng
>> Programmer and UC Irvine Graduate Student
>> Twitter @tommychheng
>> http://tommy.chheng.com
>>
>>
>>

--
Tommy Chheng
Programmer and UC Irvine Graduate Student
Twitter @tommychheng
http://tommy.chheng.com


Reply via email to