Skip to content

Commit

Permalink
HSEARCH-955 Property name for index manager selection should be defin…
Browse files Browse the repository at this point in the history
…ed in Environment
  • Loading branch information
Sanne authored and hferentschik committed Dec 5, 2011
1 parent 4e9be1f commit 99d3047
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,14 @@ private Environment() {
* can upgrade Hibernate Search and control when to eventually upgrade the Lucene format.
*/
public static final org.apache.lucene.util.Version DEFAULT_LUCENE_MATCH_VERSION = org.apache.lucene.util.Version.LUCENE_CURRENT;

/**
* Used to specify an alternative IndexManager implementation for a specific index.
* This is an index scoped property, so it needs to be prefixed by default or the index name, for example:
* <ul>
* <li>hibernate.search.default.indexmanager</li>
* <li>hibernate.search.Books.indexmanager</li>
* </ul>
*/
public static final String INDEX_MANAGER_IMPL_NAME = "indexmanager";
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
*/
public class IndexManagerHolder {

public static final String INDEX_MANAGER_IMPL_NAME = "indexmanager";

private static final Log log = LoggerFactory.make();
private static final String SHARDING_STRATEGY = "sharding_strategy";
private static final String NBR_OF_SHARDS = SHARDING_STRATEGY + ".nbr_of_shards";
Expand Down Expand Up @@ -178,7 +176,7 @@ private void setSimilarity(Similarity newSimilarity, IndexManager manager) {
}

private IndexManager createDirectoryManager(String indexName, Properties indexProps, WorkerBuildContext context) {
String indexManagerName = indexProps.getProperty( INDEX_MANAGER_IMPL_NAME, DEFAULT_INDEX_MANAGER_NAME);
String indexManagerName = indexProps.getProperty( Environment.INDEX_MANAGER_IMPL_NAME, DEFAULT_INDEX_MANAGER_NAME);
final IndexManager manager;
if ( StringHelper.isEmpty( indexManagerName ) ) {
manager = new DirectoryBasedIndexManager();
Expand Down

0 comments on commit 99d3047

Please sign in to comment.