Package org.hibernate.search

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


  public void testListEmptyHits() throws Exception {
    FullTextSession s = Search.createFullTextSession( openSession() );
    prepEmployeeIndex( s );

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

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


  public void testIterateEmptyHits() throws Exception {
    FullTextSession s = Search.createFullTextSession( openSession() );
    prepEmployeeIndex( s );

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

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

  private static final Logger log = LoggerFactory.make();
  public void testBoostedGetDesc() throws Exception {
    FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
    buildBoostedGetIndex( fullTextSession );

    fullTextSession.clear();
    Transaction tx = fullTextSession.beginTransaction();

    QueryParser authorParser = new QueryParser( "author", new StandardAnalyzer() );
    QueryParser descParser = new QueryParser( "description", new StandardAnalyzer() );
    Query author = authorParser.parse( "Wells" );
View Full Code Here

  public void testBoostedFieldDesc() throws Exception {
    FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
    buildBoostedFieldIndex( fullTextSession );

    fullTextSession.clear();
    Transaction tx = fullTextSession.beginTransaction();

    QueryParser authorParser = new QueryParser( "author", new StandardAnalyzer() );
    QueryParser descParser = new QueryParser( "description", new StandardAnalyzer() );
    Query author = authorParser.parse( "Wells" );
View Full Code Here

  public void testBoostedDesc() throws Exception {
    FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
    buildBoostedDescIndex( fullTextSession );

    fullTextSession.clear();
    Transaction tx = fullTextSession.beginTransaction();

    QueryParser authorParser = new QueryParser( "author", new StandardAnalyzer() );
    QueryParser descParser = new QueryParser( "description", new StandardAnalyzer() );
    Query author = authorParser.parse( "Wells" );
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

    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();//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

    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();//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.