I feel like the default option is a little hacky plus I'll probably be sharing my schema.xml for multiple cores using dynamic field types.
I can't believe there isnt an easy way to specify this. So my only options is something like this? <document> <entity name="item" transformer="TemplateTransformer" query="select * from items"> <field name="my_field" template="static_value_not_from_db"/> .... </entity> </document> What if I don't need a template transformer for all the other fields? Is it ok to mix and match? Will this effect performance at all? Thanks again! Ahmet Arslan 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> >> > > I didn't do it by-myself but i think it can be done with > TemplateTransformer[1] with something like: > > <field column="my_field" template="static_value_not_from_db" /> > > Alternatively you can define default value of a field in schema.xml: > > <field name="timestamp" type="date" indexed="true" stored="true" > default="NOW" multiValued="false"/> > > [1] http://wiki.apache.org/solr/DataImportHandler#TemplateTransformer > > > > > -- View this message in context: http://old.nabble.com/DIH-field-options-tp27873996p27880065.html Sent from the Solr - User mailing list archive at Nabble.com.