You can do a custom transformer in DIH which will do a default value.
If you do, it could be a good one to contribute.

Otherwise, you can have two different DIH handlers defined in
solrconfig.xml with different UpdateRequestProcessor chains and use
http://lucene.apache.org/solr/4_0_0/solr-core/org/apache/solr/update/processor/DefaultValueUpdateProcessorFactory.html
.

There is always more than one interceptor option in Solr. :-)

Regards,
   Alex.
Personal blog: http://blog.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all
at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
book)


On Fri, May 31, 2013 at 11:05 AM, Hans-Peter Stricker
<stric...@epublius.de> wrote:
> On the other side: I have a problem. Because I want to give some entities a
> default value "A" and others default value "B" - which I could do inside a
> <field>inside of<entity> in data-config.xml but not inside a <field> in
> schema.xml.
>
>
> --------------------------------------------------
> From: "Shalin Shekhar Mangar" <shalinman...@gmail.com>
> Sent: Friday, May 31, 2013 4:59 PM
> To: <solr-user@lucene.apache.org>
> Subject: Re: dataConfig DTD or schema
>
>> DataImportHandler does not support specifying default values for a field.
>> However, the solr schema.xml lets you specify defaults. So, modify the
>> corresponding field inside solr's schema.xml. For example:
>>
>> <field name="letit" type="text" indexed="true" stored="true"
>> default="BE"/>
>>
>>
>> On Fri, May 31, 2013 at 8:20 PM, Hans-Peter Stricker
>> <stric...@epublius.de>wrote:
>>
>>> I wonder how to pass default values via <dataConfig>, e.g. like this:
>>>
>>> <dataConfig>
>>>    <dataSource />
>>>    <document>
>>>        <entity>            <field column="letit">BE</field>
>>>        </entity>
>>>    </document>
>>> </dataConfig>
>>>
>>> or like this:
>>>
>>> <dataConfig>
>>>    <dataSource />
>>>    <document>
>>>        <entity>            <field column="letit" value="BE"/>
>>>        </entity>
>>>    </document>
>>> </dataConfig>
>>>
>>> In the course of this, I did not find a DTD or Schema for <dataConfig>.
>>>
>>> Any hint is appreciated!!
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Regards,
>> Shalin Shekhar Mangar.
>>
>

Reply via email to