Examples of topDocs()


Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

                                                                                true );
            final Query query = new QueryBuilder().addTerm( new ValueRuleAttributeIndexTerm( "ruleflow-group" ) ).addTerm( new ValueRuleAttributeValueIndexTerm( "myRuleFlowGroup" ) ).build();

            searcher.search( query,
                             collector );
            final ScoreDoc[] hits = collector.topDocs().scoreDocs;
            assertEquals( 1,
                          hits.length );

            final List<KObject> results = new ArrayList<KObject>();
            for ( int i = 0; i < hits.length; i++ ) {
View Full Code Here

Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

                                                                                true );
            final Query query = new QueryBuilder().addTerm( new ValueRuleAttributeIndexTerm( "ruleflow-group" ) ).addTerm( new ValueRuleAttributeValueIndexTerm( "myAgendaGroup" ) ).build();

            searcher.search( query,
                             collector );
            final ScoreDoc[] hits = collector.topDocs().scoreDocs;
            assertEquals( 0,
                          hits.length );

            ( (LuceneIndex) index ).nrtRelease( searcher );
        }
View Full Code Here

Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

                                                                                true );
            final Query query = new QueryBuilder().addTerm( new ValueRuleAttributeIndexTerm( "ruleflow-group" ) ).build();

            searcher.search( query,
                             collector );
            final ScoreDoc[] hits = collector.topDocs().scoreDocs;

            assertEquals( 1,
                          hits.length );

            ( (LuceneIndex) index ).nrtRelease( searcher );
View Full Code Here

Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

                                                                                true );
            final Query query = new QueryBuilder().addTerm( new ValueRuleIndexTerm( "myRule" ) ).build();

            searcher.search( query,
                             collector );
            final ScoreDoc[] hits = collector.topDocs().scoreDocs;

            assertEquals( 1,
                          hits.length );

            ( (LuceneIndex) index ).nrtRelease( searcher );
View Full Code Here

Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

                                                                                true );
            final Query query = new QueryBuilder().addTerm( new ValueTypeIndexTerm( "org.drools.workbench.screens.drltext.backend.server.indexing.classes.Applicant" ) ).build();

            searcher.search( query,
                             collector );
            final ScoreDoc[] hits = collector.topDocs().scoreDocs;
            assertEquals( 2,
                          hits.length );

            final List<KObject> results = new ArrayList<KObject>();
            for ( int i = 0; i < hits.length; i++ ) {
View Full Code Here

Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

                                                                                true );
            final Query query = new QueryBuilder().addTerm( new ValueTypeIndexTerm( "org.drools.workbench.screens.drltext.backend.server.indexing.classes.Mortgage" ) ).build();

            searcher.search( query,
                             collector );
            final ScoreDoc[] hits = collector.topDocs().scoreDocs;
            assertEquals( 1,
                          hits.length );

            final List<KObject> results = new ArrayList<KObject>();
            for ( int i = 0; i < hits.length; i++ ) {
View Full Code Here

Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

            query.add( new TermQuery( new Term( RuleAttributeValueIndexTerm.TERM,
                                                "nonexistent" ) ),
                       BooleanClause.Occur.MUST );
            searcher.search( query,
                             collector );
            final ScoreDoc[] hits = collector.topDocs().scoreDocs;

            assertEquals( 0,
                          hits.length );

            ( (LuceneIndex) index ).nrtRelease( searcher );
View Full Code Here

Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

            query.add( new TermQuery( new Term( RuleAttributeValueIndexTerm.TERM,
                                                "myruleflowgroup" ) ),
                       BooleanClause.Occur.MUST );
            searcher.search( query,
                             collector );
            final ScoreDoc[] hits = collector.topDocs().scoreDocs;

            assertEquals( 1,
                          hits.length );

            ( (LuceneIndex) index ).nrtRelease( searcher );
View Full Code Here

Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

      limit = 1; // the collector does not alow numHits = 0
    }
    topN = Math.min(topN, limit);
    TopScoreDocCollector hitCollector = TopScoreDocCollector.create(topN, after, true);
    DrillSidewaysResult r = search(query, hitCollector, fsp);
    return new DrillSidewaysResult(r.facetResults, hitCollector.topDocs());
  }

  /** Override this to use a custom drill-down {@link
   *  FacetsAccumulator}. */
  protected FacetsAccumulator getDrillDownAccumulator(FacetSearchParams fsp) throws IOException {
View Full Code Here

Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

        }
        assertEquals(expectedResult, actualResult);

        // Asserting TopDocs...
        TopDocs expectedTopDocs = createExpectedTopDocs(randomValue, from, scoreMode, context);
        TopDocs actualTopDocs = topScoreDocCollector.topDocs();
        assertEquals(expectedTopDocs.totalHits, actualTopDocs.totalHits);
        assertEquals(expectedTopDocs.scoreDocs.length, actualTopDocs.scoreDocs.length);
        if (scoreMode == ScoreMode.None) {
          continue;
        }
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.