Package org.hibernate.search.test

Examples of org.hibernate.search.test.Document


  @Test
  public void testBoost() throws Exception {
    Session s = getSessionFactory().openSession();
    s.getTransaction().begin();
    s.persist(
        new Document( "Hibernate in Action", "Object and Relational", "blah blah blah" )
    );
    s.persist(
        new Document( "Object and Relational", "Hibernate in Action", "blah blah blah" )
    );
    s.getTransaction().commit();
    s.close();

    FSDirectory dir = FSDirectory.open( new File( getBaseIndexDir(), "Documents" ) );
View Full Code Here


  @Test
  public void testSearchOnDeletedIndex() throws Exception {
    Session s = getSessionFactory().openSession();
    s.getTransaction().begin();
    s.persist( new Document( "Hibernate Search in Action", "", "" ) );
    s.getTransaction().commit();
    s.close();

    Directory dir = FSDirectory.open( new File( getBaseIndexDir(), "Documents" ) );
    IndexReader indexReader = DirectoryReader.open( dir );
View Full Code Here

TOP

Related Classes of org.hibernate.search.test.Document

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.