Package org.hibernate.search.exception

Examples of org.hibernate.search.exception.SearchException


      case WITH_POSITIONS_OFFSETS:
        return SerializableTermVector.WITH_POSITIONS_OFFSETS;
      case YES:
        return SerializableTermVector.YES;
      default:
        throw new SearchException( "Unable to convert Field.TermVector value into serializable TermVector: " + vector);
    }
  }
View Full Code Here


    Directory directory = directoryProvider.getDirectory();
    try {
      return DirectoryReader.open( directory );
    }
    catch (IOException e) {
      throw new SearchException( "Could not open index \"" + indexName + "\"", e );
    }
  }
View Full Code Here

    }
    try {
      return DateTools.stringToDate( stringValue );
    }
    catch (ParseException e) {
      throw new SearchException( "Unable to parse into date: " + stringValue, e );
    }
  }
View Full Code Here

      try {
        TopDocs topdocs = searcher.search( boolQuery, 1 );
        return topdocs.totalHits;
      }
      catch (IOException e) {
        throw new SearchException( "Unable to execute count query for entity " + entity, e );
      }
    }
    finally {
      searchFactoryImplementor.getIndexReaderAccessor().close( indexReader );
    }
View Full Code Here

  private void addAnalyzerDef(AnalyzerDef analyzerDef, String annotationDefinitionPoint) {
    String analyzerDefinitionName = analyzerDef.name();

    if ( analyzerDefinitionPoints.containsKey( analyzerDefinitionName ) ) {
      if ( !analyzerDefinitionPoints.get( analyzerDefinitionName ).equals( annotationDefinitionPoint ) ) {
        throw new SearchException( "Multiple analyzer definitions with the same name: " + analyzerDef.name() );
      }
    }
    else {
      analyzerDefs.put( analyzerDefinitionName, analyzerDef );
      analyzerDefinitionPoints.put( analyzerDefinitionName, annotationDefinitionPoint );
View Full Code Here

          final Analyzer analyzer = buildAnalyzer( analyzerDefs.get( name ) );
          namedAnalyzer.setDelegate( analyzer );
          initializedAnalyzers.put( name, analyzer );
        }
        else {
          throw new SearchException( "Analyzer found with an unknown definition: " + name );
        }
      }
    }

    //initialize the remaining definitions
View Full Code Here

  private Analyzer buildAnalyzer(AnalyzerDef analyzerDef) {
    try {
      return SolrAnalyzerBuilder.buildAnalyzer( analyzerDef, luceneMatchVersion, serviceManager );
    }
    catch (IOException e) {
      throw new SearchException( "Could not initializer Analyzer definition" + analyzerDef, e );
    }
  }
View Full Code Here

        for ( Version v : Version.values() ) {
          msg.append( v.toString() );
          msg.append( ", " );
        }
        msg.delete( msg.lastIndexOf( "," ), msg.length() - 1 );
        throw new SearchException( msg.toString() );
      }
    }
    return version;
  }
View Full Code Here

    }
    else if ( annotatedElement instanceof XPackage ) {
      return ( (XPackage) annotatedElement ).getName();
    }
    else {
      throw new SearchException( "Unknown XAnnotatedElement: " + annotatedElement );
    }
  }
View Full Code Here

        }
      }
      return infos;
    }
    catch (IOException e) {
      throw new SearchException( "Unable to query Lucene index", e );
    }
    finally {
      closeSearcher( searcher );
    }
  }
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.