Hi,

I have a multivalued field for which some of the records have null or empty
data in it.

Since its difficult to parse and match empty XML tags in SOLR ouput, I
thought I would assign a default value for those empty data as below.

<field name="related_uid" type="string" indexed="true" stored="true"
multiValued="true" default="NODATA"/>

But my approach is not working if this field has atleast one data it. It
works fine if all the data for multi valued field is null.

For Ex:

If I am retreiving a data from a field called gender from backend and
assigning to this multivalued field(gender field in backend might contain
null too)

Data might be something lilke

Male
NULL
Female
Male

I am getting the XML output after indexing as 
- <arr name="related_name">
<str>Male</str> 
<str>Female</str> 
<str>Male</str> 
 </arr>


I want to get something like.

- <arr name="related_name">
<str>Male</str> 
<str>NODATA</str> 
<str>Female</str> 
<str>Male</str> 
 </arr>


Is it possible to implement this using SOLR default attribute?

Thanks,
Barani


-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/Is-it-possible-to-assign-default-value-for-a-particular-record-when-using-multivalued-field-type-tp2066167p2066167.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to