Package org.apache.lucene.search

Examples of org.apache.lucene.search.FilteredQuery


    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();
    //Currently highlights "John" and "Kennedy" separately
    assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 2);
View Full Code Here


  {
    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();
    //Currently highlights "John" and "Kennedy" separately
    assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 2);
View Full Code Here

    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();
    //Currently highlights "John" and "Kennedy" separately
    assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 2);
View Full Code Here

  {
    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();
    //Currently highlights "John" and "Kennedy" separately
    assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 2);
View Full Code Here

   * @return Lucene Query to be used in a search
   * @see org.apache.lucene.search.Query
   * @see org.hibernate.search.spatial.Coordinates
   */
  public static Query buildGridQuery(Point center, double radius, String fieldName) {
    return new FilteredQuery( new MatchAllDocsQuery(  ), buildGridFilter( center, radius, fieldName ) );
  }
View Full Code Here

   * @see Query
   * @see org.hibernate.search.spatial.Coordinates
   */
  public static Query buildDistanceQuery(Point center, double radius, String fieldName) {
    Filter allFilter = new QueryWrapperFilter( new MatchAllDocsQuery() );
    return new FilteredQuery( new MatchAllDocsQuery(  ), buildDistanceFilter( allFilter, center, radius, fieldName ) );
  }
View Full Code Here

   * @return Lucene Query to be used in a search
   * @see Query
   * @see org.hibernate.search.spatial.Coordinates
   */
  public static Query buildSpatialQueryByGrid(Point center, double radius, String fieldName) {
    return new FilteredQuery( new MatchAllDocsQuery(  ),
        buildDistanceFilter(
            buildGridFilter( center, radius, fieldName ),
            center,
            radius,
            fieldName
View Full Code Here

    BooleanQuery boxQuery = new BooleanQuery();
    boxQuery.add(latQuery, BooleanClause.Occur.MUST);
    boxQuery.add(longQuery, BooleanClause.Occur.MUST);

    return new FilteredQuery(
        new MatchAllDocsQuery(  ),
        buildDistanceFilter(
            new QueryWrapperFilter( boxQuery ),
            center,
            radius,
View Full Code Here

   * @return Lucene Query to be used in a search
   * @see org.apache.lucene.search.Query
   * @see org.hibernate.search.spatial.Coordinates
   */
  public static Query buildSpatialHashQuery(Coordinates center, double radius, String fieldName) {
    return new FilteredQuery( new MatchAllDocsQuery(), buildSpatialHashFilter( center, radius, fieldName ) );
  }
View Full Code Here

   * @see Query
   * @see org.hibernate.search.spatial.Coordinates
   */
  public static Query buildDistanceQuery(Coordinates center, double radius, String fieldName) {
    Filter allFilter = new QueryWrapperFilter( new MatchAllDocsQuery() );
    return new FilteredQuery( new MatchAllDocsQuery(), buildDistanceFilter( allFilter, center, radius, fieldName ) );
  }
View Full Code Here

TOP

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

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.