public void WriteSolrDocument(SolrDocument doc) { WriteTag(SOLRDOC); WriteTag(ORDERED_MAP, doc.Count); foreach (KeyValuePair <string, object> entry in doc) { String name = entry.Key; WriteExternString(name); Object val = entry.Value; WriteVal(val); } }
public SolrDocument ReadSolrDocument(FastInputStream dis) { NamedList nl = (NamedList)ReadVal(dis); SolrDocument doc = new SolrDocument(); for (int i = 0; i < nl.Count; i++) { String name = nl.GetName(i); Object val = nl.GetVal(i); doc.SetField(name, val); } return(doc); }