Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8689015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:31:40+00:00 2026-06-12T23:31:40+00:00

I am using updateDocument() method to update my document in the lucene index. Here

  • 0

I am using updateDocument() method to update my document in the lucene index. Here is how I am doing it.

writer.updateDocument(new Term(Constants.DOC_ID_FIELD, doc.get(Constants.DOC_ID_FIELD)), doc);

I check my index data with Luke, and find that on second run of the indexing, Luke tells that Deleted Document - not available. So basically, the document is marked as deleted, but it still resides in the index.

I don’t want to keep these marked deleted documents. Am I doing it wrong?

Also, my understanding was that, when I am updating the document, it deletes the old one and then adds the new one. Is that not the case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:31:41+00:00Added an answer on June 12, 2026 at 11:31 pm

    Got the answer from the mailing list.

    IndexWriter.updateDocument() deletes and then adds. So your index will have deleted docs. Why do you care? They’ll go away eventually as segments get merged.

    If you really do care, see IndexWriter,forceMergeDeletes(). See also
    the javadoc for that: This is often a horribly costly operation; rarely is it warranted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create (and update frequently) the index of users using following code (a bit
Using the Qt library, is there a way to automatically update a QDateTimeEdit using
@using(Html.BeginForm(About, User, FormMethod.Post , new { id=aboutme})) { <fieldset> <ul> <li> <label class=block>About me</label>
I want to make a general method to do PARTIAL updates of a document
Using linq2sql I'm trying to take the string in txtOilChange and update the oilChange
Using the new mvc4 now gives us access to use facebook oauth otb. I
Using the vim-latexsuite for Gvim, I am editing a fairly large document. It consists
I am using SolrNet to intreract with a Solr index. I have a daemon
Using Code First Entity Framework with .NET MVC 4 I have created a new
Using Tomcat, I build a new WAR via Maven. Then I copy the output

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.