Package org.apache.lucene.search

Examples of org.apache.lucene.search.QueryWrapperFilter


  }

  @Factory
  public Filter getFilter() {
    Query query = new TermQuery( new Term("teacher", login) );
    return new QueryWrapperFilter(query);
  }
View Full Code Here


  private String value;

  @org.hibernate.search.annotations.Factory
  public Filter buildFilter() {
    Query q = new TermQuery( new Term( field, value ) );
    Filter filter = new QueryWrapperFilter( q );
    filter = new CachingWrapperFilter( filter );
    return filter;
  }
View Full Code Here

                    .createQuery()
            )
            .createQuery();
        org.apache.lucene.search.Query filteredQuery = new ConstantScoreQuery(
            SpatialQueryBuilderFromCoordinates.buildDistanceFilter(
                new QueryWrapperFilter( query ),
                center,
                radius,
                "location"
            )
        );
View Full Code Here

  }

  @Factory
  public Filter getFilter() {
    Query query = new TermQuery( new Term("teacher", login) );
    return new QueryWrapperFilter(query);
  }
View Full Code Here

    final Filter fastMatchFilter;
    final AtomicBoolean filterWasUsed = new AtomicBoolean();
    if (random().nextBoolean()) {
      // Sort of silly:
      fastMatchFilter = new CachingWrapperFilter(new QueryWrapperFilter(new MatchAllDocsQuery())) {
          @Override
          protected DocIdSet cacheImpl(DocIdSetIterator iterator, AtomicReader reader)
            throws IOException {
            final FixedBitSet cached = new FixedBitSet(reader.maxDoc());
            filterWasUsed.set(true);
View Full Code Here

      return cachedFilter; // cache hit
    }

    //cache miss
    if (qb != null) {
      cachedFilter = new QueryWrapperFilter(q);
    } else {
      cachedFilter = new CachingWrapperFilter(f);
    }

    filterCache.put(cacheKey, cachedFilter);
View Full Code Here

    ConstantScoreQuery csq = makeQuery(args);
    Filter filter = csq.getFilter();
    if (filter != null)
      return filter;
    else
      return new QueryWrapperFilter(csq.getQuery());
  }
View Full Code Here

      return new ConstantScoreQuery(makeWithin(bbox));
    } else if (shape instanceof Circle) {
      Circle circle = (Circle)shape;
      Rectangle bbox = circle.getBoundingBox();
      ValueSourceFilter vsf = new ValueSourceFilter(
          new QueryWrapperFilter(makeWithin(bbox)),
          makeDistanceValueSource(circle.getCenter()),
          0,
          circle.getRadius() );
      return new ConstantScoreQuery(vsf);
    } else {
View Full Code Here

        // Make the ValueSource
        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 ) {
View Full Code Here

    writer.forceMerge(1);
    final DirectoryReader indexReader = writer.getReader();
    writer.close();

    final AtomicReader reader = getOnlySegmentReader(indexReader);
    final Filter parentsFilter = new FixedBitSetCachingWrapperFilter(new QueryWrapperFilter(new TermQuery(new Term("parent", "true"))));
    final FixedBitSet parentBits = (FixedBitSet) parentsFilter.getDocIdSet(reader.getContext(), null);
    final NumericDocValues parentValues = reader.getNumericDocValues("parent_val");

    final NumericDocValues childValues = reader.getNumericDocValues("child_val");
View Full Code Here

TOP

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

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.