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

  • Home
  • SEARCH
  • 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 8869131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:24:38+00:00 2026-06-14T17:24:38+00:00

I am using Lucene in a web application. Lucene is used to create index

  • 0

I am using Lucene in a web application.
Lucene is used to create index when an article is added.
Since only one IndexWriter instance may exist for an index directory, I use a singleton IndexWriter for the application.

  1. When should I close IndexWriter to commit all documents to the index directory?
  2. If the web server (tomcat) goes down, how should I recover the uncommitted documents? Has Lucene offered any ways to recover from a crash?
  • 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-14T17:24:40+00:00Added an answer on June 14, 2026 at 5:24 pm

    when should I close IndexWriter to commit all documents to the index directory?

    If you are much worried about the data loss, commit as frequently as you can (can do even after each document). You can still keep old reader(s) hanging around and reopen them later if the search freshness isn’t crucial.

    if the web server(tomcat) goes down, how should I recover the uncommitted documents?
    Has Lucene offered any ways to recover from a crash?

    Lucene is atomic – as soon as you exit writer.commit() or writer.close(), the changes are persisted to the disk and can be read afterwards. I think this should be enough.

    Don’t forget: Lucene is only a search library. It is your responsibility to ensure the application doesn’t crash. Even if it does, it is your responsibility to implement a recovery strategy. Lucene already does a pretty decent job with regards to atomicity.

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

Sidebar

Related Questions

I am using a read-only Lucene.NET index in a web application and creating a
I'm using Lucene to search an index and it works fine. My only issue
Am using Lucene API in a .net web application. I want to use the
I'm using Lucene search API in a web based application. Which method of Lucene's
Am working on web based Job search application using Lucene.User on my site can
I am using couchdb-lucene in my web application. I have a feature where I
I'm using Lucene, and I'm trying to find a way to index and retrieve
I am trying to put together a test case for using Lucene.NET on one
I have a single XML file that I want to index using Lucene.NET. The
I am planing to add search feature in my web application. I am using

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.