com.mysema.query.lucene.session.impl
Class LuceneSessionImpl

java.lang.Object
  extended by com.mysema.query.lucene.session.impl.LuceneSessionImpl
All Implemented Interfaces:
LuceneSession

public class LuceneSessionImpl
extends Object
implements LuceneSession


Constructor Summary
LuceneSessionImpl(LuceneSessionFactoryImpl sessionFactory, boolean readOnly)
           
 
Method Summary
 LuceneWriter beginAppend()
          Adds documents to index.
 LuceneWriter beginReset()
          Resets the whole index and starts new writer.
 void close()
          Closes the session.
 LuceneQuery createQuery()
          Creates a new query.
 void flush()
          Flushes all data writer has changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneSessionImpl

public LuceneSessionImpl(LuceneSessionFactoryImpl sessionFactory,
                         boolean readOnly)
Method Detail

createQuery

public LuceneQuery createQuery()
Description copied from interface: LuceneSession
Creates a new query.

Specified by:
createQuery in interface LuceneSession
Returns:
LuceneQuery instance

beginAppend

public LuceneWriter beginAppend()
Description copied from interface: LuceneSession
Adds documents to index. Creates a new index if the index is not available.

Specified by:
beginAppend in interface LuceneSession
Returns:
LuceneWriter instance

beginReset

public LuceneWriter beginReset()
Description copied from interface: LuceneSession
Resets the whole index and starts new writer. Old readers will still see the index as it was when they were opened but new readers will see only the data this writer has committed.

Specified by:
beginReset in interface LuceneSession
Returns:
LuceneWriter instance

close

public void close()
Description copied from interface: LuceneSession
Closes the session. All writes are committed and resources are cleared. This should always be called in finally block if this session was created explicitly by calling session factory's openSession

Specified by:
close in interface LuceneSession

flush

public void flush()
Description copied from interface: LuceneSession
Flushes all data writer has changed. Queries created after this will see the new index. Queries created before, will see the old snapshot.

Specified by:
flush in interface LuceneSession


Copyright © 2007-2010 Mysema Ltd. All Rights Reserved.