org.hibernate.search.annotations.Factory.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中org.hibernate.search.annotations.Factory.<init>()方法的一些代码示例,展示了Factory.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Factory.<init>()方法的具体详情如下:
包路径:org.hibernate.search.annotations.Factory
类名称:Factory
方法名:<init>

Factory.<init>介绍

暂无

代码示例

代码示例来源:origin: openmrs/openmrs-core

@Factory
  public Filter getFilter() {
    BooleanQuery query = new BooleanQuery();

    if (includeTerms.isEmpty()) {
      query.add(new MatchAllDocsQuery(), Occur.MUST);
    } else {
      for (Set<Term> terms : includeTerms) {

        if (terms.size() == 1) {
          query.add(new TermQuery(terms.iterator().next()), Occur.MUST);
        } else if (terms.size() > 1) {
          BooleanQuery subquery = new BooleanQuery();
          for (Term term : terms) {
            subquery.add(new TermQuery(term), Occur.SHOULD);
          }
          query.add(subquery, Occur.MUST);
        }
      }
    }

    for (Term term : excludeTerms) {
      query.add(new TermQuery(term), Occur.MUST_NOT);
    }
    
    return new CachingWrapperFilter(new QueryWrapperFilter(query));
  }
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
  public static ElasticsearchAnalysisDefinitionProvider create() {
    return provider;
  }
}

代码示例来源:origin: se.vgregion.webbisar/webbisar-core-bc-composite-types

@Factory
  public Filter getFilter() {
    Filter enabledWebbisFilter = new QueryWrapperFilter(new TermQuery(new Term("disabled", "false")));
    return new CachingWrapperFilter(enabledWebbisFilter);
  }
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
  public Object bar() {
    return new Object();
  }
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
  public Object foo() {
    throw new IllegalArgumentException( );
  }
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
  public Query getFilter() {
    return new TermQuery( new Term( "teacher", login ) );
  }
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
public Query buildSecurityFilter() {
  return new TermQuery( new Term( "owner", ownerName ) );
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
public Filter getFilter() {
  return new ExcludeAllFilter();
}

代码示例来源:origin: jamesagnew/hapi-fhir

@Factory
public SearchMapping getSearchMapping() {
  SearchMapping mapping = new SearchMapping();

代码示例来源:origin: hibernate/hibernate-search

@Factory
  public Query getFilter() {
    return new TermQuery( new Term( "role", role.name() ) );
  }
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
  public Filter getFilter() {
    Query query = new TermQuery( new Term( "teacher", login ) );
    return new QueryWrapperFilter( query );
  }
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
public Query buildFilter() {
  Query q = new TermQuery( new Term( field, value ) );
  return new CachingWrapperQuery( q );
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
  public static CustomAnalyzerProvider create() {
    return new CustomAnalyzerProvider();
  }
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
public Filter buildFilter() {
  builtFilters.add( new BuildFilterInvocation( field, value ) );
  Query q = new TermQuery( new Term( field, value ) );
  return new QueryWrapperFilter( q );
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
public Query buildFilter() {
  builtFilters.add( new BuildFilterInvocation( field, value ) );
  Query q = new TermQuery( new Term( field, value ) );
  return new CachingWrapperQuery( q );
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
  public Query create() {
    return new BooleanQuery.Builder()
        .add( new TermQuery( new Term( "field", "one" ) ), Occur.MUST )
        .build();
  }
}

代码示例来源:origin: org.infinispan.server/infinispan-server-testsuite

@SuppressWarnings("unused")
@Factory
public SearchMapping buildSearchMapping() {
 SearchMapping searchMapping = new SearchMapping();
 searchMapping.entity(MySearchableEntity.class);
 return searchMapping;
}

代码示例来源:origin: jaxio/generated-projects

@Factory
  public SearchMapping getSearchMapping() {
    SearchMapping mapping = new SearchMapping();
    mapping.analyzerDef("custom", NGramTokenizerFactory.class).tokenizerParam("maxGramSize", "40") //
        .filter(ASCIIFoldingFilterFactory.class) //
        .filter(LowerCaseFilterFactory.class);
    return mapping;
  }
}

代码示例来源:origin: org.infinispan/infinispan-query

@Factory
  public Filter getFilter() {
   NumericRangeQuery<Integer> query = NumericRangeQuery.newIntRange("age", this.age, age, true, true);
   BooleanQuery filterQuery = new BooleanQuery.Builder().add(query, BooleanClause.Occur.FILTER).build();
   return new QueryWrapperFilter(filterQuery);
  }
}

代码示例来源:origin: hibernate/hibernate-search

@Factory
public SearchMapping build() {
  SearchMapping mapping = new SearchMapping();
  mapping
      .analyzerDef( "ngram", StandardTokenizerFactory.class )
      .filter( LowerCaseFilterFactory.class )
      .filter( StopFilterFactory.class )
      .param( "words", "non-existent-resourcename.file" )
      // We must mark at least one entity as indexed, otherwise analyzer definitions are not initialized (no need to)
      .entity( SomeHibernateEntity.class ).indexed();
  return mapping;
}

相关文章

Factory类方法