Esempio n. 1
0
        public SolrInputDocument ReadSolrInputDocument(FastInputStream dis)
        {
            int               sz       = ReadVInt(dis);
            float?            docBoost = (float?)ReadVal(dis);
            SolrInputDocument sdoc     = new SolrInputDocument();

            sdoc.Boost = docBoost;
            for (int i = 0; i < sz; i++)
            {
                float  boost = 1.0f;
                String fieldName;
                Object boostOrFieldName = ReadVal(dis);
                if (boostOrFieldName is float)
                {
                    boost     = (float)boostOrFieldName;
                    fieldName = (String)ReadVal(dis);
                }
                else
                {
                    fieldName = (String)boostOrFieldName;
                }
                Object fieldVal = ReadVal(dis);
                sdoc[fieldName] = new SolrInputField(fieldName, fieldVal, boost);
            }
            return(sdoc);
        }
Esempio n. 2
0
 public SolrInputDocument ReadSolrInputDocument(FastInputStream dis)
 {
     int sz = ReadVInt(dis);
     float? docBoost = (float?)ReadVal(dis);
     SolrInputDocument sdoc = new SolrInputDocument();
     sdoc.Boost = docBoost;
     for (int i = 0; i < sz; i++)
     {
         float boost = 1.0f;
         String fieldName;
         Object boostOrFieldName = ReadVal(dis);
         if (boostOrFieldName is float)
         {
             boost = (float)boostOrFieldName;
             fieldName = (String)ReadVal(dis);
         }
         else
         {
             fieldName = (String)boostOrFieldName;
         }
         Object fieldVal = ReadVal(dis);
         sdoc[fieldName] = new SolrInputField(fieldName, fieldVal, boost);
     }
     return sdoc;
 }