Package org.hibernate.search

Examples of org.hibernate.search.SearchException


    FieldBridge fb = extractType( fieldBridge, appliedOnType, reflectionManager );
    if ( fb instanceof TwoWayFieldBridge ) {
      return (TwoWayFieldBridge) fb;
    }
    else {
      throw new SearchException( "FieldBridge passed in is not an instance of " + TwoWayFieldBridge.class.getSimpleName() );
    }
  }
View Full Code Here


  public static Serializable getDocumentId(SearchFactoryImplementor searchFactoryImplementor, Class<?> clazz, Document document) {
    DocumentBuilderIndexedEntity<?> builderIndexedEntity = searchFactoryImplementor.getDocumentBuilderIndexedEntity(
        clazz
    );
    if ( builderIndexedEntity == null ) {
      throw new SearchException( "No Lucene configuration set up for: " + clazz.getName() );
    }


    final TwoWayFieldBridge fieldBridge = builderIndexedEntity.getIdBridge();
    final String fieldName = builderIndexedEntity.getIdKeywordName();
View Full Code Here

    if ( fieldBridgeAnnotation != null ) {
      bridge = doExtractType( fieldBridgeAnnotation, appliedOnType.getName(), reflectionManager.toClass( appliedOnType ) );
    }

    if ( bridge == null ) {
      throw new SearchException(
          "Unable to guess FieldBridge for " + org.hibernate.search.annotations.FieldBridge.class.getName()
      );
    }

    return bridge;
View Full Code Here

  public static String getDocumentIdName(SearchFactoryImplementor searchFactoryImplementor, Class<?> clazz) {
    DocumentBuilderIndexedEntity<?> builderIndexedEntity = searchFactoryImplementor.getDocumentBuilderIndexedEntity(
        clazz
    );
    if ( builderIndexedEntity == null ) {
      throw new SearchException( "No Lucene configuration set up for: " + clazz.getName() );
    }
    return builderIndexedEntity.getIdentifierName();
  }
View Full Code Here

  public static Object[] getDocumentFields(SearchFactoryImplementor searchFactoryImplementor, Class<?> clazz, Document document, String[] fields) {
    DocumentBuilderIndexedEntity<?> builderIndexedEntity = searchFactoryImplementor.getDocumentBuilderIndexedEntity(
        clazz
    );
    if ( builderIndexedEntity == null ) {
      throw new SearchException( "No Lucene configuration set up for: " + clazz.getName() );
    }
    final int fieldNbr = fields.length;
    Object[] result = new Object[fieldNbr];
    ContextualException2WayBridge contextualBridge = new ContextualException2WayBridge();
    contextualBridge.setClass( clazz );
View Full Code Here

          log.trace( "Field {} projected as {}", fieldName, result[matchingPosition] );
        }
      }
      else {
        if ( store == Store.NO ) {
          throw new SearchException( "Projecting an unstored field: " + fieldName );
        }
        else {
          throw new SearchException( "FieldBridge is not a TwoWayFieldBridge: " + fieldBridge.getClass() );
        }
      }
    }
  }
View Full Code Here

      if ( field.isBinary() ) {
        try {
          stringValue = CompressionTools.decompressString( field.getBinaryValue() );
        }
        catch (DataFormatException e) {
          throw new SearchException( "Field " + name + " looks like binary but couldn't be decompressed" );
        }
      }
      else {
        stringValue = field.stringValue();
      }
View Full Code Here

    }
    if (numericClass.isAssignableFrom(Float.class)) {
      return NumericRangeQuery.newFloatRange(fieldName, (Float) from, (Float) to, includeLower, includeUpper);
    }
    // TODO: check for type before in the mapping
    throw new SearchException(
        "Cannot create numeric range query for field " + fieldName + ", since values are not numeric " +
            "(int,long, short or double) ");
  }
View Full Code Here

      idKeywordName = provided.name();
      idProvided = true;
    }

    if ( idKeywordName == null ) {
      throw new SearchException( "No document id in: " + clazz.getName() );
    }

    checkAllowFieldSelection();
    if ( log.isDebugEnabled() ) {
      log.debug(
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

TOP

Related Classes of org.hibernate.search.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.