Could you give us a bit more information? How are you getting this information into Solr? SolrJ? DataImportHandler? It's hard to see where the null value is getting dropped, if we don't know the path that it is coming in.
I suspect that the default attribute won't do it. It's possible that you might be able to do something with an UpdateRequestProcessor. But I'm afraid the null values may be gone by that point. If I knew how you were getting the data in, it would be easier to check. Tom On Fri, Dec 10, 2010 at 2:20 PM, bbarani <bbar...@gmail.com> wrote: > > 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. >