Package org.hibernate.search.exception

Examples of org.hibernate.search.exception.SearchException


      directory.setLockFactory( DirectoryProviderHelper.createLockFactory( null, properties, serviceManager ) );
      properties = null;
      DirectoryProviderHelper.initializeIndexIfNeeded( directory );
    }
    catch (IOException e) {
      throw new SearchException( "Unable to initialize index: " + indexName, e );
    }
  }
View Full Code Here


    try {
      indexName = indexDir.getCanonicalPath();
      directory = DirectoryProviderHelper.createFSIndex( indexDir, properties, context.getServiceManager() );
    }
    catch (IOException e) {
      throw new SearchException( "Unable to initialize index: " + directoryProviderName, e );
    }
    copyChunkSize = DirectoryProviderHelper.getCopyBufferSize( directoryProviderName, properties );
    current = 0; //write to volatile to publish all state
  }
View Full Code Here

      //TODO small hole, no file can be found here
      new File( sourceDir, CURRENT_DIR_NAME[currentLocal] ).createNewFile();
      log.debugf( "Current directory: %d", currentLocal );
    }
    catch (IOException e) {
      throw new SearchException( "Unable to initialize index: " + directoryProviderName, e );
    }
    task = new FSMasterDirectoryProvider.TriggerTask( indexDir, sourceDir );
    long period = DirectoryProviderHelper.getRefreshPeriod( properties, directoryProviderName );
    timer.scheduleAtFixedRate( task, period, period );
    this.current = currentLocal; //write to volatile to publish all state
View Full Code Here

      reader = new PerDirectoryLatestReader( directory );
      currentReaders.put( directory, reader );
      return reader;
    }
    catch (IOException e) {
      throw new SearchException( "Unable to open Lucene IndexReader for IndexManager " + this.indexName, e );
    }
  }
View Full Code Here

            //technically the final value doesn't even matter, as long as we change it
            refreshOperationId++;
            updatedReader = DirectoryReader.openIfChanged( beforeUpdateReader );
          }
          catch (IOException e) {
            throw new SearchException( "Unable to reopen IndexReader", e );
          }
        }
        if ( updatedReader == null ) {
          current.usageCounter.incrementAndGet();
          return beforeUpdateReader;
View Full Code Here

  public SearchFactoryImplementor buildSearchFactory() {
    SearchFactoryImplementor searchFactoryImplementor;
    if ( rootFactory == null ) {
      if ( classes.size() > 0 ) {
        throw new SearchException( "Cannot add a class if the original SearchFactory is not passed" );
      }
      searchFactoryImplementor = buildNewSearchFactory();
    }
    else {
      searchFactoryImplementor = buildIncrementalSearchFactory();
View Full Code Here

  }

  @Override
  public void raiseExceptionOnTimeout() {
    if ( this.type == Type.LIMIT ) {
      throw new SearchException("Cannot define both setTimeout and limitFetchingTime on a full-text query. Please report your need to the Hibernate team");
    }
    this.type = Type.EXCEPTION;
  }
View Full Code Here

   * @param mapping the SearchMapping to apply
   */
  private void applySearchMappingToMetadata(ReflectionManager reflectionManager, SearchMapping mapping) {
    if ( mapping != null ) {
      if ( !( reflectionManager instanceof MetadataProviderInjector ) ) {
        throw new SearchException(
            "Programmatic mapping model used but ReflectionManager does not implement "
                + MetadataProviderInjector.class.getName()
        );
      }
      MetadataProviderInjector injector = (MetadataProviderInjector) reflectionManager;
View Full Code Here

  }

  @Override
  public void limitFetchingOnTimeout() {
    if ( this.type == Type.EXCEPTION ) {
      throw new SearchException("Cannot define both setTimeout and limitFetchingTime on a full-text query. Please report your need to the Hibernate team");
    }
    this.type = Type.LIMIT;
  }
View Full Code Here

    }
  }

  private void bindFilterDef(FullTextFilterDef defAnn, XClass mappedXClass) {
    if ( factoryState.getFilterDefinitions().containsKey( defAnn.name() ) ) {
      throw new SearchException(
          "Multiple definition of @FullTextFilterDef.name=" + defAnn.name() + ": "
              + mappedXClass.getName()
      );
    }
View Full Code Here

TOP

Related Classes of org.hibernate.search.exception.SearchException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.