Examples of removeField()


Examples of org.apache.lucene.document.Document.removeField()

      Field f = new TextField(floatTestField, "" + nextFloat, Field.Store.YES);
      f.setBoost(nextFloat);

      doc.add(f);
      writer.addDocument(doc);
      doc.removeField(floatTestField);
      if (rarely()) {
        writer.commit();
      }
    }
    writer.commit();
View Full Code Here

Examples of org.apache.lucene.document.Document.removeField()

                      for(Document subDoc : docsList) {
                        nrt.addDocument(subDoc);
                      }
                      */
                    }
                    doc.removeField("packID");

                    if (random.nextInt(5) == 2) {
                      if (VERBOSE) {
                        System.out.println(Thread.currentThread().getName() + ": buffer del id:" + packID);
                      }
View Full Code Here

Examples of org.apache.lucene.document.Document.removeField()

                    }
                  }
                  toDeleteSubDocs.clear();
                }
                if (addedField != null) {
                  doc.removeField(addedField);
                }
              } catch (Throwable t) {
                System.out.println(Thread.currentThread().getName() + ": FAILED: hit exc");
                t.printStackTrace();
                failed.set(true);
View Full Code Here

Examples of org.apache.lucene.document.Document.removeField()

        Document doc = r.document(r.maxDoc() - 1);
        Field sid = doc.getField(SNAPSHOTS_ID);
        if (sid == null) {
          throw new IllegalStateException("directory is not a valid snapshots store!");
        }
        doc.removeField(SNAPSHOTS_ID);
        for (Fieldable f : doc.getFields()) {
          snapshots.put(f.name(), f.stringValue());
        }
      } else if (numDocs != 0) {
        throw new IllegalStateException(
View Full Code Here

Examples of org.apache.lucene.document.Document.removeField()

    IndexReader r1 = writer.getReader();

    String id10 = r1.document(10).getField("id").stringValue();
   
    Document newDoc = r1.document(10);
    newDoc.removeField("id");
    newDoc.add(new Field("id", Integer.toString(8000), Store.YES, Index.NOT_ANALYZED));
    writer.updateDocument(new Term("id", id10), newDoc);

    IndexReader r2 = writer.getReader();
    assertEquals(0, count(new Term("id", id10), r2));
View Full Code Here

Examples of org.apache.lucene.document.Document.removeField()

    assertTrue(r1.isCurrent());

    String id10 = r1.document(10).getField("id").stringValue();
   
    Document newDoc = r1.document(10);
    newDoc.removeField("id");
    newDoc.add(newField("id", Integer.toString(8000), Store.YES, Index.NOT_ANALYZED));
    writer.updateDocument(new Term("id", id10), newDoc);
    assertFalse(r1.isCurrent());

    IndexReader r2 = writer.getReader();
View Full Code Here

Examples of org.apache.lucene.document.Document.removeField()

            + "configure the updateattribute column also in the " + "'columns' configuration parameter.");

      } else {
        String updateTimestamp = updateTimestampObject.toString();
        if (updateTimestamp != null && !"".equals(updateTimestamp)) {
          newDoc.removeField(timestampAttribute);
          newDoc.add(new Field(timestampattribute, updateTimestamp.toString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
        }
      }
    }
View Full Code Here

Examples of org.apache.lucene.document.Document.removeField()

      if (idAttribute.equalsIgnoreCase(attributeName) && !filled) {
        newDoc.add(new Field(idAttribute, value.toString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
      } else if (value != null) {
        if (filled) {
          newDoc.removeField(attributeName);
        }
        Store storeFieldStore;
        if (storeField) {
          storeFieldStore = Store.YES;
        } else {
View Full Code Here

Examples of org.apache.lucene.document.Document.removeField()

      int boost = random().nextInt(255);
      Field f = new TextField(byteTestField, "" + boost, Field.Store.YES);
      f.setBoost(boost);
      doc.add(f);
      writer.addDocument(doc);
      doc.removeField(byteTestField);
      if (rarely()) {
        writer.commit();
      }
    }
    writer.commit();
View Full Code Here

Examples of org.apache.lucene.document.Document.removeField()

      Document doc = new Document();
      doc.add(new StringField("key", "doc", Store.NO));
      doc.add(new NumericDocValuesField("ndv", -1));
      int numDocs = atLeast(30);
      for (int i = 0; i < numDocs; i++) {
        doc.removeField("id");
        doc.add(new StringField("id", Integer.toString(docid++), Store.NO));
        writer.addDocument(doc);
      }
     
      long value = rnd + 1;
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.