Package org.apache.lucene.search

Examples of org.apache.lucene.search.FilteredQuery$PrimaryAdvancedLeapFrogScorer


        }
        wrapped = wrappedBQ;
      }

      for(Filter filter : filters) {
        wrapped = new FilteredQuery(wrapped, filter, FilteredQuery.QUERY_FIRST_FILTER_STRATEGY);
      }

      return wrapped;
    }
  }
View Full Code Here


  private static TopDocs doSearch(IndexSearcher searcher, ScoreDoc after, Query q, Filter filter, int n, Sort sort,
                                  boolean doDocScores, boolean doMaxScore, Collector fc) throws IOException {

    if (filter != null) {
      q = new FilteredQuery(q, filter);
    }

    int limit = searcher.getIndexReader().maxDoc();
    if (limit == 0) {
      limit = 1;
View Full Code Here

    Element queryElement = DOMUtils.getChildByTagOrFail(e, "Query");
    queryElement = DOMUtils.getFirstChildOrFail(queryElement);
    Query q = queryFactory.getQuery(queryElement);

    FilteredQuery fq = new FilteredQuery(q, f);
    fq.setBoost(DOMUtils.getAttribute(e, "boost", 1.0f));
    return fq;
  }
View Full Code Here

        valueSource = makeDistanceValueSource(shape.getCenter());

        ValueSourceFilter vsf = new ValueSourceFilter(
            new QueryWrapperFilter( spatial ), valueSource, 0, circle.getRadius() );

        spatial = new FilteredQuery( new MatchAllDocsQuery(), vsf );
      }
    }
    else if( op == SpatialOperation.IsDisjointTo ) {
      spatial =  makeDisjoint(bbox);
    }
View Full Code Here

    new FieldQuery(q, reader, true, true );
  }
 
  public void testFlattenFilteredQuery() throws Exception {
    initBoost();
    Query query = new FilteredQuery(pqF( "A" ), new Filter() {
      @Override
      public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs)
          throws IOException {
        return null;
      }
    });
    query.setBoost(boost);
    FieldQuery fq = new FieldQuery( query, true, true );
    Set<Query> flatQueries = new HashSet<>();
    fq.flatten( query, reader, flatQueries );
    assertCollectionQueries( flatQueries, tq( boost, "A" ) );
  }
View Full Code Here

        numHighlights = 0;
        RangeFilter rf = new RangeFilter("contents", "john", "john", true, true);
        SpanQuery clauses[] = { new SpanTermQuery(new Term("contents", "john")),
            new SpanTermQuery(new Term("contents", "kennedy")), };
        SpanNearQuery snq = new SpanNearQuery(clauses, 1, true);
        FilteredQuery fq = new FilteredQuery(snq, rf);

        doSearching(fq);
        doStandardHighlights(analyzer, hits, query, HighlighterTest.this);
        // Currently highlights "John" and "Kennedy" separately
        assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
View Full Code Here

        numHighlights = 0;
        RangeFilter rf = new RangeFilter("contents", "john", "john", true, true);
        PhraseQuery pq = new PhraseQuery();
        pq.add(new Term("contents", "john"));
        pq.add(new Term("contents", "kennedy"));
        FilteredQuery fq = new FilteredQuery(pq, rf);

        doSearching(fq);
        doStandardHighlights(analyzer, hits, query, HighlighterTest.this);
        // Currently highlights "John" and "Kennedy" separately
        assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
View Full Code Here

       Element queryElement=DOMUtils.getChildByTagOrFail(e,"Query");
       queryElement=DOMUtils.getFirstChildOrFail(queryElement);
       Query q=queryFactory.getQuery(queryElement);
      
       FilteredQuery fq = new FilteredQuery(q,f);
       fq.setBoost(DOMUtils.getAttribute(e,"boost",1.0f));
       return fq;   
  }
View Full Code Here

       Element queryElement=DOMUtils.getChildByTagOrFail(e,"Query");
       queryElement=DOMUtils.getFirstChildOrFail(queryElement);
       Query q=queryFactory.getQuery(queryElement);
      
       FilteredQuery fq = new FilteredQuery(q,f);
       fq.setBoost(DOMUtils.getAttribute(e,"boost",1.0f));
       return fq;   
  }
View Full Code Here

        numHighlights = 0;
        TermRangeFilter rf = new TermRangeFilter("contents", "john", "john", true, true);
        SpanQuery clauses[] = { new SpanTermQuery(new Term("contents", "john")),
            new SpanTermQuery(new Term("contents", "kennedy")), };
        SpanNearQuery snq = new SpanNearQuery(clauses, 1, true);
        FilteredQuery fq = new FilteredQuery(snq, rf);

        doSearching(fq);
        doStandardHighlights(analyzer, hits, query, HighlighterTest.this);
        // Currently highlights "John" and "Kennedy" separately
        assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.FilteredQuery$PrimaryAdvancedLeapFrogScorer

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.