Interface LuceneIndexScope
public interface LuceneIndexScope
The
LuceneIndexScope
exposes IndexReader
s directly, making it possible to query the Lucene
indexes directly bypassing Hibernate Search.
The returned IndexReader instances must be closed
using the IndexReader.close()
method.
This API is intended for power users intending to extract information directly.
- Author:
- Sanne Grinovero (C) 2011 Red Hat Inc.
-
Method Summary
Modifier and TypeMethodDescriptiondefault IndexReader
Opens an IndexReader for all indexes containing the entities of the search scope.openIndexReader
(Set<String> routingKeys) Opens an IndexReader on shards assigned to the given routing keys for all indexes containing the entities of the search scope.
-
Method Details
-
openIndexReader
Opens an IndexReader for all indexes containing the entities of the search scope.The instance must be closed after its use by the client of this class using
IndexReader.close()
.If sharding is enabled, the returned reader will read all shards. If you need to read specific shards only, use
openIndexReader(Set)
.WARNING: Even if multi-tenancy is enabled, the returned reader exposes documents of *all* tenants.
- Returns:
- an IndexReader containing the entities of the index scope
-
openIndexReader
Opens an IndexReader on shards assigned to the given routing keys for all indexes containing the entities of the search scope.The instance must be closed after its use by the client of this class using
IndexReader.close()
.WARNING: Even if multi-tenancy is enabled, the returned reader exposes documents of *all* tenants.
- Parameters:
routingKeys
- A collection containing zero, one or multiple string keys.- Returns:
- an IndexReader containing the entities of the index scope
-