|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CompassSession
The main interface between a Java application and Compass.
Provides the basic operations with semantic mapped objects (save, delete, and load/get). The session provides operations on both the objects levels and Resource levels (indexed object model). The CompassSession operations are delegated to the underlying SearchEngine, so no direct access to the SearchEngine is needed.
Implementations will not be thread safe, Instead each thread/transaction should obtain its own instance from a Compass.
If the CompassSession throws an exception, the transaction must be rolled back and the session discarded. The internal state of the CompassSession might not be consistent with the search engine if discarded.
Please see the CompassTemplate class for easier programmatic control using the template design pattern.
Resource,
Compass| Method Summary | |
|---|---|
CompassAnalyzerHelper |
analyzerHelper()
Returns an Analyzer helper. |
CompassTransaction |
beginLocalTransaction()
Begins a unit of work using a Compass local transaction. |
CompassTransaction |
beginTransaction()
Begin a unit of work and return the associated CompassTranscation object. |
CompassTransaction |
beginTransaction(CompassTransaction.TransactionIsolation transactionIsolation)
Begin a unit of work and return the associated CompassTranscation object. |
void |
close()
Closes the CompassSession. |
CompassSettings |
getSettings()
Runtimes settings that apply on the session level. |
boolean |
isClosed()
Returns true if the session is closed. |
CompassQueryBuilder |
queryBuilder()
Creats a new query builder, used to build queries programmatically. |
CompassQueryFilterBuilder |
queryFilterBuilder()
Creats a new query filter builder, used to build filters of queries programmatically. |
ResourceFactory |
resourceFactory()
Returns a resource factory allowing to create resources and properties. |
CompassTermFreqsBuilder |
termFreqsBuilder(String... names)
Creates a new terms frequencies builder used to get terms names and freqs for a list of property names. |
| Methods inherited from interface org.compass.core.CompassOperations |
|---|
create, create, delete, delete, delete, delete, delete, delete, delete, evict, evict, evict, evictAll, find, get, get, get, get, getResource, getResource, getResource, getResource, load, load, load, load, loadResource, loadResource, loadResource, loadResource, save, save |
| Method Detail |
|---|
ResourceFactory resourceFactory()
CompassSettings getSettings()
RuntimeCompassEnvironment,
RuntimeLuceneEnvironment
CompassTransaction beginTransaction()
throws CompassException
compass.transaction.factory.
CompassExceptionCompassTransaction
CompassTransaction beginTransaction(CompassTransaction.TransactionIsolation transactionIsolation)
throws CompassException
compass.transaction.factory.
Also accepts the transcation isolation of the transaction.
transactionIsolation -
CompassExceptionCompassTransaction
CompassTransaction beginLocalTransaction()
throws CompassException
CompassException
CompassQueryBuilder queryBuilder()
throws CompassException
CompassException
CompassQueryFilterBuilder queryFilterBuilder()
throws CompassException
CompassException
CompassTermFreqsBuilder termFreqsBuilder(String... names)
throws CompassException
Note, term frequencies are updated to reflect latest changes to the index only after an optimization as take place (note, calling optimize might not cause optimization).
names - The property names
CompassException
CompassAnalyzerHelper analyzerHelper()
throws CompassException
CompassException
void close()
throws CompassException
CompassExceptionCompass.openSession()boolean isClosed()
true if the session is closed. Note, if this session
"joined" another session, it won't actually be closed, and defer closing
the session to the outer session.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||