Package org.hibernate.search.util

Examples of org.hibernate.search.util.ScopedAnalyzer


  public final class HSearchEntityContext implements EntityContext {
    private final ScopedAnalyzer queryAnalyzer;
    private final QueryBuildingContext context;

    public HSearchEntityContext(Class<?> entityType, SearchFactoryImplementor factory) {
      queryAnalyzer = new ScopedAnalyzer();
      queryAnalyzer.setGlobalAnalyzer( factory.getAnalyzer( entityType ) );
      context = new QueryBuildingContext( factory, queryAnalyzer, entityType);
    }
View Full Code Here


  private ScopedAnalyzer analyzer;


  public DocumentBuilder(XClass clazz, Analyzer defaultAnalyzer, DirectoryProvider[] directoryProviders,
               IndexShardingStrategy shardingStrategy, ReflectionManager reflectionManager) {
    this.analyzer = new ScopedAnalyzer();
    this.beanClass = clazz;
    this.directoryProviders = directoryProviders;
    this.shardingStrategy = shardingStrategy;
    //FIXME get rid of it when boost is stored?
    this.reflectionManager = reflectionManager;
View Full Code Here

  public void performWork(LuceneWork work, IndexWriter writer) {
    @SuppressWarnings("unchecked")
    DocumentBuilderIndexedEntity documentBuilder = workspace.getDocumentBuilder( work.getEntityClass() );
    Map<String, String> fieldToAnalyzerMap = ( ( AddLuceneWork ) work ).getFieldToAnalyzerMap();
    ScopedAnalyzer analyzer = ( ScopedAnalyzer ) documentBuilder.getAnalyzer();
    analyzer = updateAnalyzerMappings( analyzer, fieldToAnalyzerMap, workspace );
    Similarity similarity = documentBuilder.getSimilarity();
    if ( log.isTraceEnabled() ) {
      log.trace(
          "add to Lucene index: {}#{}:{}",
View Full Code Here

    // for backwards compatability
    if ( fieldToAnalyzerMap == null || fieldToAnalyzerMap.isEmpty() ) {
      return scopedAnalyzer;
    }

    ScopedAnalyzer analyzerClone = scopedAnalyzer.clone();
    for ( Map.Entry<String, String> entry : fieldToAnalyzerMap.entrySet() ) {
      Analyzer analyzer = workspace.getAnalyzer( entry.getValue() );
      if ( analyzer == null ) {
        log.warn( "Unable to retrieve named analyzer: " + entry.getValue() );
      }
      else {
        analyzerClone.addScopedAnalyzer( entry.getKey(), analyzer );
      }
    }
    return analyzerClone;
  }
View Full Code Here

    private final ScopedAnalyzer queryAnalyzer;
    private final SearchFactory factory;

    public HSearchEntityContext(Class<?> entityType, SearchFactory factory) {
      this.factory = factory;
      queryAnalyzer = new ScopedAnalyzer();
      queryAnalyzer.setGlobalAnalyzer( factory.getAnalyzer( entityType ) );
    }
View Full Code Here

  public void performWork(LuceneWork work, IndexWriter writer) {
    final Class<?> entityType = work.getEntityClass();
    @SuppressWarnings("unchecked")
    DocumentBuilderIndexedEntity documentBuilder = workspace.getDocumentBuilder( entityType );
    Map<String, String> fieldToAnalyzerMap = ( ( AddLuceneWork ) work ).getFieldToAnalyzerMap();
    ScopedAnalyzer analyzer = ( ScopedAnalyzer ) documentBuilder.getAnalyzer();
    analyzer = updateAnalyzerMappings( analyzer, fieldToAnalyzerMap );
    if ( log.isTraceEnabled() ) {
      log.trace(
          "add to Lucene index: {}#{}:{}",
          new Object[] { entityType, work.getId(), work.getDocument() }
View Full Code Here

    // for backwards compatibility
    if ( fieldToAnalyzerMap == null || fieldToAnalyzerMap.isEmpty() ) {
      return scopedAnalyzer;
    }

    ScopedAnalyzer analyzerClone = scopedAnalyzer.clone();
    for ( Map.Entry<String, String> entry : fieldToAnalyzerMap.entrySet() ) {
      Analyzer analyzer = workspace.getAnalyzer( entry.getValue() );
      if ( analyzer == null ) {
        log.warn( "Unable to retrieve named analyzer: " + entry.getValue() );
      }
      else {
        analyzerClone.addScopedAnalyzer( entry.getKey(), analyzer );
      }
    }
    return analyzerClone;
  }
View Full Code Here

  public void performWork(LuceneWork work, IndexWriter writer) {
    final Class<?> entityType = work.getEntityClass();
    @SuppressWarnings("unchecked")
    DocumentBuilderIndexedEntity documentBuilder = workspace.getDocumentBuilder( entityType );
    Map<String, String> fieldToAnalyzerMap = ( ( AddLuceneWork ) work ).getFieldToAnalyzerMap();
    ScopedAnalyzer analyzer = ( ScopedAnalyzer ) documentBuilder.getAnalyzer();
    analyzer = updateAnalyzerMappings( analyzer, fieldToAnalyzerMap );
    if ( log.isTraceEnabled() ) {
      log.trace(
          "add to Lucene index: {}#{}:{}",
          new Object[] { entityType, work.getId(), work.getDocument() }
View Full Code Here

    // for backwards compatibility
    if ( fieldToAnalyzerMap == null || fieldToAnalyzerMap.isEmpty() ) {
      return scopedAnalyzer;
    }

    ScopedAnalyzer analyzerClone = scopedAnalyzer.clone();
    for ( Map.Entry<String, String> entry : fieldToAnalyzerMap.entrySet() ) {
      Analyzer analyzer = workspace.getAnalyzer( entry.getValue() );
      if ( analyzer == null ) {
        log.warn( "Unable to retrieve named analyzer: " + entry.getValue() );
      }
      else {
        analyzerClone.addScopedAnalyzer( entry.getKey(), analyzer );
      }
    }
    return analyzerClone;
  }
View Full Code Here

  public final class HSearchEntityContext implements EntityContext {
    private final ScopedAnalyzer queryAnalyzer;
    private final QueryBuildingContext context;

    public HSearchEntityContext(Class<?> entityType, SearchFactoryImplementor factory) {
      queryAnalyzer = new ScopedAnalyzer();
      queryAnalyzer.setGlobalAnalyzer( factory.getAnalyzer( entityType ) );
      context = new QueryBuildingContext( factory, queryAnalyzer, entityType);
    }
View Full Code Here

TOP

Related Classes of org.hibernate.search.util.ScopedAnalyzer

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.