Package org.hibernate.search

Examples of org.hibernate.search.FullTextSession.clear()


    Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
    s.save( book );
    book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
    s.save( book );
    tx.commit();
    s.clear();

    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "brand", new StopAnalyzer() );

    Query query = parser.parse( "brand:Seiko" );
View Full Code Here


    Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
    s.save( book );
    book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
    s.save( book );
    tx.commit();
    s.clear();

    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "brand", new StopAnalyzer() );
                         tx = s.beginTransaction();
    s.purgeAll( Clock.class);
View Full Code Here

    // persist and index the test object
    FullTextSession fts = Search.getFullTextSession( openSession() );
    Transaction tx = fts.beginTransaction();
    fts.persist( team );
    tx.commit();
    fts.clear();

    // execute several search to show that the right tokenizers were applies
    tx = fts.beginTransaction();
    TermQuery query = new TermQuery( new Term( "description", "D\u00E0scription" ) );
    assertEquals(
View Full Code Here

      assertLocationsLoaded( 0 );
      FullTextSession fullTextSession = fullTextSessionBuilder.openFullTextSession();
      //now check index state:
      assertFoundLocations( fullTextSession, "floor", 5 );
      assertFoundLocations( fullTextSession, "airport", 0 );
      fullTextSession.clear();
      try {
        //we add a new Location to the group:
        addLocationToGroupCollection( fullTextSession );
        //NOTHING else should be loaded, there was no need to reindex unrelated Locations!
        assertLocationsLoaded( 0 );
View Full Code Here

        addLocationToGroupCollection( fullTextSession );
        //NOTHING else should be loaded, there was no need to reindex unrelated Locations!
        assertLocationsLoaded( 0 );
        //of course the new Location should have been indexed:
        assertOperationsPerformed( 1 );
        fullTextSession.clear();
        //so now we have 6 Locations in the index, in LocationGroup "floor":
        assertFoundLocations( fullTextSession, "floor", 6 );
        assertFoundLocations( fullTextSession, "airport", 0 );
        //changing the locationGroup name to Airport:
        updateLocationGroupName( fullTextSession );
View Full Code Here

        //so now we have 6 Locations in the index, in LocationGroup "floor":
        assertFoundLocations( fullTextSession, "floor", 6 );
        assertFoundLocations( fullTextSession, "airport", 0 );
        //changing the locationGroup name to Airport:
        updateLocationGroupName( fullTextSession );
        fullTextSession.clear();
        //check index functionality:
        assertFoundLocations( fullTextSession, "floor", 0 );
        assertFoundLocations( fullTextSession, "airport", 6 );
        //six locations have been loaded for re-indexing:
        assertLocationsLoaded( 6 );
View Full Code Here

    Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
    s.save( book );
    book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
    s.save( book );
    tx.commit();
    s.clear();
    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "title", new StopAnalyzer() );

    Query query = parser.parse( "summary:noword" );
    org.hibernate.Query hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
View Full Code Here

    Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
    s.save( book );
    book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
    s.save( book );
    tx.commit();
    s.clear();
    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "title", new StopAnalyzer() );

    Query query = parser.parse( "summary:Festina Or brand:Seiko" );
    Statistics stats = s.getSessionFactory().getStatistics();
View Full Code Here

    Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
    s.save( book );
    book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
    s.save( book );
    tx.commit();
    s.clear();
    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "title", new StopAnalyzer() );

    Query query = parser.parse( "summary:Festina Or brand:Seiko" );
    org.hibernate.Query hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
View Full Code Here

    Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
    s.save( book );
    book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
    s.save( book );
    tx.commit();//post commit events for lucene
    s.clear();
    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "title", new StopAnalyzer() );

    Query query = parser.parse( "summary:noword" );
    org.hibernate.Query hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
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.