Hi Jimi,
I don’t think that you can do it using schema, but you could do it using custom 
update request processor chain. I quickly scanned to see if there is such 
processor and could not find one. The closest one is 
https://lucene.apache.org/solr/6_6_0//solr-core/org/apache/solr/update/processor/DefaultValueUpdateProcessorFactory.html
 
<https://lucene.apache.org/solr/6_6_0//solr-core/org/apache/solr/update/processor/DefaultValueUpdateProcessorFactory.html>
It should not be too hard to adjust it to do what you need.

HTH,
Emir

--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 3 Oct 2017, at 14:10, jimi.hulleg...@svensktnaringsliv.se wrote:
> 
> Hi,
> 
> Is it possible using some Solr schema magic to make solr get the default 
> value for a field from another field? Ie, if the value is specified in the 
> document to be indexed, then that value is used. Otherwise it uses the value 
> of another field. As far as I understand it, the field property "default" 
> only takes a static value, not a reference to another field. And the 
> copyField element doesn't solve this problem either, since it will result in 
> two values if the field was specified in the document, and I only want a 
> single value.
> 
> /Jimi

Reply via email to