Examples of SearchMapping


Examples of org.hibernate.search.cfg.SearchMapping

    final ReflectionManager reflectionManager = getReflectionManager( cfg );

    BuildContext buildContext = new BuildContext();

    final SearchMapping mapping = SearchMappingBuilder.getSearchMapping( cfg );
    if ( mapping != null ) {
      if ( !( reflectionManager instanceof MetadataProviderInjector ) ) {
        throw new SearchException(
            "Programmatic mapping model used but ReflectionManager does not implement "
                + MetadataProviderInjector.class.getName()
View Full Code Here

Examples of org.hibernate.search.cfg.SearchMapping

      cfg = new ReflectionReplacingSearchConfiguration( reflectionManager, cfg );
    }

    BuildContext buildContext = new BuildContext();

    final SearchMapping mapping = SearchMappingBuilder.getSearchMapping( cfg );
    applySearchMappingToMetadata( reflectionManager, mapping );

    factoryState.setSearchMapping( mapping ); // might be null if feature is not used

    factoryState.setIndexingStrategy( defineIndexingStrategy( cfg ) );//need to be done before the document builds
View Full Code Here

Examples of org.hibernate.search.cfg.SearchMapping

  }

  public static class MappingFactory {
    @Factory
    public SearchMapping build() {
      SearchMapping mapping = new SearchMapping();
      mapping
          .analyzerDef( "stemmer", StandardTokenizerFactory.class )
          .filter( StandardFilterFactory.class )
          .filter( LowerCaseFilterFactory.class )
          .filter( StopFilterFactory.class )
          .filter( SnowballPorterFilterFactory.class )
View Full Code Here

Examples of org.hibernate.search.cfg.SearchMapping

  }

  @Override
  protected void configure(Configuration cfg) {
    super.configure( cfg );
    SearchMapping mapping = new SearchMapping();
    mapping
      .entity( PlainPerson.class )
        .indexed()
      .property( "id", ElementType.FIELD )
        .documentId()
        .bridge( PersonPKBridge.class )
View Full Code Here

Examples of org.hibernate.search.cfg.SearchMapping

    static FieldCacheType[] enableFieldCache;

    @Factory
    public SearchMapping build() {
      SearchMapping mapping = new SearchMapping();
      mapping
          .entity( Address.class )
            .indexed()
            .cacheFromIndex( enableFieldCache )
            .indexName( "single-index" )
          .entity( Country.class )
View Full Code Here

Examples of org.hibernate.search.cfg.SearchMapping

    }
  }

  @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" );
    return mapping;
View Full Code Here

Examples of org.hibernate.search.cfg.SearchMapping

    tx.commit();
    fullTextSession.close();
  }

  private SearchMapping createSearchMapping() {
    SearchMapping mapping = new SearchMapping();

    mapping.entity( ProgrammaticConfiguredValue.class )
        .indexed()
        .property( "id", ElementType.FIELD ).documentId().name( "id" )
        .property( "value", ElementType.FIELD ).field().store( Store.YES ).indexNullAs( "@null@" );
    return mapping;
  }
View Full Code Here

Examples of org.hibernate.search.cfg.SearchMapping

    cfg.setIndexMetadataComplete( true );
    verifyIndexCompleteMetadataOption( true, cfg );
  }

  private void verifyIndexCompleteMetadataOption(boolean expectation, SearchConfigurationForTest cfg) {
    SearchMapping mapping = new SearchMapping();
    mapping
      .entity( Document.class ).indexed().indexName( "index1" )
      .property( "id", ElementType.FIELD ).documentId()
      .property( "title", ElementType.FIELD ).field()
      ;
    cfg.setProgrammaticMapping( mapping );
View Full Code Here

Examples of org.hibernate.search.cfg.SearchMapping

    cfg.setTransactionsExpected( true );
    verifyTransactionsExpectedOption( true, cfg );
  }

  private void verifyTransactionsExpectedOption(boolean expectation, SearchConfigurationForTest cfg) {
    SearchMapping mapping = new SearchMapping();
    mapping
      .entity( Document.class ).indexed()
      .property( "id", ElementType.FIELD ).documentId()
      .property( "title", ElementType.FIELD ).field()
      ;
    cfg.setProgrammaticMapping( mapping );
View Full Code Here

Examples of org.hibernate.search.cfg.SearchMapping

  @Rule
  public ExpectedException exceptions = ExpectedException.none();

  @Test
  public void exceptionThrownWhenNotEnabled() {
    SearchMapping mapping = new SearchMapping();
    mapping
      .entity( Book.class ).indexed()
      //Entity missing both @DocumentId and @ProvidedId:
      .property( "title", ElementType.FIELD ).field()
      .property( "text", ElementType.FIELD ).field()
      ;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.