Package org.apache.lucene.index

Examples of org.apache.lucene.index.IndexWriter.updateDocument()


        docExisting.removeFields("lastCommitedModifiedDate");
        docExisting.add(new Field("lastCommitedModifiedDate", "" + new Date().getTime(), Field.Store.YES, Field.Index.NOT_ANALYZED));
        //docExisting.add(new Field("meta", new StringReader("indexAllRunning")));
        //docExisting.add(new Field("meta", "indexAllRunning", Field.Store.YES, Field.Index.NOT_ANALYZED));
         
        writer.updateDocument(term, docExisting);
        //System.out.println("Updating doc...:" + docExisting);
        //Term t = new Term("meta", "indexAllRunning");
        break;
      }
    }
View Full Code Here


            }
            else
            {
                term = new Term(EmbeddedEntityFieldName, id);
            }
            w.updateDocument(term, document);

        }
        catch (LuceneIndexingException lie)
        {
            log.error("Error while updating LuceneIndexer, Caused by :.", lie);
View Full Code Here

    final String docID = doc.get(DocMaker.ID_FIELD);
    if (docID == null) {
      throw new IllegalStateException("document must define the docid field");
    }
    final IndexWriter iw = getRunData().getIndexWriter();
    iw.updateDocument(new Term(DocMaker.ID_FIELD, docID), doc);
    return 1;
  }

  @Override
  protected String getLogMessage(int recsCount) {
View Full Code Here

    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);
    assertFalse(r1.isCurrent());

    IndexReader r2 = writer.getReader();
    assertTrue(r2.isCurrent());
    assertEquals(0, count(new Term("id", id10), r2));
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.