Mailing List
Home
Forum Home
Maven - Project building tool
Axis - Java SOAP implementation
Cocoon - MVC web framework based on XML/XSL
Lucene - Full-featured text search engine APIs
Log4J - A log library
Fop - Create PDF, PCL, PS, SVG, XML driven by XSL formatting objects.
POI - Java Excel, Word and other Microsoft Office files manipulating library
Oracle database error code ...
Subjects
log4j warning: No appenders could be found
java security AccessControlException: access denied (java io FilePermission clie
java lang InstantiationException: org apache tools ant Main
Apache Axis Tutorial
Struts <logic iterate >
log4j properties How to parse outpu to multiple files
configuring log4j with BEA Weblogic 8 1
How to use XSL FOP Java together
JSP precompile
Servlet File Download dialog problem (IE6,Adobe 6 0)
Proposal: Adding jar manifest classpath in jar and war plugins
Unsupported major minor version 48 0 problem while running the an
   telope task
java security AccessControlException: access denied (java io FilePermission
axis wsdl2java Ant Task usage
net sf hibernate MappingException: Error reading resource: test/User hbm xml
Building EAR ANT Script for websphere 5 0
CREATING WAR Files
jsp data into Excel
Classpath problem
Jboss 3 2 3+ vs Tomcat Axis Question
RE: How to include jars and add them into the MANIFEST MF/Class Path
attribute
Printing problem
InstantiationException
Couldn 't find trusted certificate
Please : How can one install ant 1 6 0 under Eclipse 2 1 ?
Excel: Too many different cell formats
Running junit tests fails
XDoclet, Struts and Maven: Where to start? SOLUTION
1 3 final: now giving me java io FileNotFoundException (Too many
open files)
AXIS: tomcat timeout ?
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
locking problems

locking problems

2004-10-08       - By Doug Cutting

 Back
Reply:     1     2  

Aad Nales wrote:
> 1. can I have one or multiple searchers open when I open a writer?
> 2. can I have one or multiple readers open when I open a writer?

Yes, with one caveat: if you've called the IndexReader methods delete(),
undelete() or setNorm() then you may not open an IndexWriter until
you've closed that IndexReader instance.

In general, only a single object may modify an index at once, but many
may access it simultaneously in a read-only manner, including while it
is modified.  Indexes are modified by either an IndexWriter or by the
IndexReader methods delete(), undelete() and setNorm().

Typically an application which modifies and searches simultaneously
should keep the following open:

  1. A single IndexReader instance used for all searches, perhaps
opened via an IndexSearcher.  Periodically, as the index changes, this
is discarded, and replaced with a new instance.

  2. Either:
     a. An IndexReader to delete documents.
     b. An IndexWriter to add documents; or

So an updating thread might open (2a), delete old documents, close it,
then open (2b) add new documents, perhaps optimize, then close.  At this
point, when the index has been updated (1) can be discarded and replaced
with a new instance.  Typically the old instance of (1) is not
explicitly closed, rather the garbage collector closes it when the last
thread searching it completes.

Doug

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: lucene-user-unsubscribe@(protected)
For additional commands, e-mail: lucene-user-help@(protected)


Earn $52 per hosting referral at Lunarpages.