Package org.apache.lucene.analysis

Examples of org.apache.lucene.analysis.StopAnalyzer


    s.save( book );
    tx.commit();
    s.clear();

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

    tx.commit();
View Full Code Here


    //wait for the message to be processed
    Thread.sleep( 1000 );

    FullTextSession ftSess = Search.createFullTextSession( openSession( ) );
    ftSess.getTransaction().begin();
    QueryParser parser = new QueryParser( "id", new StopAnalyzer() );
    Query luceneQuery = parser.parse( "logo:jboss" );
    org.hibernate.Query query = ftSess.createFullTextQuery( luceneQuery );
    List result = query.list();
    assertEquals( 1, result.size() );
    ftSess.delete( result.get( 0 ) );
View Full Code Here

    s.clear();

    tx = s.beginTransaction();
    FullTextSession fts = Search.createFullTextSession( s );
    QueryParser parser = new QueryParser("id", new StopAnalyzer() );

    List results = fts.createFullTextQuery( parser.parse( "name:mouse OR name:bear" ) ).list();
    assertEquals( "Either double insert, single update, or query fails with shards", 2, results.size() );

    results = fts.createFullTextQuery( parser.parse( "name:mouse OR name:bear OR color:blue" ) ).list();
View Full Code Here

    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 );
    List result = hibQuery.list();
    assertNotNull( result );
View Full Code Here

      reader.close();
    }

    tx = s.beginTransaction();
    FullTextSession fts = Search.createFullTextSession( s );
    QueryParser parser = new QueryParser("id", new StopAnalyzer() );

    List results = fts.createFullTextQuery( parser.parse( "name:mouse OR name:bear" ) ).list();
    assertEquals( "Either double insert, single update, or query fails with shards", 2, results.size() );
    for (Object o : results) s.delete( o );
    tx.commit();
View Full Code Here

    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();
    stats.clear();
    boolean enabled = stats.isStatisticsEnabled();
View Full Code Here

    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 );
    hibQuery.setFirstResult( 1 );
    List result = hibQuery.list();
View Full Code Here

    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 );
    Iterator result = hibQuery.iterate();
    assertNotNull( result );
View Full Code Here

    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 );
    ScrollableResults result = hibQuery.scroll();
    assertNotNull( result );
View Full Code Here

    AlternateBook alternateBook = new AlternateBook( 1, "La chute de la petite reine a travers les yeux de Festina" );
    s.save( alternateBook );
    tx.commit();
    s.clear();
    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "title", new StopAnalyzer() );

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

TOP

Related Classes of org.apache.lucene.analysis.StopAnalyzer

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.