public class DefaultIndexReaderAccessor extends Object implements IndexReaderAccessor
Constructor and Description |
---|
DefaultIndexReaderAccessor(ImmutableSearchFactory immutableSearchFactory) |
Modifier and Type | Method and Description |
---|---|
void |
close(IndexReader indexReader)
Closes IndexReader instances obtained using
IndexReaderAccessor.open(Class...) |
IndexReader |
open(Class<?>... entities)
Opens an IndexReader on all indexes containing the entities passed as parameter.
|
IndexReader |
open(String... indexNames)
Opens an IndexReader on all named indexes.
|
public DefaultIndexReaderAccessor(ImmutableSearchFactory immutableSearchFactory)
public void close(IndexReader indexReader)
IndexReaderAccessor
IndexReaderAccessor.open(Class...)
close
in interface IndexReaderAccessor
indexReader
- the IndexReader to be closedpublic IndexReader open(Class<?>... entities)
IndexReaderAccessor
The returned IndexReader is read only; writing directly to the index is discouraged. If you
need to write to the index use the
SearchIntegrator.getWorker()
to queue change operations to the backend.
The IndexReader should not be closed in other ways except being returned to this instance via
IndexReaderAccessor.close(IndexReader)
.
open
in interface IndexReaderAccessor
entities
- the entity types for which to return a (multi)readerpublic IndexReader open(String... indexNames)
IndexReaderAccessor
open
in interface IndexReaderAccessor
indexNames
- At least one IndexManager name.Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved