コード例 #1
0
 private Integer getParameter(int shard, IndexWriterSetting setting, Class testEntity) {
   EntityIndexBinder mappingForEntity = searchFactory.getIndexBindingForEntity(testEntity);
   DirectoryBasedIndexManager indexManager =
       (DirectoryBasedIndexManager) mappingForEntity.getIndexManagers()[shard];
   LuceneIndexingParameters luceneIndexingParameters = indexManager.getIndexingParameters();
   return luceneIndexingParameters.getIndexParameters().getCurrentValueFor(setting);
 }
コード例 #2
0
ファイル: Helper.java プロジェクト: rhauch/hibernate-search
 static DocumentBuilderIndexedEntity<?> getDocumentBuilder(QueryBuildingContext queryContext) {
   final SearchFactoryImplementor factory = queryContext.getFactory();
   final Class<?> type = queryContext.getEntityType();
   EntityIndexBinder indexBinding = factory.getIndexBindingForEntity(type);
   if (indexBinding == null) {
     throw new AssertionFailure("Class in not indexed: " + type);
   }
   return indexBinding.getDocumentBuilder();
 }