Package org.apache.solr.common

Examples of org.apache.solr.common.SolrInputDocument.addField()


    solr.add(doc);
    //add in some random other docs
    Collection<SolrInputDocument> docs = new HashSet<SolrInputDocument>();
    for (int i = 0; i < 100; i++) {
      doc = new SolrInputDocument();
      doc.addField("id", "http://www.tamingtext.com/" + i + ".html");
      doc.addField("mimeType", "text/html");
      doc.addField("title", "This is title " + i);
      now = new Date(150 * i + i + 20);//create some dates
      doc.addField("date", DateUtil.getThreadLocalDateFormat().format(now));
      doc.addField("description", "This is description number: " + i
View Full Code Here


    //add in some random other docs
    Collection<SolrInputDocument> docs = new HashSet<SolrInputDocument>();
    for (int i = 0; i < 100; i++) {
      doc = new SolrInputDocument();
      doc.addField("id", "http://www.tamingtext.com/" + i + ".html");
      doc.addField("mimeType", "text/html");
      doc.addField("title", "This is title " + i);
      now = new Date(150 * i + i + 20);//create some dates
      doc.addField("date", DateUtil.getThreadLocalDateFormat().format(now));
      doc.addField("description", "This is description number: " + i
              + " of something that is very important.");
View Full Code Here

    Collection<SolrInputDocument> docs = new HashSet<SolrInputDocument>();
    for (int i = 0; i < 100; i++) {
      doc = new SolrInputDocument();
      doc.addField("id", "http://www.tamingtext.com/" + i + ".html");
      doc.addField("mimeType", "text/html");
      doc.addField("title", "This is title " + i);
      now = new Date(150 * i + i + 20);//create some dates
      doc.addField("date", DateUtil.getThreadLocalDateFormat().format(now));
      doc.addField("description", "This is description number: " + i
              + " of something that is very important.");
      docs.add(doc);
View Full Code Here

      doc = new SolrInputDocument();
      doc.addField("id", "http://www.tamingtext.com/" + i + ".html");
      doc.addField("mimeType", "text/html");
      doc.addField("title", "This is title " + i);
      now = new Date(150 * i + i + 20);//create some dates
      doc.addField("date", DateUtil.getThreadLocalDateFormat().format(now));
      doc.addField("description", "This is description number: " + i
              + " of something that is very important.");
      docs.add(doc);
    }

View Full Code Here

      doc.addField("id", "http://www.tamingtext.com/" + i + ".html");
      doc.addField("mimeType", "text/html");
      doc.addField("title", "This is title " + i);
      now = new Date(150 * i + i + 20);//create some dates
      doc.addField("date", DateUtil.getThreadLocalDateFormat().format(now));
      doc.addField("description", "This is description number: " + i
              + " of something that is very important.");
      docs.add(doc);
    }

    solr.add(docs);
View Full Code Here

              if(!uniqList.contains(o))
                uniqList.add(o);
            }
            solrInputDocument.remove(field);
            for (Object o : uniqList) {
              solrInputDocument.addField(field, o);
            }
          }   
        }
      }
      super.processAdd(cmd);
View Full Code Here

          int idx = i<<1;
          arr[idx]= StrUtils.HEX_DIGITS[(b >> 4) & 0xf];
          arr[idx+1]= StrUtils.HEX_DIGITS[b & 0xf];
        }
        String sigString = new String(arr);
        doc.addField(signatureField, sigString);

        if (overwriteDupes) {
          cmd.updateTerm = signatureTerm.createTerm(sigString);
        }
View Full Code Here

        case XMLStreamConstants.END_ELEMENT:
          if ("doc".equals(parser.getLocalName())) {
            return doc;
          } else if ("field".equals(parser.getLocalName())) {
            if (!isNull) {
              doc.addField(name, text.toString(), boost);
              boost = 1.0f;
            }
          }
          break;
View Full Code Here

   */
  public static SolrInputDocument toSolrInputDocument( SolrDocument d )
  {
    SolrInputDocument doc = new SolrInputDocument();
    for( String name : d.getFieldNames() ) {
      doc.addField( name, d.getFieldValue(name), 1.0f );
    }
    return doc;
  }

  /**
 
View Full Code Here

              throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
                      "All documents must contain a unique key value: '" + doc.toString() + "'");
            }
            return doc;
          } else if ("field".equals(reader.getLocalName())) {
            doc.addField(fieldName, text.toString(), DEFAULT_BOOST);
            if (uniqueKeyField.equals(fieldName)) {
              hasId = true;
            }
          }
          break;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.