Package org.apache.lucene.analysis

Examples of org.apache.lucene.analysis.StopAnalyzer


        }

        s = sf.openSession();
        tx = s.beginTransaction();
        FullTextSession fts = new FullTextSessionImpl( s );
        QueryParser parser = new QueryParser( "id", new StopAnalyzer() );
        Query query;
        try {
          query = parser.parse( "name:Gavin" );
        }
        catch (ParseException e) {
View Full Code Here


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

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

    Query query = parser.parse( "brand:Seiko" );
    org.hibernate.Query hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
    List results = hibQuery.list();
    assertEquals("incorrect test record", 1, results.size());
View Full Code Here

    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

      IndexingConfigurationImpl indexingConfigurationImpl = (IndexingConfigurationImpl)searchIndex.getIndexingConfig();
      assertNotNull(indexingConfigurationImpl);

      indexingConfigurationImpl.addPropertyAnalyzer("FULL:" + simple, new SimpleAnalyzer());
      indexingConfigurationImpl.addPropertyAnalyzer("FULL:" + whitespace, new WhitespaceAnalyzer());
      indexingConfigurationImpl.addPropertyAnalyzer("FULL:" + stop, new StopAnalyzer());
      testRoot = testSession.getRootNode().addNode("testrootAnalyzers");
      root.save();
   }
View Full Code Here

        task.setIndex(new File(indexDir));
        task.setProject(project);
        task.execute();

        searcher = new IndexSearcher(indexDir);
        analyzer = new StopAnalyzer();
    }
View Full Code Here

//    Set stopWords = null;
    Set stopWords = StopFilter.makeStopSet(StopAnalyzer.ENGLISH_STOP_WORDS);
   
    Analyzer[] analyzers = new Analyzer[] {
        new SimpleAnalyzer(),
        new StopAnalyzer(),
        new StandardAnalyzer(),
        PatternAnalyzer.DEFAULT_ANALYZER,
//        new WhitespaceAnalyzer(),
//        new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, false, null),
//        new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, true, stopWords),       
View Full Code Here

//    Set stopWords = null;
    Set stopWords = StopFilter.makeStopSet(StopAnalyzer.ENGLISH_STOP_WORDS);
   
    Analyzer[] analyzers = new Analyzer[] {
        new SimpleAnalyzer(),
        new StopAnalyzer(),
        new StandardAnalyzer(),
        PatternAnalyzer.DEFAULT_ANALYZER,
//        new WhitespaceAnalyzer(),
//        new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, false, null),
//        new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, true, stopWords),       
View Full Code Here

//    Set stopWords = null;
    Set stopWords = StopFilter.makeStopSet(StopAnalyzer.ENGLISH_STOP_WORDS);
   
    Analyzer[] analyzers = new Analyzer[] {
        new SimpleAnalyzer(),
        new StopAnalyzer(),
        new StandardAnalyzer(),
        PatternAnalyzer.DEFAULT_ANALYZER,
//        new WhitespaceAnalyzer(),
//        new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, false, null),
//        new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, true, stopWords),       
View Full Code Here

    SnowStorm sn = new SnowStorm();
    sn.setDate( new Date() );
    sn.setLocation( "Dallas, TX, USA");

    FullTextSession fts2 = Search.createFullTextSession( getSessionFactories()[1].openSession( ) );
    QueryParser parser = new QueryParser("id", new StopAnalyzer() );
    List result = fts2.createFullTextQuery( parser.parse( "location:texas" ) ).list();
    assertEquals( "No copy yet, fresh index expected", 0, result.size() );

    s1.persist( sn );
    s1.flush(); //we don' commit so we need to flush manually
View Full Code Here

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

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

    Query query = parser.parse( "brand:Seiko" );
    org.hibernate.Query hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
    List results = hibQuery.list();
    assertEquals("incorrect test record", 1, results.size());
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.