@ThreadSafe public class DefaultIndexEngine extends Object
IndexSearcher and Writer.
Gets passed searcher and writer factories that create new instances of these when required.
getSearcher() - returns an IndexSearcher with a frozen view of the current index; the client is responsible for
closing the IndexSearcher when finished. IndexSearcher are shared between clients. getSearcher() creates
a new IndexSearcher only if there was some changes on the index.
Clients which received a UnmanagedIndexSearcher via getSearcher() are responsible for closing
it via UnmanagedIndexSearcher.close().
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultIndexEngine.FlushPolicy
How to perform an actual write to the writer.
|
protected static class |
DefaultIndexEngine.WriterReference
Thread-safe holder of the current Writer
|
| Modifier and Type | Method and Description |
|---|---|
void |
clean()
Clean (wipe) the index.
|
void |
close()
Wait till any open Searchers are closed and then close the connection.
|
UnmanagedIndexSearcher |
getSearcher()
Get the current searcher.
|
void |
write(Index.Operation operation) |
@Nonnull public UnmanagedIndexSearcher getSearcher()
UnmanagedIndexSearcher that reflects the latest writes to the index.public void clean()
public void write(@Nonnull Index.Operation operation) throws IOException
IOExceptionpublic void close()
Copyright © 2002-2024 Atlassian. All Rights Reserved.