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 pre", "Les deboires de mon pre en vlo" );
    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 pre", "Les deboires de mon pre en vlo" );
    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

    assertEquals( 1, query.list().size() );
    contact = (PersonalContact) s.get( PersonalContact.class, contact.getId() );
    contact.getPhoneNumbers().clear();
    contact.getAddresses().clear();
    s.flush();
    s.clear();
    s.createQuery( "delete " + Address.class.getName() ).executeUpdate();
    s.createQuery( "delete " + Phone.class.getName() ).executeUpdate();
    s.createQuery( "delete " + Contact.class.getName() ).executeUpdate();
    s.getTransaction().commit();
View Full Code Here

    ScrollableResults results = s.createCriteria( Email.class ).scroll( ScrollMode.FORWARD_ONLY );
    int index = 0;
    while ( results.next() ) {
      index++;
      s.index( results.get( 0 ) );
      if ( index % 5 == 0 ) s.clear();
    }
    tx.commit();
    s.clear();
    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "id", new StopAnalyzer() );
View Full Code Here

      index++;
      s.index( results.get( 0 ) );
      if ( index % 5 == 0 ) s.clear();
    }
    tx.commit();
    s.clear();
    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "id", new StopAnalyzer() );
    List result = s.createFullTextQuery( parser.parse( "body:create" ) ).list();
    assertEquals( 14, result.size() );
    for (Object object : result) {
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 pre", "Les deboires de mon pre en vlo" );
    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 pre", "Les deboires de mon pre en vlo" );
    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 pre", "Les deboires de mon pre en vlo" );
    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

  public void testLuceneObjectsProjectionWithIterate() throws Exception {
    FullTextSession s = Search.getFullTextSession( openSession() );
    prepEmployeeIndex( s );

    Transaction tx;
    s.clear();
    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "dept", new StandardAnalyzer() );

    Query query = parser.parse( "dept:ITech" );
    org.hibernate.search.FullTextQuery hibQuery = s.createFullTextQuery( query, Employee.class );
View Full Code Here

  public void testLuceneObjectsProjectionWithList() throws Exception {
    FullTextSession s = Search.getFullTextSession( openSession() );
    prepEmployeeIndex( s );

    Transaction tx;
    s.clear();
    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "dept", new StandardAnalyzer() );

    Query query = parser.parse( "dept:Accounting" );
    org.hibernate.search.FullTextQuery hibQuery = s.createFullTextQuery( query, Employee.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.